-
Notifications
You must be signed in to change notification settings - Fork 258
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
Static binary? #174
Comments
Static binaries on glibc-based systems cannot do DNS lookups, which we need to be able to do, so a purely static binary isn't an option. However, I agree that we should statically link everything other than glibc. (glibc itself has a very stable ABI, so this should be good enough to get all the advantages of a static binary.) |
FWIW, Matt D is having a problem installing workerd by way of miniflare:
He's on Ubuntu 20.04 which admittedly very old. Does it make sense to at least distribute workerd built against a very old glibc to ease compat issues like that. |
Simple install scripts that does a local check or two could be another way to work around issues like these. |
I think Ubuntu 20 has other problems (I don't think you can easily install the right libc version). Ubuntu 22 is probably the best bet for now, until there are static (ish) binaries that can be built against an old glibc |
As of the latest workerd and wrangler releases, we now statically link libc++ and dynamically link against glibc 2.31. While it is not a fully static build (libc, libm and pthread are dynamically linked), it should fix the issues with library versions on at least Ubuntu 20.04 and Debian Bullseye. |
@fhanau Nice work! Dynamically linking against glibc (at an older version) is the right thing to do. Statically linking glibc would lead to problems with DNS lookup and other functionality which glibc itself loads dynamically. So it sounds like we're at the right end state now. (libc, libm, and pthread are all part of glibc.) |
I think distribution and overall usage would benefit from shipping
workerd
as a static binary.Refs: #46, #170, cloudflare/workers-sdk#2173
The text was updated successfully, but these errors were encountered: