-
Notifications
You must be signed in to change notification settings - Fork 52
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(pkg/driverbuilder): multiple small fixes to local builder. #342
Conversation
NOTE: this is |
Signed-off-by: Federico Di Pierro <[email protected]>
@@ -44,6 +44,7 @@ func NewLocalCmd(configOpts *ConfigOptions, rootOpts *RootOptions, rootFlags *pf | |||
} | |||
return driverbuilder.NewLocalBuildProcessor(opts.useDKMS, | |||
opts.downloadHeaders, | |||
false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Always print command output from within driverkit.
Falcoctl will, instead, only print on error to avoid being too noisy.
@@ -20,7 +20,7 @@ | |||
# looking for it in a bunch of ways. Convenient when running Falco inside | |||
# a container or in other weird environments. | |||
# | |||
set -xeo pipefail | |||
set -xeuo pipefail |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as other tempaltes.
@@ -166,6 +169,12 @@ func (lbp *LocalBuildProcessor) Start(b *builder.Build) error { | |||
|
|||
for _, gcc := range gccs { | |||
vv.GccPath = gcc | |||
if c.ModuleFilePath != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some debug info.
} | ||
err = cmd.Wait() | ||
} | ||
out, err := cmd.CombinedOutput() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to pipe and scan stdout/stderr: we are always behind a stylish spinner now, therefore we will never print these lines in real time.
} | ||
|
||
// If we built the probe, disable its build for subsequent attempts (with other available gccs) | ||
if c.ProbeFilePath != "" { | ||
if _, err = os.Stat(srcProbePath); !os.IsNotExist(err) { | ||
if err = copyDataToLocalPath(srcProbePath, b.ProbeFilePath); err != nil { | ||
if err = copyDataToLocalPath(srcProbePath, c.ProbeFilePath); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use c.
instead of b.
for coherence everywhere.
Signed-off-by: Federico Di Pierro <[email protected]>
This fixes the build. Signed-off-by: Federico Di Pierro <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me 🙂
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: EXONER4TED, 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 |
This fixes the build. Signed-off-by: Federico Di Pierro <[email protected]>
Fix on top of #342. Signed-off-by: Federico Di Pierro <[email protected]>
Fix on top of #342. Signed-off-by: Federico Di Pierro <[email protected]>
What type of PR is this?
/kind bug
/kind cleanup
Any specific area of the project related to this PR?
/area pkg
What this PR does / why we need it:
This PR contains small fixes on top of local builder.
Also, support bumping
dkms log file
if dkms build fails.Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
NOTE: this PR bumps falcoctl to latest main, to take advantage of falcosecurity/falcoctl#550.
That is needed to avoid importing
pkg/options
package in driverkit that would lead to an import cycle when later driverkit gets imported in falcoctl.Does this PR introduce a user-facing change?: