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

wip: fix(pkg/driverbuilder): fixed bpf probe build for new libs. #283

Closed
wants to merge 2 commits into from

Conversation

FedeDP
Copy link
Contributor

@FedeDP FedeDP commented Jul 6, 2023

What type of PR is this?

/kind bug

Any specific area of the project related to this PR?

/area pkg

What this PR does / why we need it:

This adds support (in a backward compatible manner) to falcosecurity/libs#1188.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

fix(pkg/driverbuilder): fixed bpf build for new libs.

@poiana poiana added dco-signoff: yes kind/bug Something isn't working labels Jul 6, 2023
@poiana
Copy link

poiana commented Jul 6, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: FedeDP

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

@FedeDP
Copy link
Contributor Author

FedeDP commented Jul 6, 2023

Most of the changes are in:

  • docker.go
  • kubernetes.go
  • templates.go

Also, i had to update all target templates so that:

  • they make use of new bpf Makefile (either templated, if coming from new libs, or exactly driver/bpf/Makefile for old libs versions, ie: the downloaded Makefile)
  • they only copy to DriverBuildDir kmod makefile if kmod build is requested

@poiana poiana added size/XL and removed size/L labels Jul 6, 2023
"fill-driver-config.sh": bufFillDriverConfig.String(),
"downloader.sh": waitForLockAndCat,
"unlock.sh": deleteLock,
},
}
if c.BuildModule() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Only copy them if needed.

{"/driverkit/fill-driver-config.sh", bufFillDriverConfig.String()},
}
if c.BuildModule() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Only copy them if needed.

MakeObjList string
}

const makefileBpfTemplate = `
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Biggest change in the diff: added the current libs master bpf Makefile as a template.

@FedeDP
Copy link
Contributor Author

FedeDP commented Jul 6, 2023

Note: tests are failing because of the flaky test fixed by df0c327

@FedeDP
Copy link
Contributor Author

FedeDP commented Jul 7, 2023

Rebased on top of master to fix flaky test.

@FedeDP
Copy link
Contributor Author

FedeDP commented Jul 7, 2023

/hold

@FedeDP
Copy link
Contributor Author

FedeDP commented Aug 2, 2023

This will be only needed if falcosecurity/libs#1188 is merged.

var deps string
for _, l := range lines {
l = strings.TrimSpace(l)
if strings.HasPrefix(l, "set(BPF_SOURCES") {
Copy link
Contributor

Choose a reason for hiding this comment

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

Not ideal having to make this so code so tightly coupled to the contents of the CMakeLists.txt file, are there any other options for obtaining the deps sources list? Probably not, just wondering out loud =)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep this code is really ugly :( it's so hard to deal with new and old versions, without breaking backward compatibility.
Btw for now this PR is on hold because it is only needed if falcosecurity/libs#1188 PR gets merged in libs :)

Copy link
Contributor

@dwindsor dwindsor left a comment

Choose a reason for hiding this comment

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

1 comment otherwise lgtm 🔥

@FedeDP FedeDP changed the title fix(pkg/driverbuilder): fixed bpf probe build for new libs. wip: fix(pkg/driverbuilder): fixed bpf probe build for new libs. Sep 5, 2023
@FedeDP
Copy link
Contributor Author

FedeDP commented Nov 29, 2023

This would be automatically fixed too in case we go with #302.

@poiana
Copy link

poiana commented Feb 27, 2024

Issues go stale after 90d of inactivity.

Mark the issue as fresh with /remove-lifecycle stale.

Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Provide feedback via https://github.com/falcosecurity/community.

/lifecycle stale

@FedeDP
Copy link
Contributor Author

FedeDP commented Feb 27, 2024

/remove-lifecycle stale

@FedeDP
Copy link
Contributor Author

FedeDP commented Feb 28, 2024

Close because #302 was merged.
/close

@poiana poiana closed this Feb 28, 2024
@poiana
Copy link

poiana commented Feb 28, 2024

@FedeDP: Closed this PR.

In response to this:

Close because #302 was merged.
/close

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.

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.

3 participants