I’m currently experiencing an issue with Nix when installing packages using
$ nix-shell -p and I hope someone can help me with this problem.
I expect the packages to be installed without running the test code during the installation process.
When using the same package on two different Mac computers, one of them runs the test code while the other does not. This issue causes a significant delay in the time it takes to make the package available for use.
For example, when I run
$ nix-shell -p rename , I get a long output of checking logs like the following:
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether make supports nested variables... yes
checking whether to enable debug build options... no
checking whether to enable compiler optimizer... not specified (assuming yes)
checking whether to enable strict compiler warnings... no
checking whether to enable compiler warnings as errors... no
checking whether to enable hiding of library internal symbols... yes
checking whether to expose internal static functions for testing... no
This also happens with other packages (e.g., cargo, julia-bin). I don’t recall seeing this output before, but it has started happening recently.
System and Nix versions:
Please provide guidance on how to retrieve this information if necessary.
I would appreciate any assistance in preventing this test code execution during the package installation process. Additionally, if there are other sources where I can get help regarding this issue, please let me know.
Thank you in advance for your help!
Sounds like the output of a configure script in preparation to compile. So the real issue is that these packages are being compiled locally rather than downloading precompiled binaries.
This could be because your substituter settings are misconfigured, or because you’ve modified the packages with an overlay somehow, so the requested packages are not in the cache. It could also be that you’re following the wrong branch of nixpkgs, and thus are using nix expressions that haven’t actually finished building yet on hydra.
Thank you for your response. I’m not sure where the issue originates, so I’ve tried to investigate a few things based on your advice.
1 Regarding the substituters check I’m not sure how to specify substituters, but I tried adding the following to my
~/.config/nix/nix.conf , although it didn’t seem to change the behavior:
substituters = https://cache.nixos.org/
2 About overlays I don’t think I’ve touched any overlay settings. The
~/.config/nixpkgs/overlays directory does not exist.
3 Concerning the nixpkgs branch I’m not sure how to specify the nixpkgs branch. The result of running
$ nix-channel --list is as follows:
Does this channel even exist? When I visit https://channels.nixos.org, I can find
nixpkgs-22.11-darwin, but not
nixpkgs-22.11, and on trying to visit the channel URL directly I get a 404.
You might also want to check roots channels.
Also you shouldn’t use a stable nixpkgs with unstable HM.
This does not mean that there are no overlays at all. There are also nix path entries that affect overlays.
Just adding the substituter won’t change anything, you also need to trust it by adding its public keys to
Usually in a multi-user install (which is the default on darwin) substituters are usually even ignored, unless a user is also a
trusted-users (nix setting!).
So the relevant settings are usually done via
I apologize for the confusion earlier. When I first asked my question, I was using the unstable version of nixpkgs-22.11, but I thought it might be problematic, so I quickly switched to specifying nixpkgs-22.11. As you mentioned, niixpkgs-22.11 didn’t exist, so I went back to the unstable version:
I’m still not quite sure about the cause and solution, so it might be faster to reinstall Nix.
The essential cause is unknown, but I fixed the problem by fixing the permission denied that kept coming up.