Skip to content
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

Pin to glibc 2.34, and fix make deploy on MacOS #4245

Merged
merged 2 commits into from
May 23, 2022

Conversation

d6e-automaton
Copy link
Collaborator

@d6e-automaton d6e-automaton commented May 23, 2022

We'd been using frolvlad/alpine-glibc:alpine-3.15 as our base image for things, but that turns out to be a bad idea: that tag gets updated, every so often, with new versions of glibc -- and when it just got updated to glibc 2.35, that broke things for us(*). Instead, pin to alpine-3.15_glibc-2.34, which should be more stable.

And, also, ditch the trailing / in a find that was screwing up make deploy on MacOS. C'mon, MacOS – directory names do not have trailing / characters really, and you should never output them. 🙄

(*) Specifically:

"Normal" Alpine uses musl libc, but the alpine-glibc images include glibc in addition to musl: the musl libraries are still included. If you dynamically link using musl, you end up with an ELF shared object that uses /lib/ld-musl-x86_64.so.1 for the runtime link editor; if you dynamically link using glibc, the runtime link editor will be /lib/ld-linux-x86-64.so.2. If you try to use ld-musl-x86_64 for a glibc program, everything falls apart, you find unresolved symbols, and your binary won't run.

Unfortunately, alpine-3.15_glibc-2.35 symlinks ld-linux-x86-64 to ld-musl-x86_64 and bzzt, no dynamic glibc code is gonna work like that. Notably for our purposes, Envoy is a dynamically-linked glibc binary, so alpine-3.15_glibc-2.35 is out. (Yes, we could fix the symlink after installing, but... let's not.) And, even more unfortunately, when frolvlad bumped from glibc 2.34 to 2.35, they overwrote alpine-glibc:alpine-3.15 with alpine-glibc:alpine-3.15_glibc-2.35, thus breaking our new builds that referenced alpine-glibc:alpine-3.15.

So. Let's just pin the glibc version number too, going forward.

  • I don't need to update CHANGELOG.md; this isn't user-visible.
  • This is unlikely to impact how Ambassador performs at scale.
  • My change is adequately tested.
  • I didn't need to update DEVELOPING.md.
  • The changes in this PR have been reviewed for security concerns and adherence to security best practices.

Flynn added 2 commits May 23, 2022 18:12
…k on, and that's no good for Envoy.

Signed-off-by: Flynn <[email protected]>
… on MacOS. Sigh.

Thanks to @LukeShu for the help here!

Signed-off-by: Flynn <[email protected]>
@kflynn kflynn requested review from LukeShu and LanceEa May 23, 2022 22:32
@LukeShu
Copy link
Contributor

LukeShu commented May 23, 2022

Thanks to @LukeShu for the help here!

FYI, if you do Co-authored-by: Luke Shumaker <[email protected]> in the commit message, GitHub understands that when its showing authorship in the UI.

@LukeShu
Copy link
Contributor

LukeShu commented May 23, 2022

Why is this PR from d6e-automaton?

@LukeShu
Copy link
Contributor

LukeShu commented May 23, 2022

Re: The PR description: "musl" is all-lowercase all the time

@kflynn
Copy link
Member

kflynn commented May 23, 2022

Fixed the capitalization of musl, thanks. And... huh. I created this using gh pr create, so... yeah, why is it from d6e-automaton???

@kflynn kflynn merged commit a94cadb into release/v2.3 May 23, 2022
@kflynn kflynn deleted the flynn/dev/glibc-2.34 branch May 23, 2022 22:44
@LukeShu
Copy link
Contributor

LukeShu commented May 23, 2022

re: The libc breakage:

$ docker run --rm -it docker.io/frolvlad/alpine-glibc:alpine-3.15_glibc-2.35
/ # find / -name ld-*|xargs ls -l
lrwxrwxrwx    1 root     root            42 May 22 12:22 /lib/ld-linux-x86-64.so.2 -> /usr/glibc-compat/lib/ld-linux-x86-64.so.2
-rwxr-xr-x    1 root     root        604704 Sep 23  2021 /lib/ld-musl-x86_64.so.1
lrwxrwxrwx    1 root     root            26 May 22 12:22 /lib64/ld-linux-x86-64.so.2 -> /lib/libc.musl-x86_64.so.1
-rwxr-xr-x    1 root     root        227424 Mar 14 11:11 /usr/glibc-compat/lib/ld-linux-x86-64.so.2
lrwxrwxrwx    1 root     root            42 May 22 12:22 /usr/glibc-compat/lib64/ld-linux-x86-64.so.2 -> /usr/glibc-compat/lib/ld-linux-x86-64.so.2
$ docker run --rm -it docker.io/frolvlad/alpine-glibc:alpine-3.15_glibc-2.34
/ # find / -name ld-*|xargs ls -l
lrwxrwxrwx    1 root     root            42 May 22 12:07 /lib/ld-linux-x86-64.so.2 -> /usr/glibc-compat/lib/ld-linux-x86-64.so.2
-rwxr-xr-x    1 root     root        604704 Sep 23  2021 /lib/ld-musl-x86_64.so.1
lrwxrwxrwx    1 root     root            42 May 22 12:07 /lib64/ld-linux-x86-64.so.2 -> /usr/glibc-compat/lib/ld-linux-x86-64.so.2
-rwxr-xr-x    1 root     root        206776 Aug 19  2021 /usr/glibc-compat/lib/ld-linux-x86-64.so.2
lrwxrwxrwx    1 root     root            42 May 22 12:07 /usr/glibc-compat/lib64/ld-linux-x86-64.so.2 -> /usr/glibc-compat/lib/ld-linux-x86-64.so.2

Looks like a problem in frolvlad's scripts.

@kflynn
Copy link
Member

kflynn commented May 23, 2022

Updated the comment to make it more clear that I'm not trying to call this a problem with glibc, but with frolvlad's image build.

@LukeShu
Copy link
Contributor

LukeShu commented May 23, 2022

Looks like it was introduced in sgerrand/alpine-pkg-glibc#171 changing the handling of Alpine's libc6-compat.

@LukeShu
Copy link
Contributor

LukeShu commented May 24, 2022

sgerrand/alpine-pkg-glibc#179 should be the fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants