Commit 0f5b6c5
committed
M9.R.37.4+5: link nix-glibc ld.so.cache to /etc + narrow LD_LIBRARY_PATH
M9.R.37.4 — symlink nix-store glibc's etc/ld.so.cache to /etc/ld.so.cache
The from-source binaries on the live ISO carry PT_INTERPs like
/nix/store/xx7cm72...-glibc-2.40-66/lib/ld-linux-x86-64.so.2. That
ld-linux is COMPILED with its ld.so.cache path baked in as
/nix/store/xx7cm72...-glibc-2.40-66/etc/ld.so.cache (`strings` it to
confirm). Our M9.R.37.3 ldconfig populates the Debian system cache at
/etc/ld.so.cache, but the nix-store loader never looks there — it
opens the cache at its own compiled-in path, gets ENOENT, and skips
ld.so.cache entirely during dlopen fall-through.
Concretely: mkfs.ext4's loader walked LD_LIBRARY_PATH (no
libext2fs.so.2), DT_RUNPATH (no libext2fs.so.2 either — the recipe's
RPATH-patcher missed its own sister-lib dir), then tried to open
ld.so.cache at the nix-store glibc path, got ENOENT, gave up, and
exited 127 with "libext2fs.so.2: cannot open shared object file".
Fix: for each nix-store glibc dir on the stage, chmod u+w its etc/
subdir then drop a symlink at etc/ld.so.cache -> /etc/ld.so.cache.
Every loader — Debian or nix — now consults the same cache the
system ldconfig wrote, and libext2fs.so.2 (cached at the absolute
e2fsprogs install-mirror path) resolves cleanly.
M9.R.37.5 — narrow LD_LIBRARY_PATH from ~600 to ~5 entries
The launcher's wholesale /nix/store/*/lib walk put ~600 directories
on LD_LIBRARY_PATH. Every dlopen() inside the installer's QProcess
children iterated all 600 before falling through to RPATH /
ld.so.cache — a measured cost of ~600ms per shared-lib lookup.
Multiplied across the dozens of fontconfig + Qt plugin + nim-runtime
+ subprocess startup lookups, this added 30-60s of pure ld.so churn
to every install attempt and contributed to the M9.R.36 "silent wedge"
symptom (the installer wasn't deadlocked — just heavily I/O-bound on
ld.so probes).
The only libraries the launcher actually needs to surface via
LD_LIBRARY_PATH are the ones the repro binary dlopens by bare leaf
name through Nim's {.dynlib: "libname".} pragma:
* libclingo.so (libs/repro_solver/clingo_bindings.nim)
* libsqlite3.so(.0) (libs/repro_local_store/sqlite3_binding.nim)
Every other library is reachable via either embedded RPATH (the
M9.R.14f recipe-side RPATH-patcher bakes the closure into every ELF)
or ld.so.cache (M9.R.37.3 + M9.R.37.4 made the cache reachable from
every PT_INTERP). Filter the LD_LIBRARY_PATH walk to include ONLY
dirs that ship libclingo.so or libsqlite3.so.1 parent eb71b71 commit 0f5b6c5
1 file changed
Lines changed: 54 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
622 | 622 | | |
623 | 623 | | |
624 | 624 | | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
625 | 640 | | |
626 | 641 | | |
627 | 642 | | |
628 | 643 | | |
629 | 644 | | |
630 | 645 | | |
631 | 646 | | |
632 | | - | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
633 | 655 | | |
634 | 656 | | |
635 | 657 | | |
| |||
922 | 944 | | |
923 | 945 | | |
924 | 946 | | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
925 | 978 | | |
926 | 979 | | |
927 | 980 | | |
| |||
0 commit comments