Nixpkgs: Can't upgrade from 17.03

Created on 27 Aug 2018  Â·  4Comments  Â·  Source: NixOS/nixpkgs

Issue description

Trying to upgrade from 17.03 results in a syntax error. Tried channel for 18.03 and 18.09pre.

Steps to reproduce

# nix-channel --list
warning: unknown setting 'signed-binary-caches'
nixos https://nixos.org/channels/nixos-unstable
# nixos-rebuild switch
error: syntax error, unexpected $undefined, expecting IND_STR or DOLLAR_CURLY or IND_STRING_CLOSE, at /nix/store/sn2zf3alwfs7v0pks1plz0wv5h9xmr3j-nixos-18.09pre149415.8395f9aa85e/nixos/pkgs/build-support/fetchpatch/default.nix:42:40
(use ‘--show-trace’ to show detailed location information)
building Nix...
error: syntax error, unexpected $undefined, expecting IND_STR or DOLLAR_CURLY or IND_STRING_CLOSE, at /nix/store/sn2zf3alwfs7v0pks1plz0wv5h9xmr3j-nixos-18.09pre149415.8395f9aa85e/nixos/pkgs/build-support/fetchpatch/default.nix:42:40
(use ‘--show-trace’ to show detailed location information)
error: syntax error, unexpected $undefined, expecting IND_STR or DOLLAR_CURLY or IND_STRING_CLOSE, at /nix/store/sn2zf3alwfs7v0pks1plz0wv5h9xmr3j-nixos-18.09pre149415.8395f9aa85e/nixos/pkgs/build-support/fetchpatch/default.nix:42:40
(use ‘--show-trace’ to show detailed location information)
/tmp/nixos-rebuild.vQtPP6/nix
building the system configuration...
error: syntax error, unexpected $undefined, expecting IND_STR or DOLLAR_CURLY or IND_STRING_CLOSE, at /nix/store/sn2zf3alwfs7v0pks1plz0wv5h9xmr3j-nixos-18.09pre149415.8395f9aa85e/nixos/pkgs/build-support/fetchpatch/default.nix:42:40
(use ‘--show-trace’ to show detailed location information)

Technical details

# nix-shell -p nix-info --run "nix-info -m"
warning: unknown setting 'signed-binary-caches'
warning: unknown setting 'signed-binary-caches'
 - system: `"x86_64-linux"`
 - host os: `Linux 4.9.30, NixOS, 17.03.1264.9ed5dbafe3 (Gorilla)`
 - multi-user?: `yes`
 - sandbox: `no`
warning: unknown setting 'signed-binary-caches'
 - version: `nix-env (Nix) 2.0.4`
warning: unknown setting 'signed-binary-caches'
 - channels(root): `"nixos-18.09pre149415.8395f9aa85e"`
warning: unknown setting 'signed-binary-caches'
 - channels(fred): `"mypkgs-18.09pre150352.7c826371c49"`
warning: unknown setting 'signed-binary-caches'
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs`

Most helpful comment

For people of the future: The problem is that the version of nix in 17.03 (1.11.14) is unable to parse the nixpkgs of 18.03 due to subtle changes to the language.

1.11.14 can however parse the nixpkgs of 17.09 which has nix 1.11.16, which in turn is also able to parse nixpkgs in 18.03

All 4 comments

You will need to upgrade to a newer version of nix in order for it to succesfully parse nixpkgs. There's different ways to go about this, but one simple way is to upgrade to 17.09 before upgrading to 18.03.

Another alternative is to directly realize (nix-store --realize) a newer (2.x) nix with which to build nixos-install and finally upgrade your system.

Ok, not sure why that worked but it did. Before and after the upgrade Nix's version remained at 2.0.4 so nothing seems to have changed in that respect.

For people of the future: The problem is that the version of nix in 17.03 (1.11.14) is unable to parse the nixpkgs of 18.03 due to subtle changes to the language.

1.11.14 can however parse the nixpkgs of 17.09 which has nix 1.11.16, which in turn is also able to parse nixpkgs in 18.03

For people of the future:

From a person of the then-future: Thank you!

Was this page helpful?
0 / 5 - 0 ratings