Skip to content

Build linux binaries against old glibc (ubuntu:20.04 container) - #5

Merged
alexeagle merged 3 commits into
masterfrom
figma-release-glibc-portability
Jun 23, 2026
Merged

Build linux binaries against old glibc (ubuntu:20.04 container)#5
alexeagle merged 3 commits into
masterfrom
figma-release-glibc-portability

Conversation

@alexeagle

Copy link
Copy Markdown

Follow-up to #4. The published linux binaries don't run on older CI:

/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found
...GLIBC_2.33/2.32 not found...
/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found

Cause

We built on ubuntu-22.04 (glibc 2.35 / newer libstdc++), baking in symbols too new for CI (the fingerprint = Ubuntu 20.04 / glibc 2.31).

Why not "just use an older runner"

GitHub's oldest hosted Ubuntu is now ubuntu-22.04 — 20.04 was retired (runner-images: only 22.04 / 24.04 / 26.04-preview remain). So a hosted runner can't give us old glibc.

Fix

Build the linux legs inside an ubuntu:20.04 container (glibc 2.31) via docker run, keeping the binary runnable on Ubuntu 20.04+ / RHEL8+. ubuntu2004 is a Bazel-supported build platform, so the toolchain is known-good. All GitHub JS actions (checkout, upload-artifact) stay on the host, so the old container never needs a node24-compatible userspace — only build-essential.

Considered but rejected the "harder answer" (custom cc toolchain / sysroot targeting an old ABI) — more complex and fragile for the same result.

Structure

  • Split the single matrix build job → build-linux (containerized; x86_64 + arm64) and build-darwin (native; macOS has no glibc).
  • Force --linkopt=-fuse-ld=bfd in the container: avoids the aarch64 gold erratum-843419 crash and needs no extra package (replaces the prior lld install).

Notes

  • Next run still auto-increments to 8.6.0-figma2.
  • This PR's head SHA is 1ddaab25f9 — please confirm the PR shows it before merging.

🤖 Generated with Claude Code

The linux binaries were built on ubuntu-22.04 (glibc 2.35), so they
failed to run on older CI machines:

  /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found
  ... GLIBCXX_3.4.29 not found ...

GitHub's oldest hosted Ubuntu is now 22.04 (20.04 was retired), so a
hosted runner can't give us an old glibc. Instead, build the linux legs
inside an `ubuntu:20.04` container (glibc 2.31) via `docker run`, which
keeps the binary runnable on Ubuntu 20.04+/RHEL8+. All GitHub JS actions
(checkout, upload-artifact) stay on the host, so the container only needs
a C/C++ toolchain — not a node24-compatible userspace.

Split the former single matrix `build` job into `build-linux`
(containerized, x86_64 + arm64) and `build-darwin` (native; macOS has no
glibc). Force the bfd linker in the container, which both avoids the
aarch64 gold erratum-843419 crash and needs no extra package (replacing
the previous lld workaround).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
alexeagle and others added 2 commits June 23, 2026 14:46
Older release scripts always installed a JDK to build Bazel. Modern Bazel
uses a downloaded remote JDK plus the embedded JRE, but add default-jdk to
the bare ubuntu:20.04 build container so a missing system JDK can't fail
the build.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The default workspace status (no --workspace_status_command) never shells
out to git, so --stamp embeds --embed_label without git; and Bazel 8 pulls
deps from registry archives, not git_repository. So the container needs
neither git nor the safe.directory config. Modern Bazel also builds with a
downloaded remote JDK + embedded JRE, so drop default-jdk too. Erring on
simplicity; re-add only if a run actually fails.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@alexeagle
alexeagle merged commit 3318268 into master Jun 23, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant