Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: include paths when installed #1647

Merged

Conversation

federico-sysdig
Copy link
Contributor

@federico-sysdig federico-sysdig commented Jan 26, 2024

What type of PR is this?
/kind bug
/kind cleanup

Any specific area of the project related to this PR?
/area build

Does this PR require a change in the driver versions?
No

What this PR does / why we need it:
Fix a couple of issues with the include headers.

  1. When the library is installed the layout of the directories in include/falcosecurity/ has extra directories of directory layers that are not necessary, such as userspace/ and another unneeded include/. There might be other issues, but these two were the more evident ones and they are now fixed.
  2. The include paths that each CMake library target carries must be different when the library is being built and when the library is installed. CMake generator expressions ($<BUILD_INTERFACE:...>, $<INSTALL_INTERFACE:...>) allow to do that.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

#include <libsinsp/eventformatter.h>

#include <libsinsp/include/sinsp_external_processor.h>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from some re-ordering of the includes to put the standard ones at the end, the real change here is the removal of this libsinsp/include/... layer.

@FedeDP
Copy link
Contributor

FedeDP commented Jan 26, 2024

Thanks for this PR!
Tagging in people that use library externally from Falco: @Molter73 @terylt @geraldcombs , PTAL 🙏 !

@FedeDP
Copy link
Contributor

FedeDP commented Jan 26, 2024

/milestone 0.15.0

@poiana poiana added this to the 0.15.0 milestone Jan 26, 2024
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../plugin>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include/${LIBS_PACKAGE_NAME}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include/${LIBS_PACKAGE_NAME}/libsinsp>
Copy link
Contributor Author

@federico-sysdig federico-sysdig Jan 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@therealbobo Could you please check this? After your recent changes does it still make sense to have an include path that enters inside the libsinsp/ directory? I suppose it does if you want both these includes to work:

#include <libsinsp/sinsp.h> // modern way
#include <sinsp.h>          // legacy

It would be nice to have a single approach, though.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have to do some more cleanups of my leftovers! But yes, I completely agree on that! Let's go with <libsinsp/*> 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@therealbobo This PR has been stalling for a while, I have just rebased it to fix a conflict.
Are you expecting me to remove the support for the headers with no path (e.g. #include <sinsp.h>) in this PR? I can do that, but I need clear indication that it is ok and expected.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, exactly! I did a deep cleanup recently. I don't think that there's any header with a relative path.

@federico-sysdig federico-sysdig force-pushed the fix-include-paths-for-install branch from 47c632b to 8cac3da Compare January 26, 2024 11:17
@geraldcombs
Copy link
Contributor

The Cflags sections in the pkg-config files (userspace/libscap/libscap.pc.in and userspace/libsinsp/libsinsp.pc.in) need to be updated, but LGTM otherwise.

@federico-sysdig
Copy link
Contributor Author

federico-sysdig commented Jan 28, 2024

The Cflags sections in the pkg-config files (userspace/libscap/libscap.pc.in and userspace/libsinsp/libsinsp.pc.in) need to be updated, but LGTM otherwise.

Thanks for catching this! Fixed.

FedeDP
FedeDP previously approved these changes Jan 29, 2024
Copy link
Contributor

@FedeDP FedeDP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@poiana
Copy link
Contributor

poiana commented Jan 29, 2024

LGTM label has been added.

Git tree hash: 0d81ed30338dd283b1fc95a19c2a78a803120208

@federico-sysdig federico-sysdig force-pushed the fix-include-paths-for-install branch from d2d62cb to 57cdb55 Compare February 8, 2024 18:41
Copy link
Member

@Andreagit97 Andreagit97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@poiana
Copy link
Contributor

poiana commented Feb 9, 2024

LGTM label has been added.

Git tree hash: d16b037fb2793f17213bbc0a56ca521e45d70824

Copy link
Contributor

@incertum incertum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@poiana poiana merged commit 8a5cbfb into falcosecurity:master Feb 9, 2024
34 checks passed
@poiana
Copy link
Contributor

poiana commented Feb 9, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Andreagit97, FedeDP, federico-sysdig, incertum

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [Andreagit97,FedeDP,incertum]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants