Repository navigation
ci: fix linux-gnu glibc regression and enforce glibc ≤ 2.28 compatibility - #6467
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Thank you for your contribution! ❤️You can try out this pull request locally by installing Rollup via npm install rollup/rollup#fix-6461-glibc-runnerNotice: Ensure you have installed the latest nightly Rust toolchain. If you haven't installed it yet, please see https://www.rust-lang.org/tools/install to learn how to download Rustup and install Rust. or load it into the REPL: |
Performance report
|
0fba799 to
0d0d4c8
Compare
6704851 to
d3a6fd8
Compare
…le builds Root cause of #6461: the linux-gnu x64 build intends to use --use-napi-cross (manylinux-derived gcc, glibc 2.17 sysroot), but the node_modules cache contained a snapshot missing the optional platform package @napi-rs/lzma-linux-x64-gnu (npm/cli#4828). When it is absent, @napi-rs/cli cannot load @napi-rs/cross-toolchain, silently skips setting CARGO_TARGET_*_LINKER / TARGET_CC / TARGET_SYSROOT, and cargo links against the ubuntu-24.04 host glibc 2.39 instead - raising the published artifact's glibc floor to 2.34. The snapshot's hidden lockfile claims the binding is installed, so npm never restores it: a plain npm install is a no-op, and even an explicit single-package install is reconciled away against the lying hidden lockfile. - Pin @napi-rs/lzma-linux-x64-gnu as an explicit optionalDependency so it is reliably installed on linux-x64-glibc hosts (it cannot be a regular dependency due to EBADPLATFORM on other platforms). - After installing node_modules, ensure the binding is present on Linux/X64 runners: if missing, repair it at tarball level by downloading the exact pinned tarball URL from package-lock.json and verifying its recorded integrity hash - bypassing npm's trust in the stale hidden lockfile. Fail loudly if the binding is still absent, so a degraded toolchain can never ship an incompatible artifact again. The repair logic was validated locally end-to-end (download, integrity verification, extraction).
d3a6fd8 to
e845c41
Compare
Rollup 4.62.3 regressed @rollup/rollup-linux-x64-gnu to require GLIBC_2.34 (breaking systems on glibc 2.28-2.31: RHEL8, Debian 11, Amazon Linux 2, AWS build environments). The regression was invisible in CI because nothing inspects the built artifacts: the build was green while the toolchain had silently degraded (missing cross-toolchain binding, see previous commit). Add a step to the build job that runs objdump on every linux-gnu artifact built via the napi cross toolchain (excluding android/ohos/musl/wasm), extracts the highest required GLIBC_x.y, and fails the build if it exceeds 2.28 - the floor of the oldest commonly deployed targets reported in #6461. The check inspects the artifact rather than the runner, so it keeps working as ubuntu-latest evolves and cannot be masked by any cache behavior. riscv64 and loongarch64 are excluded: they use classic apt cross-gcc toolchains whose glibc floor tracks the runner image (currently 2.34/2.36) rather than the napi cross toolchain; pinning them lower needs a separate toolchain change. Verified on this branch: with only this check applied, the x86_64 gnu build failed with 'requires GLIBC_2.34, exceeding the supported floor' and climbed to GLIBC 2.14 once the toolchain fix landed; locally the check passes against the 4.62.2 artifact (max GLIBC 2.14).
e845c41 to
a094a1b
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #6467 +/- ##
=======================================
Coverage 98.78% 98.78%
=======================================
Files 275 275
Lines 10822 10822
Branches 2887 2887
=======================================
Hits 10690 10690
Misses 89 89
Partials 43 43 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🟡 Not ready to approve
The new glibc compatibility check can currently succeed without checking any artifacts, which undermines the CI guarantee it is meant to provide.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.
Pull request overview
This PR hardens the Linux GNU native build pipeline to prevent publishing .node artifacts that require a newer glibc than the intended compatibility floor, addressing the regression reported in #6461.
Changes:
- Pins
@napi-rs/lzma-linux-x64-gnuas anoptionalDependencyto improve reliability of napi cross-toolchain installs. - Adds a composite-action step that verifies/repairs the cross-toolchain platform binding after restoring cached
node_modules. - Adds a CI step that inspects built
.nodeartifacts and fails the build if the highest requiredGLIBC_x.yexceeds 2.28.
File summaries
| File | Description |
|---|---|
package.json |
Adds an explicit optional dependency and documents why it’s required for glibc-safe builds. |
package-lock.json |
Locks the added optional dependency and updates lock metadata accordingly. |
.github/workflows/build-and-tests.yml |
Introduces a post-build glibc symbol/version compatibility gate for linux-gnu targets. |
.github/actions/install-and-cache-node-deps/action.yml |
Adds a cache-poisoning mitigation that ensures the napi cross-toolchain binding is actually present. |
Review details
- Files reviewed: 3/4 changed files
- Comments generated: 2
- Review effort level: Lite
We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Not ready to approve
The new glibc guard can currently mask real objdump/pipeline failures (and under-parse some GLIBC versions), reducing the reliability of the compatibility check.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.
Review details
Suppressed comments (2)
.github/workflows/build-and-tests.yml:306
- The
max_glibcextraction currently appends|| trueto the whole pipeline, which can mask real failures (e.g.objdumpmissing/errored) and let the compatibility guard pass with an empty result. Also, the regex only matchesGLIBC_x.yand would ignore patch-level versions likeGLIBC_2.2.5if they appear.
echo "Checking $file for glibc symbol versions..."
# Extract highest required GLIBC version from the binary
max_glibc=$(objdump -T "$file" | grep -oE 'GLIBC_[0-9]+\.[0-9]+' | sed 's/GLIBC_//' | sort -Vu | tail -1 || true)
.github/actions/install-and-cache-node-deps/action.yml:52
- The integrity verification error message is too generic (
integrity mismatch) and makes it hard to debug what went wrong (wrong algo vs wrong hash, truncated download, etc.). Including the computed vs expected hash (and algo) will make CI failures actionable.
const [algo, expected] = '$integrity'.split('-', 2);
const actual = crypto.createHash(algo).update(fs.readFileSync('/tmp/lzma-binding.tgz')).digest('base64');
if (actual !== expected) { console.error('integrity mismatch'); process.exit(1); }
- Files reviewed: 3/4 changed files
- Comments generated: 0 new
- Review effort level: Lite
We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.
|
This PR has been released as part of rollup@4.62.4. You can test it via |
@builder.io/qwik 1.20.1 requires rollup ^4.61.0, but the override still forced 4.59.0. Pin 4.62.5, the latest 4.62 patch, which includes the upstream glibc compatibility fix. Rollup 4.62.4+ adds an optional @napi-rs/lzma-linux-x64-gnu dependency, verified against the upstream package.json at the v4.62.4 tag (rollup/rollup#6467). Rollup is a build dependency and is not installed in the runtime image. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* chore(deps): bump Qwik to 1.20.1 Supersedes #208, which raised @builder.io/qwik-city to 1.20.1 but left the @builder.io/qwik override at 1.20.0, mismatching the two packages. Raise both dev dependencies and the override together. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(deps): raise rollup override to satisfy Qwik 1.20.1 @builder.io/qwik 1.20.1 requires rollup ^4.61.0, but the override still forced 4.59.0. Pin 4.62.5, the latest 4.62 patch, which includes the upstream glibc compatibility fix. Rollup 4.62.4+ adds an optional @napi-rs/lzma-linux-x64-gnu dependency, verified against the upstream package.json at the v4.62.4 tag (rollup/rollup#6467). Rollup is a build dependency and is not installed in the runtime image. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
`bun audit` reported 74 advisories (1 critical, 25 high). Every runtime one came through @modelcontextprotocol/sdk 1.25.1 and its express, hono, and ajv dependencies. Raising the SDK floor to ^1.32.0 and re-resolving the lockfile leaves one low, dev-only advisory: esbuild's dev server on Windows, held at 0.27 by tsup's range and never run by builds. The lockfile was regenerated with --minimum-release-age=259200, so it installs nothing published in the last three days. That held the SDK at 1.32.0 (1.32.1 is docs-only) and oxlint at 1.86.0. rollup now pulls in @napi-rs/lzma-linux-x64-gnu on Linux x64; it ships with provenance and was added deliberately in rollup/rollup#6467. Dependabot's npm_and_yarn ecosystem cannot update bun.lock, which failed the Oct 1 run; it now uses the bun ecosystem with a three-day cooldown. CI and release installs use --frozen-lockfile, so they build from the reviewed lockfile. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This PR contains:
Are tests included?
requires GLIBC_2.34, exceeding the supported floor of 2.28), and passes now that the fix landed (Highest required GLIBC: 2.14).Breaking Changes?
List any relevant issue numbers:
Description
Problem
@rollup/rollup-linux-x64-gnu@4.62.3requires GLIBC_2.34 (pthread_getattr_np@GLIBC_2.32,fstat64/stat64@GLIBC_2.33,pthread_*@GLIBC_2.34) whereas4.62.2required only GLIBC_2.14 — breaking builds on RHEL 8 / CentOS 8-based images (2.28), Debian 11 bullseye (2.31), Amazon Linux 2, and AWS build environments (#6461).Root cause (confirmed via CI logs from this branch)
The linux-gnu x64 build intends to use
napi build --use-napi-cross, which downloads a manylinux-derived gcc cross toolchain (glibc 2.17 sysroot) and drives both C compilation and linking through it:node_modulesfrom anactions/cachesnapshot. A snapshot missing the optional platform package@napi-rs/lzma-linux-x64-gnugot cached on master (npm optional-dependency bug, npm/cli#4828).require('@napi-rs/cross-toolchain')throws insidenapi build, and the CLI silently swallows it (debug-only warning "Pick cross toolchain failed") and continues withoutCARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER,TARGET_CC, orTARGET_SYSROOT.ccand links against the ubuntu-24.04 runner's glibc 2.39 — producing the GLIBC 2.34 floor.npm installis a no-op, and even an explicitnpm install <pkg>is reconciled away against the lying hidden lockfile. Verified in CI on this branch — npm printed "added 4 packages, removed 2 packages" and the binding was still absent afterwards.Changes (two commits)
1.
ci: ensure napi cross-toolchain binding is present for glibc-compatible builds@napi-rs/lzma-linux-x64-gnuas an explicitoptionalDependencyso it's reliably installed on linux-x64-glibc hosts (notdevDependencies: a regular dependency on a platform-restricted package breaks installs elsewhere withEBADPLATFORM). Mirrors the existing@emnapi/*workaround philosophy.install-and-cache-node-deps(flow otherwise unchanged), ensure the binding is present on Linux/X64 runners: if missing, repair it at tarball level by downloading the exact pinned URL frompackage-lock.jsonand verifying its recorded integrity hash — bypassing npm's trust in the stale hidden lockfile. Fail loudly if it's still absent, so a degraded toolchain can never ship an incompatible artifact again.2.
ci: add glibc symbol compatibility check for linux-gnu buildsCheck glibc symbol compatibilitystep in thebuildjob: runsobjdump -Ton every native*.nodeartifact built via the napi cross toolchain (excluding android/ohos/musl/wasm), extracts the highest requiredGLIBC_x.y, and fails the build if it exceeds 2.28 — the floor for the oldest commonly deployed targets reported in GLIBC Issue since 4.62.3 update #6461 (RHEL 8 / Amazon Linux 2 era).riscv64gcandloongarch64gnu targets are excluded with a documented note: they use classic apt cross-gcc toolchains whose glibc floor tracks the runner image (currently 2.34/2.36) rather than the napi cross toolchain; pinning them lower is a separate toolchain change.ubuntu-latestevolves and cannot be masked by cache behavior.Verification
requires GLIBC_2.34, exceeding the supported floor of 2.28.Pick cross toolchain failed … Cannot find module '@napi-rs/lzma-linux-x64-gnu'right after a node_modules cache restore.Highest required GLIBC: 2.14on the x86_64-gnu artifact.Open follow-ups (not blocking)
@napi-rs/clitreats a missing--use-napi-crosstoolchain as a debug warning instead of a hard failure; worth fixing in napi-rs. Our guard and binding pin make this non-blocking for rollup.riscv64/loongarch64gnu floors (2.34/2.36) could be brought down via a sysroot-pinned toolchain if anyone needs it, but they were unaffected by this regression.statx@2.28,getrandom@2.25,log2@2.29 from libm); 2.28 covers every distro family reported in GLIBC Issue since 4.62.3 update #6461 while accommodating those.