autoPatchhelfHook could not satisfy dependencies

Hi all,

I am trying to run autopatchelf on executable. It fails with the error autoPatchelfHook could not satisfy dependency libnw.so wanted by /nix/store/anjmlq8rxg0l0amnn9f4d1dr96d4bhdv-jesc-configurator-1.2.9/bin/jesc-configurator. However, within the buildInputs section I have included nwjs. Here is the default.nix file and here is the `nix-build $NIXPKGS -A jesc-configurator`` output.

I ran a nix-locate that confirms that the nwjs package includes libnw.so. If I run it with autoPatchelfIgnoreMissingDeps=true, the only library it complains about is libnw.so

Does anyone have any ideas on how to get autoPatchelf to find the library?

The original problem I am trying to solve is to get the dynamically linked executable to run, and it seems that autoPatchelfHook is the best way (aside from it not working lol). I did condenser trying to build it from source but couldn’t get node dependencies to play nice.

Any help would be greatly appreciated!

2 Likes

Did you try to move (or add) nwjs into nativeBuildInputs? I got similar issue and my problem was absent library at compile time phase.

Appreciate the suggestion but I did try that already. Had it in both nativeBuildInputs and in buildInputs.

congrats, you found a bug in auto-patchelf.sh ; )

i debugged this by redefining findDependency() in the installPhase,
see my patched default.nix

building this will produce

...
debug findDependency: cache: add lib = /nix/store/fq45lf16xsdcz7ha7wr4wmwbwkb0imgr-nwjs-0.33.4/lib
debug findDependency: cache: add lib = /nix/store/43nphj0pvw1zyda5f3zxqlrbjnxs6zqr-gsettings-desktop-schemas-41.0/lib
debug findDependency: cache: add lib = /nix/store/9xii3hdg3jgb8856k7rh9d3hx8bvdyz1-gtk+3-3.24.30-dev/lib
debug findDependency: cache: add lib = /nix/store/jcwwrd2b1i2mpg2zca6qchdb55vxx6yi-at-spi2-atk-2.38.0/lib
debug findDependency: cache:   add libatk-bridge-2.0.so = /nix/store/jcwwrd2b1i2mpg2zca6qchdb55vxx6yi-at-spi2-atk-2.38.0/lib/libatk-bridge-2.0.so
debug findDependency: cache:   add libatk-bridge-2.0.so.0 = /nix/store/jcwwrd2b1i2mpg2zca6qchdb55vxx6yi-at-spi2-atk-2.38.0/lib/libatk-bridge-2.0.so.0
debug findDependency: cache:   add libatk-bridge-2.0.so.0.0.0 = /nix/store/jcwwrd2b1i2mpg2zca6qchdb55vxx6yi-at-spi2-atk-2.38.0/lib/libatk-bridge-2.0.so.0.0.0
debug findDependency: cache: add lib = /nix/store/kz2m4j0xy2gj20s334dv7ibi7lpkgvbf-atk-2.36.0-dev/lib
...

for nwjs, no *.so files are added, cos

ls /nix/store/fq45lf16xsdcz7ha7wr4wmwbwkb0imgr-nwjs-0.33.4/lib
ls: cannot access ...: No such file or directory

… but …

find /nix/store/fq45lf16xsdcz7ha7wr4wmwbwkb0imgr-nwjs-0.33.4/ -name '*.so*' | cut -d/ -f5-
share/nwjs/libudev.so.0
share/nwjs/lib/libnw.so
share/nwjs/lib/libnode.so
share/nwjs/lib/libffmpeg.so
share/nwjs/swiftshader/libEGL.so
share/nwjs/swiftshader/libGLESv2.so

so the bug is here

… and autoPatchelfLibs is also wrong,
assuming we want to use *.so files not only from the $out/lib folder,
but also from the $out/share folder in this case

if we want *.so files only from the $out/lib folder,
then its also a bug in the nwjs package

PR in autoPatchhelfHook: call addToDepCache recursive by milahu · Pull Request #144270 · NixOS/nixpkgs · GitHub

1 Like