-
Notifications
You must be signed in to change notification settings - Fork 291
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
support: use cgo to generate Go constants from eBPF #332
Conversation
c6696f4
to
165a7c6
Compare
Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
This comment was marked as resolved.
This comment was marked as resolved.
Probably for another PR, but shouldn't we have a CI check that runs |
#!/usr/bin/env bash | ||
|
||
set -eu | ||
|
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.
nit: Use a exit function for the cleanup like
function cleanup {
# Clean up temporary files
rm -rf _obj/ types_gen.go
}
trap cleanup EXIT
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.
Replacing a single line instruction with a multiple line alternative feels not right. Such clean up functions make sense, if they are more complex. But I don't see the need for this case.
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.
I just ended up too often after a failure or a ctrl-c with temporary files on my disk. It is a bit annoying and costs my time. A proper cleanup is good engineering practice.
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.
If the intermediate files are not useful for debugging failures (and they don't seem to be) let's add cleanup here like @rockdaboot suggests. The other option would be to add them to make clean
.
EDIT: Actually maybe make clean
is better as the intermediate files being present can speed up debugging a failure and updating support/types.go
.
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.
Just out of interest, how often are you going to debug the constants so that it is worth it to always keep intermediate files? (My gut feeling says never)
This exists already. The Makefile target
|
Ah, sorry, I looked for |
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.
Too bad that there is the -m64
when cross-compiling, so that this shell script is required 😞
Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
#!/usr/bin/env bash | ||
|
||
set -eu | ||
|
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.
If the intermediate files are not useful for debugging failures (and they don't seem to be) let's add cleanup here like @rockdaboot suggests. The other option would be to add them to make clean
.
EDIT: Actually maybe make clean
is better as the intermediate files being present can speed up debugging a failure and updating support/types.go
.
Co-authored-by: Christos Kalkanis <christos.kalkanis@elastic.co>
Pragmatic approach to get rid of some CGO parts.
Creating just a draft atm to figure out details and more testing.
Fixes #331