-
Notifications
You must be signed in to change notification settings - Fork 4
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
ci: multi-compiler testing #10
Conversation
Introduce matrix strategy to test workflow, testing different gcc compiler versions. Factor out build steps into a build.sh script. Signed-off-by: Ihor Solodrai <[email protected]>
e7136b7
to
5e05121
Compare
5e05121
to
6f50e28
Compare
@danobi I've run into issues trying to get the latest version of bpftrace on arm64. I saw bpftrace/bpftrace#2868, so I understand there is no official arm64 binary/appimage. I tried building from source using steps from Dockerfile.ubuntu, this doesn't work: cmake fails with a cmake error:
Locally, in a
bpftrace can be installed with apt, but currently on ubuntu-arm runners it's a v0.20.2, which seems to not work with the USDT tests here (I don't know if bpftrace at fault here though):
From the point of view of this CI the easiest way is to simply download arm64 appimage from github releases. Are there any plans to ship that? |
@anakryiko a couple of questions to you. Is it enough to test only x86_64 and arm64, or do we also want all other stuff (s390x, powerpc)? When testing other arch-es, do you want to test cross-compilation on x86_64 or native builds? Maybe both? I briefly tried LLVM locally, and ran into errors. Haven't tried to debug, just FYI:
|
Well, as many as possible, within reasonable amount of effort to implement (and maintain!) that. So hard to answer this definitively without knowing how much effort it would require. But to be practical, I'd start with x86_64 and arm64, as two most popular architectures. So let's avoid extra qemu work for now.
See above, all depends on amount of effort. It's all tradeoffs. Your time and effort are not free. So let's make the decision based on projected amount of effort. |
Optionally build bpftrace from source. Signed-off-by: Ihor Solodrai <[email protected]>
The "struct_by_val_reg" case of arg_types tests fails with BPF verifier error when compiled with clang. It appears that bpftrace generates a faulty program in such case, possibly due to the difference between how clang and gcc encode USDT probe arguments. Since this is the only problematic test case for LLVM, make it conditional on __clang__ for now. Signed-off-by: Ihor Solodrai <[email protected]>
Update CI scripts to also build the tests with various versions of LLVM. Versions below 17 can't be installed with the official llvm.sh script, so for now let's test only 17+. Signed-off-by: Ihor Solodrai <[email protected]>
a153bca
to
264d14c
Compare
@anakryiko I think we can land this in current state. We get testing of a couple of versions of GCC and LLVM. Enabling arm64 will be trivial, if we get bpftrace appimage (or static build) for arm. Re the problematic test case: I suspect this may be a bug in bpftrace, because it produces a BPF program that fails verification:
If I'm reading this correctly, it tries to read 16 bytes from %rsp-8, going over it. I am guessing the reason there is a difference with gcc is in how trace probe arguments are passed. Compare:
This is a case when a struct with two longs is passed by value:
And then bpftrace script is:
For this PR I conditionalized the case on |
Opened an issue at bpftrace: bpftrace/bpftrace#3798 |
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.
this is not really clang vs gcc issue, it's more of an level of optimization, but let's land it as is while we are figuring out where exactly to fix the issue (usdt.h or bpftrace/bcc)
Introduce matrix strategy to test workflow, testing different gcc compiler versions. Factor out build steps into a build.sh script.