Howdy,
Derivation code here: https://github.com/mtetreault/nixpkgs/commit/18c031b0cbcf01612f13b3d5ee87b97fa96ff2c5
I am working on one of my first nixos package/derivation. It is based on a deb package as the source.
The testing of my derivation is done through a nix-shell, I have no idea if that can cause any issues.
I got to the point that I have everything patched and I am able to launch the binary executable.
My issue is here. While I am able to launch the binary, at run-time I got an error about a library that it is unable to find.
I used strace
to see what up, and I figured that it’s unable to open the library libjlinkarm.so
. This library is provided by the jlink derivation see here:
Now, I added jlink
derivation to the runtime dependencies but doesn’t help.
Looking more attentively to strace
I noticed that we only look for the library within sane-config
, systemd
and glibc
. (see log below)
openat(AT_FDCWD, "/nix/store/4mlbx4ivg3xlpxk24q5wi9826ldzblnn-sane-config/lib/sane/libjlinkarm.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/nix/store/1vpi7g3c984dbffrx1nl46zxw7k02va2-systemd-246.6/lib/libjlinkarm.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/nix/store/0c7c96gikmzv87i7lv3vq5s1cmfjd6zf-glibc-2.31-74/lib/libjlinkarm.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
write(2, "ERROR: JLinkARM DLL load failed."..., 71ERROR: JLinkARM DLL load failed. Try again. If it keeps failing, please) = 71
I am confused because I though that adding the jlink derivation to the runtimeDependencies would add it to the LD_LIBRARY_PATH
or equivalent of nixos.
Could it be that the library is not in the right folders of the package? What I mean is, it seems that the jlink
derivation doesn’t store the library in $out/lib
Cheers,