Skip to content

allow additional search paths#25

Merged
vtjnash merged 1 commit intovtjnash:masterfrom
haampie:hs/fix/libwhich-extra-paths
Feb 13, 2026
Merged

allow additional search paths#25
vtjnash merged 1 commit intovtjnash:masterfrom
haampie:hs/fix/libwhich-extra-paths

Conversation

@haampie
Copy link
Copy Markdown
Contributor

@haampie haampie commented Feb 13, 2026

For certain build systems (e.g. nix, guix, spack) we need to tell
libwhich about non-standard search paths. Currently the only way of
doing so is by setting LD_LIBRARY_PATH, which is difficult to scope just
to libwhich execution, and as a result can influence the runtime
behavior of other executables.

This patch allows you to set LIBWHICH_LIBRARY_PATH=x:y:z, which
libwhich uses to init LD_LIBRARY_PATH before it reruns itself, so
dlopen(...) can locate libraries in these search paths.

(Specifically a user reported a build issue of julia with a readelf
executable that has debuginfod support (don't ask), which pulls
in libcurl.so. Because we set LD_LIBRARY_PATH=/path/to/other/curl/lib
his readelf executable started picking up another libcurl.so,
which ultimately used an incompatible libcrypto.so library used by
libdebuginfo.so, preventing readelf from running 🙃)

For certain build systems (e.g. nix, guix, spack) we need to tell
libwhich about non-standard search paths. Currently the only way of
doing so is by setting `LD_LIBRARY_PATH`, which difficult to scope just
to libwhich execution, and as a result can influence the runtime
behavior of other executables.

This patch allows you to set `LIBWHICH_LIBRARY_PATH=x:y:z`, which
libwhich uses to set `LD_LIBRARY_PATH` before it reruns itself, so
`dlopen(...)` can locate libraries in these search paths.

Signed-off-by: Harmen Stoppels <me@harmenstoppels.nl>
@vtjnash vtjnash merged commit 03afffa into vtjnash:master Feb 13, 2026
4 checks passed
@haampie haampie deleted the hs/fix/libwhich-extra-paths branch February 13, 2026 23:34
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.

2 participants