I’m trying to run julia on NixOS, and I just came across an issue where calling Plots.mp4(anim, "foobar.mp4") errors out because the julia Plots.jl package brings in its own ffmpeg binary to ~/.julia/artifacts/7f40eeb66d90d3026ae5fb68761c263b57adb840/bin/ffmpeg and it doesn’t seem to be compatible with NixOS. Running this binary I get,
$ ./ffmpeg
bash: ./ffmpeg: No such file or directory
Ok, so what does file have to say?
$ file ffmpeg
ffmpeg: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.4.0, stripped
So as best as I can tell the issue is that /lib64/ld-linux-x86-64.so.2 doesn’t exist on NixOS systems.
What’s the recommended workaround for these scenarios? I’m open to hacky-ish ideas…
If you just depend on libc.so.6, you are already covered. When using nix-ld, you need to set the NIX_LD environment variable. This will determine which glibc library loader to load. The library loader will take care of providing the libc it was compiled together with. This because a library loader will share a lot of internal state with the libc and the two need to be compatible.