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(cmake): add libcurl as a libsinsp dependency #83

Merged
merged 1 commit into from Sep 21, 2021
Merged

fix(cmake): add libcurl as a libsinsp dependency #83

merged 1 commit into from Sep 21, 2021

Conversation

ghost
Copy link

@ghost ghost commented Sep 17, 2021

Signed-off-by: lucklypse lucklypse@gmail.com

What type of PR is this?

Uncomment one (or more) /kind <> lines:

/kind bug

/kind cleanup

/kind design

/kind documentation

/kind failing-test

/kind feature

Any specific area of the project related to this PR?

Uncomment one (or more) /area <> lines:

/area build

/area driver-kmod

/area driver-ebpf

/area libscap

/area libsinsp

/area tests

/area proposals

What this PR does / why we need it:

libsinsp requires curl: https://github.com/falcosecurity/libs/blob/master/userspace/libsinsp/container.h#L30
libcurl is part of the statically linked dependencies, but its include path was not added to the relative cmake file, therefore compilation may fail with fatal error: curl/curl.h: No such file or directory unless curl was included from another project.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

@poiana
Copy link
Contributor

poiana commented Sep 17, 2021

Hi @lucklypse. Thanks for your PR.

I'm waiting for a falcosecurity member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@poiana poiana added the size/XS label Sep 17, 2021
@leogr
Copy link
Member

leogr commented Sep 20, 2021

/ok-to-test

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.

curl is already included here 👇

Moreover, curl should not be included when the MINIMAL_BUILD is on.

Finally, if you dependant project uses uses curl, perhaps you should include it there and not here. Is that your case?

Signed-off-by: lucklypse <lucklypse@gmail.com>
@ghost
Copy link
Author

ghost commented Sep 20, 2021

Thanks @leogr ! Good catch on the minimal build.
My understanding of cmake is very limited, after looking it looks to me that those libraries are included in both files. It looks like the scope of the include is the CMakeLists.txt that is being processed, so the ones in the CMakeLists are local to libsinsp, while the ones in the module may be acting on whichever CMakeLists is including the module (such as Falco). In addition it seems to me that libsinsp also creates a variable that contains absolute paths to includes, which I've now added for libcurl.

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.

Ok, it does make sense to me now.

As a note for reviewers, I can confirm the issue was present. Usually, it did not happen since the building process was wrongly using the curl installed on the system. Moreover, it does not happen in Falco because it is manually included here.

That being said, I understand that libs' consumers may just want to directly rely on the libs cmake configuration without the need of specifying the deps manually. So, thank you for fixing this 👍

/approve

@poiana
Copy link
Contributor

poiana commented Sep 21, 2021

LGTM label has been added.

Git tree hash: 872ac191ea3a6de69573f52065fd38910360c43d

@poiana
Copy link
Contributor

poiana commented Sep 21, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: leogr, lucklypse

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:

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

Copy link
Member

@leodido leodido left a comment

Choose a reason for hiding this comment

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

I remember this issue being present.

LGTM

@poiana poiana merged commit 1e9c3c7 into falcosecurity:master Sep 21, 2021
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.

4 participants