python3Packages.llama-cpp-python: disable removeStubsFromRunpathHook to fix import when cudaSupport is enabled#468659
python3Packages.llama-cpp-python: disable removeStubsFromRunpathHook to fix import when cudaSupport is enabled#468659GaetanLepage wants to merge 1 commit intoNixOS:masterfrom
Conversation
13907c4 to
f91b412
Compare
f91b412 to
892b6f6
Compare
…to fix import when cudaSupport is enabled
892b6f6 to
c8cb3ca
Compare
|
|
IMHO this is the wrong approach. References to stubs should never be present in runtime binaries because they cannot and will not work. At best other runpath entries supply the full library before the stub is tried. At worst (think non-NixOS, libraries which don’t link against the driver but need the driver, or when we need to use cuda_compat) the stub file is loaded and tracking down the runtime failure becomes much more difficult. The root of the problem is that importing the module immediately tries to dlopen a library — that should be lazy. By disabling the hook, all that happens is that the module succeeds in immediately dlopening a library (which it shouldn’t do) corresponding to a stub library (which will never work and shouldn’t be in the closure). |
Things done
Better alternative to #465751.
This fixes all reverse dependencies.
Ideally, we would need a cleaner toggle to disable removeStubsFromRunpathHook.
cc @ConnorBaker @SomeoneSerge
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.Add a 👍 reaction to pull requests you find important.