Open coretemp opened 6 years ago
It's arguably the correct behaviour because there's no ld.cache in NixOS at all, hence failure.
The correct behavior to me seems to be to output nothing and exit with EXIT_SUCCESS
.
-p
Print the lists of directories and candidate libraries stored in the current cache.
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.
13,033 code results
Since technically the current cache
is undefined, ldconfig -p
has 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.
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
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/nixos
@bbarker did you dig through stack
on what it uses ldconfig -p
for?
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:
We are also hitting this issue with playwright
, which uses ldconfig -p
to provide the user with an error message suggesting how to install missing dependencies: https://github.com/aslushnikov/playwright/blob/2ac93f0a8bd61bdd7920629d9560e40ff1f15506/src/server/validateDependencies.ts
Reported on playwright as well: https://github.com/microsoft/playwright/issues/5501.
I marked this as stale due to inactivity. → More info
It is also not working for python's Nuitka
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.1
Tensorflow CUDA config scripts currently use ldconfig -p
and break tensorflow-sys builds in NixOS.
Tensorflow CUDA config scripts currently use
ldconfig -p
and break tensorflow-sys builds in NixOS.
This line probably needs to be changed in NixOS, to look from a hard coded path.
This line probably needs to be changed
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.
Issue description
As root:
I expect no error message and an exit status of 0.
Technical details
"x86_64-linux"
Linux 4.13.4, NixOS, 17.09.git.39cd40f (Hummingbird)
yes
no
nix-env (Nix) 1.11.15
"nixos-17.09.2182.7f6f0c49f0"
/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs