Skip to content

[validation only] fix(nix): pin ncurses old glibc symver for cfgetospeed - #2336

Closed
brainrake wants to merge 3 commits into
auto-update-flake-lockfrom
fix/ncurses-old-cfgetospeed-symver
Closed

[validation only] fix(nix): pin ncurses old glibc symver for cfgetospeed#2336
brainrake wants to merge 3 commits into
auto-update-flake-lockfrom
fix/ncurses-old-cfgetospeed-symver

Conversation

@brainrake

Copy link
Copy Markdown
Collaborator

Temporary validation PR targeting #2328's branch to confirm this actually fixes `GLIBC_2.42' not found` (from libncursesw.so.6) with real bumped-nixpkgs artifacts on the existing ubuntu-24.04/ubuntu-latest runners (no runner bump needed — the whole point is the bundle now stays compatible with Ubuntu 24.04, matching what the README claims). Will be closed in favor of a develop-based PR once confirmed green.

nixpkgs' bumped glibc (2.42) re-versions cfgetospeed, so a freshly built
ncurses binds to the new GLIBC_2.42 symbol by default even though nothing
about ncurses' own code changed. That breaks the portable CLI bundle on
hosts with older glibc (e.g. Ubuntu 24.04's 2.39), since the bundle
deliberately excludes glibc itself and relies on the host's.

glibc still exports the old (functionally identical) GLIBC_2.17 version
of cfgetospeed alongside the new one, so a .symver directive forces
ncurses to bind to that instead - verified the patched build against the
new glibc drops the GLIBC_2.42 requirement entirely (max symbol version
falls back to GLIBC_2.38, matching every other bundled library).
The unconditional .symver directive broke the build on older glibc
(e.g. 2.40, currently on develop): older glibc only exports one
(unversioned-from-this-perspective) definition of cfgetospeed, so
requesting the GLIBC_2.17 version explicitly fails to link
("no symbol version section for versioned symbol"). Only glibc >= 2.42
actually carries both the old and new versioned symbols, so the override
must only apply then.
…compat

The .symver approach broke the final link (ncurses' own
-Wl,--version-script conflicts with a link-time versioned external
symbol reference), and separately, the naive dlvsym-with-fallback first
attempt still linked a bare reference to cfgetospeed for its fallback
path, which just re-added the GLIBC_2.42 requirement it was meant to
avoid.

Resolving both dlvsym and its dlsym fallback dynamically (never
referencing the bare cfgetospeed identifier in compiled code) sidesteps
the linker entirely and degrades gracefully on any glibc, verified by
building the patched ncurses against the bumped glibc: no cfgetospeed
reference of any kind remains in the dynamic symbol table, and the max
GLIBC symbol requirement drops back to 2.38, matching every other
library in the bundle.
@blacksmith-sh

blacksmith-sh Bot commented Jul 31, 2026

Copy link
Copy Markdown

Blacksmith runners detected OOM events on the following jobs:

Job Details
nix-eval / eval View Job

@brainrake

Copy link
Copy Markdown
Collaborator Author

Validation result: the `dlvsym`-based ncurses fix works. `ncurses` built successfully against the bumped glibc (2.42) with no `cfgetospeed`/`GLIBC_2.42`/linker errors - confirms the fix resolves the original `GLIBC_2.42' not found` failure at the ncurses level.

Overall CI on this PR still fails, but for an unrelated, already-diagnosed reason: this branch is ncurses-only (based on `develop`, no cgal fix), so it still hits the separate pre-existing `boost`/`sfcgal`/postgis cascade that #2332 fixes independently. That's expected here, not a problem with this fix.

Closing as validation-only; the real fix will land as its own PR against `develop`.

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.

1 participant