uv-managed Python binaries fail to run on NixOS (stub-ld blocks dynamically linked executables) #11

Closed
opened 2026-09-07 08:35:53 +00:00 by agent-pi · 1 comment
Collaborator

Running just fediverse-post in the cang project fails with exit status 127:

error: Querying Python at `~/.local/share/uv/python/cpython-3.14.6-linux-x86_64-gnu/bin/python3.14` failed
       with exit status 127
Could not start dynamically linked executable:
       ~/.local/share/uv/python/cpython-3.14.6-linux-x86_64-gnu/bin/python3.14
NixOS cannot run dynamically linked executables intended for generic
linux environments out of the box.

uv downloads python-build-standalone (gnu) builds, which are dynamically linked against glibc. On this box /lib64/ld-linux-x86-64.so.2 is the NixOS stub-ld placeholder, which refuses such binaries with exactly this error. Any project relying on uv-managed Pythons (or other prebuilt glibc binaries) is blocked on this station.

Running `just fediverse-post` in the cang project fails with exit status 127: ``` error: Querying Python at `~/.local/share/uv/python/cpython-3.14.6-linux-x86_64-gnu/bin/python3.14` failed with exit status 127 Could not start dynamically linked executable: ~/.local/share/uv/python/cpython-3.14.6-linux-x86_64-gnu/bin/python3.14 NixOS cannot run dynamically linked executables intended for generic linux environments out of the box. ``` uv downloads python-build-standalone (gnu) builds, which are dynamically linked against glibc. On this box `/lib64/ld-linux-x86-64.so.2` is the NixOS stub-ld placeholder, which refuses such binaries with exactly this error. Any project relying on uv-managed Pythons (or other prebuilt glibc binaries) is blocked on this station.
Author
Collaborator

Findings from diagnosis on the box:

  • /lib64/ld-linux-x86-64.so.2 exists but is a symlink to NixOS stub-ld, the placeholder that emits the reported error — programs.nix-ld is not enabled anywhere in the repo config.
  • The uv Python binary is a python-build-standalone gnu build: dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, and its NEEDED libs are all plain glibc (libc, libm, libpthread, libdl, librt, libutil).
  • Proof the loader is the only missing piece: running the same binary via the system Nix glibc loader directly (/nix/store/…-glibc-2.42…/lib/ld-linux-x86-64.so.2 <python3.14> --version) prints Python 3.14.6.

Plan of attack:

  • Enable programs.nix-ld.enable = true; in hosts/ai-coding-box/default.nix (single line; the nix-ld base provides the glibc loader + glibc libs, which is all this binary needs — no programs.nix-ld.libraries entries required).
  • After merge, rebuild the box (sudo nixos-rebuild switch --flake .#ai-coding-box) and verify uv python queries and just fediverse-post in cang succeed.
**Findings from diagnosis on the box:** - `/lib64/ld-linux-x86-64.so.2` exists but is a symlink to NixOS `stub-ld`, the placeholder that emits the reported error — `programs.nix-ld` is not enabled anywhere in the repo config. - The uv Python binary is a python-build-standalone gnu build: dynamically linked, interpreter `/lib64/ld-linux-x86-64.so.2`, and its NEEDED libs are all plain glibc (`libc`, `libm`, `libpthread`, `libdl`, `librt`, `libutil`). - Proof the loader is the only missing piece: running the same binary via the system Nix glibc loader directly (`/nix/store/…-glibc-2.42…/lib/ld-linux-x86-64.so.2 <python3.14> --version`) prints `Python 3.14.6`. **Plan of attack:** - Enable `programs.nix-ld.enable = true;` in `hosts/ai-coding-box/default.nix` (single line; the nix-ld base provides the glibc loader + glibc libs, which is all this binary needs — no `programs.nix-ld.libraries` entries required). - After merge, rebuild the box (`sudo nixos-rebuild switch --flake .#ai-coding-box`) and verify `uv python` queries and `just fediverse-post` in cang succeed.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
marvin8/ai-coding-box#11
No description provided.