-
Notifications
You must be signed in to change notification settings - Fork 110
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
Compile as statically linked binary #601
Conversation
This will enable static linking on Linux hosts, avoiding errors like '/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found' when deploying binaries on older Linux distributions.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #601 +/- ##
===========================================
+ Coverage 69.49% 79.87% +10.37%
===========================================
Files 67 70 +3
Lines 5826 5942 +116
===========================================
+ Hits 4049 4746 +697
+ Misses 1498 974 -524
+ Partials 279 222 -57
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
LGTM! Thanks again Tiago!
I checked all the vendor code which uses import "C"
and I can't see anything that's relevant for Beyla. I think this will work.
@mariomac what do you think? If this resolves our Debian buster libc compatibility issues it's a great win.
Sorry it took a while to review, we were at FOSDEM talking about distributed tracing with eBPF :). |
I was expecting a compilation error in cases like that, but looks like this isn't how it works. Like this Go SQLite example:
All we get is a runtime error. Maybe also running
Debian 10 (Buster) probably won't work with the default 4.19 kernel, but the 5.10 kernel is available in the backports. What's the actual target? Debian 10 (Buster) or Debian 11 (Bullseye)?
No problem at all. I'll be in the lookout for the recording. :-) |
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.
Interesting! I'd expect that "CGO_ENABLED=0" was the default value.
Thanks @myhro, sorry I got the names confused, I meant bullseye really :). |
Hi. Continuing the issue #390 investigation (which started on #600), I've confirmed that Beyla fails to start on Debian 11 (Bullseye) when using a binary compiled on Debian 12 (Bookworm) due to GLIBC version incompatibilities:
Following the suggestion of producing statically linked binaries, it appears that simply disabling CGO was enough to make it work:
Do you think this is a reasonable solution to the problem of running Beyla on systems with older versions of GLIBC?
Closes #390.