-
Notifications
You must be signed in to change notification settings - Fork 101
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
Allow users to choose libc version #863
Comments
We build against an exceedingly old version of glibc for compatibility reasons; Luckily, we include recent kernel headers, so you can go through and anytime in the source you see This isn't really something we should ask upstream to change; it's a peculiarity of how we're building things in BB, and it's non-portable; you shouldn't do this on FreeBSD and MacOS, for instance. You can build up a patch and conditionally apply it within the BB environment. :) |
Oh I see. Jack2 is failing to build for me too; it doesn't seem like PRIu64 is working, which was added in C99. Could it be for similar reasons? |
In any case, I think it would be nice if this were documented. |
Like in https://juliapackaging.github.io/BinaryBuilder.jl/dev/tricksy_gotchas/ and https://github.com/JuliaPackaging/Yggdrasil/blob/f12d86ad889cb9880dff9c4d25bd49c9fbdd6d24/RootFS.md#glibc-versions? |
Oh I hadn't seen those. But unless I'm missing something I don't see anything about how to replace with the linux headers? |
@bramtayl could you submit a PR that adds a note to the |
Ok, will do. Sidenote I tried doing it in my example (util-linux) and C threw a bunch of errors about structs being defined more than once. I think I'll have to just add the line defining O_PATH. |
Those errors are because other files are still including |
I wonder if it might be nicer to have a utility function to do it for users? I had a sed script written up; we could potentially build a binary of sed (or just use julia's file functions). |
This is very much a case-by-case fix; It will require a user going through and changing all of the ones that need to be changed. I think a tool to fix this would need to: (a) find all references to glibc headers within all source files in the current package. It doesn't seem easy to me to do this automatically. |
Out of curiousity, what would be the problem with just using a newer version of glibc? |
Users with an old glibc wouldn't be able to use our binaries |
@staticfloat I ran
so I'm pretty sure that all of the fcntl.h header files have been replaced. I'm still getting the redefinition errors listed below.
Do you have ideas of what to try next? Sorry I'm so hopeless at this. |
No worries at all! This is how you level up in dealing with horrible C compile problems. :) So your error message is actually telling you precisely where the problems are. Let's peel apart the first couplet:
This says "Hey, there are two |
I've making some progress, but it looks like there's not a neat correspondence between the new headers and the old headers. I don't see
|
@bramtayl can you upload your progress somewhere so I can take a look? |
I've updated JuliaPackaging/Yggdrasil#1367 with my progress so far |
I'm running into similar issues building systemd, and using an older version doesn't seem like it will work this time. It seems like their must be an easy solution. Maybe there's a way to add compatibility packages for newer versions of libc or something? |
@giordano can you give more detail here? It seems to me that glibc is mostly backwards compatible, and also, it shouldn't matter because the binaries are shipped already compiled? In any case, I think there should be an option to opt into a newer version of glibc, because I'm 95% certain systemd can't be built on binarybuilder as is. |
glibc is backwards compatible in that if you build against glibc 2.12, it will run on glibc 2.14. It is not forwards compatible, in that if you build on glibc 2.14 it may not run on glibc 2.12. To see examples of this, just search for error messages like
We may actually be able to just upgrade the glibc that we require. Right now we are very, very compatible; glibc 2.12 allows us to support CentOS 6, which is EOL'ing quite soon (full updates stopped in 2017, maintenance updates stop at the end of November, 2020). CentOS 7 bumps glibc up to 2.17 and is supported through 2024, and that's the oldest distro I can find that's currently supported and that we might possibly care about. Do you know if glibc 2.17 would be enough to build systemd? |
Oh I see, never mind about the backwards compatibility thing. According to the README systemd requires glibc >= 2.16 so I think 2.17 should do it (still can't guarantee I'll be able to build systemd in the first place but I'll try my darnedest) |
I think I can wait until the end of November too, there's no real urgency |
@staticfloat guess what month it is?!!! |
Just to clarify, it looks like CentOS6 has EOL'ed, so a newer libc should be ok? |
Ok, so after a bit of thought, I think the best way to go about solving this would be to allow users to choose the version of libc they want. After all, we let them choose which version of gcc to use, so I don't see why this shouldn't be allowed either. I'm still struggling with Jack2 due to the libc version I think. |
If I understand correctly, it's not that easy to "let the user choose the glibc version" as we'd need to build different compiler shards for each of them, which leads to an explosion of toolchains |
Yes, I thought about that...and it doesn't help that they've already made it to glibc 2.33, leaving a lot of versions to choose from. I'm not sure what do about that, but I thought this might be a little more palatable than JuliaPackaging/Yggdrasil#2435 (which didn't seem to go anywhere), because you can blame any version incompatibilities on the user |
If we could bump glibc to 2.17 as suggested, that would also probably solve JuliaPackaging/Yggdrasil#3513
|
even though it should be, in both glibc and musl. See util-linux/util-linux#1002 (comment) for some ideas about what might be going on.
The text was updated successfully, but these errors were encountered: