-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nix-env --upgrade
upgrades 'nix-2.3.10' to 'nix-2.3.10-x86_64-unknown-linux-musl'
#118481
Comments
nix-env --upgrade upgrading packages to different packages because their name looks like a version bump is well known and not really fixable. cc NixOS/nixos-homepage#672 The fact that nix-2.3.10-x86_64-unknown-linux-musl is broken may be viewed as a separate issue deserving further investigation. |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/errors-upgrading-installing-packages-on-non-nix-os/12328/1 |
Definitely agree there is a larger issue here, but why on earth is the cross target coming after the version?! That is a big somewhere. |
The issue here is that the |
This is a workaround for the issue a lot of people have been having where nix-env -u would think that nixStatic was a newer version of nix and “upgrade” it to that package, breaking setups in the process. Reference NixOS#118481
This is fixed in #119317 Check https://status.nixos.org/ for when it will reach the nixpkgs-unstable channel! |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/errors-upgrading-installing-packages-on-non-nix-os/12328/2 |
I would like to reopen this and pin it, as it may affect a lot of people and break their install. The fix was never release to unstable because hydra is broken on unstable. And a lot of people run unstable locally on their dev env. |
I'm working on unblocking the channel. |
Done |
Are there any instructions on how to fix it on a local install? My
|
I think people had success with using |
You need to update nixpkgs, if you're using channels that's If you're using niv see https://nix.dev/tutorials/towards-reproducibility-pinning-nixpkgs.html |
Is there another solution apart from |
Assuming you're on linux you could try:
|
@domenkozar thanks, this helped |
I am still encountering this issue with cross-compiled copies of nix. This is necessary for a repeatable bootstrap process on mips64el.
and then on the target machine:
Can anybody enlighten me as to why the name of the directory in which the nix binary lives causes this error? Is there a better way to use nixpkgs to cross-compile a standalone nix binary that will work on a system that does not yet have a Also, nix expects to find certain non-executable resources (like the *.nix files in share/nix/) using a path which is hardwired at compile time. Is there a way to override that path at runtime, in order to explain to nix that it has been moved to a different location? In the past I have used the Debian compiler/assembler/libraries to compile nix from source code, then used that to bootstrap. That's how I originally got mips64el working. However that process was tricky and not very repeatable, and as part of the upstreaming process I'd really like to have a documented bootstrap process that starts by using an amd64 machine to cross-compile the nix binary that will be used for bootstrapping. I'm having quite a difficult time doing that. |
I think in your case the issue is rather that what nix assumes to be |
Unfortunately that is not the issue; I copied (git clone) /nix/nixpkgs from the machine which built nix to the machine on which I'm running it.
The path /nix/nixpkgs is getting picked up from ~/.nix-defexpr/default.nix, which I deliberately set. I tried removing that file and indicating the location of nixpkgs manually, and got the same error:
I'm quite sure something is wonky with the binary that is being built, rather than the environment in which it is running. |
I was able to work around this by simply using nix 2.4 instead, in case that helps anybody else.
|
Describe the bug
I'm running nixpkgs on Debian testing on amd64. After doing
nix-channel --update && nix-env --upgrade
it upgraded 'nix-2.3.10' to 'nix-2.3.10-x86_64-unknown-linux-musl'.After that upgrade is done,
nix-env --upgrade --show-trace
complains aboutattribute 'unsafeDiscardStringContext' missing
:To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
Notify maintainers
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result. (NOTE: this is after I didnix-env --rollback
)"x86_64-linux"
Linux 5.10.0-5-amd64, Debian GNU/Linux, noversion
no
yes
nix-env (Nix) 2.3.10
"nixpkgs-21.05pre280331.54c1e44240d"
/home/fishy/.nix-defexpr/channels/nixpkgs
Maintainer information:
The text was updated successfully, but these errors were encountered: