You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
NixOS system misconfiguration: ldconfig -p has exit status 1 #35387
# ldconfig -p
ldconfig: Can't open cache file /nix/store/xzx1bv1d7z4mgg6sg6ly0jx609qvka4x-glibc-2.25-49/etc/ld.so.cache
: No such file or directory
# echo $?
1
I expect no error message and an exit status of 0.
Technical details
system: "x86_64-linux"
host os: Linux 4.13.4, NixOS, 17.09.git.39cd40f (Hummingbird)
Reacted by Dietrich Daroch, Athir Nuaimi, Chadwick Dahlquist, dzmitry-lahoda, Martin Elvar, Carlo Nucera, Suraj, fillon, Artem Popov, Yang, Bo and 1 more
There is a difference between "empty cache" and "no cache" though and we have the second case -- I don't think changing behaviour of ldconfig is a good idea. We could add an empty cache but is there any merit to it?
I am also not sure what's best. I do know that if NixOS would be the only operating system in the world, that we would just delete the -p flag from ldconfig.
Back in the real world lots of scripts seem to use the -p flag, although generally these scripts will only work on a single operating system anyway.
Result from searching for "ldconfig -p" on GitHub.
What is this call usually used for? To enumerate library directories? If so we could emulate it in our stdenv just for builds (though I'm not sure we want this instead of patching packages and telling upstream to fix their stuff).
I'm also having the issue on one of my systems. Oddly it occurs when running stack --nix build, which i've certainly run on other NixOS systems (albeit maybe slightly different versions).
[nix-shell:/opt/purescript-dynlangs]$ ldconfig -p │·······························································
ldconfig: Can't open cache file /nix/store/7gx4kiv5m0i7d7qkixq2cwzbr10lvxwc-glibc-2.27/etc/ld.so.cache │·······························································
: No such file or directory │······························································· │·······························································
[nix-shell:/opt/purescript-dynlangs]$ stack --nix build │·······························································
/nix/store/8bh94qdmga1zkb85li56380i44ay82cs-glibc-2.27-bin/bin/ldconfig: Can't open cache file /nix/store/7gx4kiv5m0i7d7qkixq2cwzbr10lvxwc-glibc-2.27/etc/ld.so.cache │·······························································
: No such file or directory │·······························································I don't know how to install GHC on your system configuration, please install manually
Thank you for your contributions.
This has been automatically marked as stale because it has had no activity for 180 days.
If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.
Here are suggestions that might help resolve this more quickly:
Search for maintainers and people that previously touched the
related code and @ mention them in a comment.
I mean, yes, maybe? The way I read this particular script is that it will work fine in NixOS just as long as the call to ldconfig -p doesn't return an error. I suspect it's the same for all the other external projects mentioned in this issue.
FWIW, I think that @abbradar had the right idea. An empty ld.so.cache should do the trick. I also think it's arguable the semantically correct thing to do. In the context of NixOS, all cache queries should be misses.
Activity
abbradar commentedon Feb 23, 2018
It's arguably the correct behaviour because there's no ld.cache in NixOS at all, hence failure.
coretemp commentedon Feb 23, 2018
The correct behavior to me seems to be to output nothing and exit with
EXIT_SUCCESS.abbradar commentedon Feb 23, 2018
There is a difference between "empty cache" and "no cache" though and we have the second case -- I don't think changing behaviour of
ldconfigis a good idea. We could add an empty cache but is there any merit to it?coretemp commentedon Feb 23, 2018
I am also not sure what's best. I do know that if NixOS would be the only operating system in the world, that we would just delete the
-pflag from ldconfig.Back in the real world lots of scripts seem to use the
-pflag, although generally these scripts will only work on a single operating system anyway.Result from searching for
"ldconfig -p"on GitHub.Since technically
the current cacheis undefined,ldconfig -phas https://en.wikipedia.org/wiki/Undefined_behavior and its current behavior (exiting with exitstatus 1) is valid too.It would be nicer to have an empty cache, because then the program has no source of undefined behavior anymore.
abbradar commentedon Feb 23, 2018
What is this call usually used for? To enumerate library directories? If so we could emulate it in our
stdenvjust for builds (though I'm not sure we want this instead of patching packages and telling upstream to fix their stuff).bbarker commentedon Oct 12, 2019
I'm also having the issue on one of my systems. Oddly it occurs when running
stack --nix build, which i've certainly run on other NixOS systems (albeit maybe slightly different versions).My system info:
"x86_64-linux"│·······························································Linux 4.14.109, NixOS, 18.09.2456.43ba99fa035 (Jellyfish)│·······························································yes│·······························································yes│·······························································nix-env (Nix) 2.1.3│·······························································""│·······························································"nixos-18.09.2456.43ba99fa035"│·······························································/nix/var/nix/profiles/per-user/root/channels/nixosflokli commentedon Oct 14, 2019
@bbarker did you dig through
stackon what it usesldconfig -pfor?stale commentedon Jun 1, 2020
Thank you for your contributions.
This has been automatically marked as stale because it has had no activity for 180 days.
If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.
Here are suggestions that might help resolve this more quickly:
related code and @ mention them in a comment.
irc.freenode.net.
uri-canva commentedon Feb 22, 2021
We are also hitting this issue with
playwright, which usesldconfig -pto provide the user with an error message suggesting how to install missing dependencies: https://github.com/aslushnikov/playwright/blob/2ac93f0a8bd61bdd7920629d9560e40ff1f15506/src/server/validateDependencies.tsReported on playwright as well: microsoft/playwright#5501.
stale commentedon Aug 22, 2021
I marked this as stale due to inactivity. → More info
thinkrapido commentedon Apr 8, 2022
It is also not working for python's Nuitka
Nuitka/Nuitka#1520
danielmain commentedon Jul 2, 2022
Same here 😞
➜ ~ lutris /run/current-system/sw/bin/ldconfig: Can't open cache file /nix/store/d2bpliayddadf6lx6l1i04w265gqw8n6-glibc-2.34-210/etc/ld.so.cache : No such file or directory 2022-07-02 08:02:19,615: ['/run/current-system/sw/bin/ldconfig', '-p'] command failed: Command '['/run/current-system/sw/bin/ldconfig', '-p']' returned non-zero exit status 1. 2022-07-02 08:02:19,839: Starting Lutris 0.5.10.1bugeats commentedon Aug 25, 2022
Tensorflow CUDA config scripts currently use
ldconfig -pand break tensorflow-sys builds in NixOS.flokli commentedon Aug 26, 2022
This line probably needs to be changed in NixOS, to look from a hard coded path.
https://github.com/tensorflow/tensorflow/blob/f4dac8ea5e9262912ac809f719ef58b5e312b98f/third_party/gpus/find_cuda_config.py#L166
bugeats commentedon Aug 26, 2022
I mean, yes, maybe? The way I read this particular script is that it will work fine in NixOS just as long as the call to
ldconfig -pdoesn't return an error. I suspect it's the same for all the other external projects mentioned in this issue.FWIW, I think that @abbradar had the right idea. An empty
ld.so.cacheshould do the trick. I also think it's arguable the semantically correct thing to do. In the context of NixOS, all cache queries should be misses.