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

refactor: Use FetchContent for integrating three bundled libs #3107

Conversation

federico-sysdig
Copy link
Contributor

@federico-sysdig federico-sysdig commented Feb 21, 2024

What type of PR is this?
/kind cleanup

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

What this PR does / why we need it:

Libraries nlohmann-json, yaml-cpp, and cpp-httplib in their "bundled" configuration are now integrated through the CMake construct FetchContent rather than ExternalProject_Add. This has the benefit of being treated in a way similar to integrating the library with find_package, thus making the bundled/non-bundled approach similar in the rest of the code.

One important beneficial consequence is the simplification in client code: new targets can reference falco_engine without having to specify these libs in their include path or explicitly link against it, because the target falco_engine brings all the needed properties on board through the usage of aliases such as httplib::httplib or nlohmann_json::nlohmann_json.
The libraries have also been upgraded as newer versions provide the target aliases and allow integration with FetchContent without building the library's test targets, which obviously Falco doesn't need.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

@FedeDP
Copy link
Contributor

FedeDP commented Feb 21, 2024

/milestone 0.38.0

@poiana poiana added this to the 0.38.0 milestone Feb 21, 2024
FedeDP
FedeDP previously approved these changes Feb 21, 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 Feb 21, 2024

LGTM label has been added.

Git tree hash: 425fd2f9b0bed58b08634efa5789766de2449da4

@leogr
Copy link
Member

leogr commented Feb 22, 2024

This will likely conflict with #3092

I suggest to merge #3092 first, then this.

/hold

Comment on lines -19 to -20
#define CPPHTTPLIB_OPENSSL_SUPPORT
#define CPPHTTPLIB_ZLIB_SUPPORT
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These two defines were resulting in a warning that the definition was already present.

@federico-sysdig federico-sysdig force-pushed the refactor-use-fetchcontent-for-njson-bundled-lib branch from c9bd179 to 3867147 Compare February 25, 2024 14:35
@federico-sysdig federico-sysdig changed the title refactor: Use FetchContent for integrating bundled nlohman-json lib refactor: Use FetchContent for integrating three bundled libs Feb 25, 2024
@FedeDP
Copy link
Contributor

FedeDP commented Feb 28, 2024

Ehy @federico-sysdig can you rebase? It should fix CI issues!

@federico-sysdig federico-sysdig force-pushed the refactor-use-fetchcontent-for-njson-bundled-lib branch from 3867147 to 51bfa9b Compare February 28, 2024 07:35
@federico-sysdig
Copy link
Contributor Author

Ehy @federico-sysdig can you rebase? It should fix CI issues!

@FedeDP Sure. Done!

@federico-sysdig federico-sysdig force-pushed the refactor-use-fetchcontent-for-njson-bundled-lib branch from 51bfa9b to 9498ee8 Compare February 28, 2024 08:01
Copy link
Member

@leogr leogr left a comment

Choose a reason for hiding this comment

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

@poiana
Copy link
Contributor

poiana commented Feb 29, 2024

LGTM label has been added.

Git tree hash: 49b7a5a713ef9b7607c714d433739c384e82f1fc

@poiana
Copy link
Contributor

poiana commented Mar 11, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: FedeDP, federico-sysdig, jasondellaluce, leogr

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 [FedeDP,jasondellaluce,leogr]

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

@FedeDP
Copy link
Contributor

FedeDP commented Mar 11, 2024

/unhold

@poiana poiana merged commit 8dbec6c into falcosecurity:master Mar 11, 2024
26 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants