Skip to content

closure-info broken on nixos-rebuild #36268

Closed

Description

@NeQuissimus

TL; DR

.attrs.sh: No such file or directory during nixos-rebuild -> for now see workaround below: #36268 (comment)

Issue description

Cannot sudo nixos-rebuild boot --upgrade -I nixpkgs=/home/nequi/dev/upstream_nix with latest master (b84fd70).

The build logs ends in this:

building path(s) ‘/nix/store/7cnyjhx9vs7sr5x1fa5kbwmpvszcjw60-unit-disable-kernel-module-loading.service’
building path(s) ‘/nix/store/3za4jnyxp1z1vkaq8bdrdqn1x1b9ljpj-unit-display-manager.service’
building path(s) ‘/nix/store/7y2c37lli1r9mlzjgkvl7sbh1kmdg42g-unit-dnscrypt-proxy.service’
building path(s) ‘/nix/store/6papssyd63aihaxzm8i8a14ad9xd3jks-unit-dnsmasq.service’
building path(s) ‘/nix/store/6z1kg4w6smsza15p1m8ssd73agbfqfwn-unit-docker.service’
building path(s) ‘/nix/store/3pg0sh93cdsgkdq9lqsclg34vplbsn8v-unit-firewall.service’
building path(s) ‘/nix/store/chdqahlwa6sqd2skfwdl75wjfw8shha8-unit-getty-.service’
building path(s) ‘/nix/store/xacv6qcq7qhhg0b4zp9n1rh6havkjs0w-unit-mdadm-grow-continue-.service’
building path(s) ‘/nix/store/qky8yvibqmlmvwcwik5m496asrvgws37-closure-info’
/nix/store/aj9rz4k3xvg8q9fzqfnb0q123707zp0n-builder: line 1: .attrs.sh: No such file or directory
building path(s) ‘/nix/store/1aq46pxrg2vdqmid95vnivnsnv326vk5-emacs-all-the-icons-3.2.0’
builder for ‘/nix/store/7ycz6hmaa7rjrssq8pglbd62nqf0b1g3-closure-info.drv’ failed with exit code 1
building path(s) ‘/nix/store/sd8h3r7xp6cnrwvrw9ni4fm4j7p56av6-emacs-auto-complete-20170124.1845’
building path(s) ‘/nix/store/7w7y967gy3r3yz0w1n3lkqw1ziw5ncsa-emacs-flycheck-31’
building path(s) ‘/nix/store/j7a8lhjsn7s4gjbd8sbm6zdky2q9ns3f-emacs-projectile-20180128.655’
cannot build derivation ‘/nix/store/611p5z4v1p905mkhy52ympinz1cdmrcq-initrd.drv’: 1 dependencies couldn't be built
building path(s) ‘/nix/store/qpz6mx62s58n1fmpzrv8dsrzlrq7jyld-nixos-version’
building path(s) ‘/nix/store/83nrcqkbilc0l4qgbxq6nvk57bw9qxvg-unit-mdadm-shutdown.service’
building path(s) ‘/nix/store/2kv367hvdw4b0kyv4aspa37r7s6ml82x-unit-mdmon-.service’
building path(s) ‘/nix/store/m3jsvbx8x9b8z1rswnxmw29gdjfcqbcf-unit-network-local-commands.service’
building path(s) ‘/nix/store/d82pf5pzcwl5i24jp96wp67siv108r9y-unit-network-setup.service’
cannot build derivation ‘/nix/store/7xfncw8bsqhgr9sa46m2iygihbir93w0-nixos-system-nixus-18.03.git.b84fd70.drv’: 1 dependencies couldn't be built
error: build of ‘/nix/store/7xfncw8bsqhgr9sa46m2iygihbir93w0-nixos-system-nixus-18.03.git.b84fd70.drv’ failed

I tracked this particular error to 0d00215. So I reverted it.
But then I see this error:

building path(s) ‘/nix/store/ghpzxbyfm5qin6wpajds3sqjcs68w04q-etc-os-release’
building path(s) ‘/nix/store/52xjqjz80r05i3c3fcdh9djss098fxjc-issue’
building path(s) ‘/nix/store/6z1kg4w6smsza15p1m8ssd73agbfqfwn-unit-docker.service’
building path(s) ‘/nix/store/3pg0sh93cdsgkdq9lqsclg34vplbsn8v-unit-firewall.service’
building path(s) ‘/nix/store/chdqahlwa6sqd2skfwdl75wjfw8shha8-unit-getty-.service’
building path(s) ‘/nix/store/xacv6qcq7qhhg0b4zp9n1rh6havkjs0w-unit-mdadm-grow-continue-.service’
building path(s) ‘/nix/store/83nrcqkbilc0l4qgbxq6nvk57bw9qxvg-unit-mdadm-shutdown.service’
building path(s) ‘/nix/store/2kv367hvdw4b0kyv4aspa37r7s6ml82x-unit-mdmon-.service’
building path(s) ‘/nix/store/z3cv7ivid717h0kddwl528wafdzrhy92-closure-info’
building path(s) ‘/nix/store/1aq46pxrg2vdqmid95vnivnsnv326vk5-emacs-all-the-icons-3.2.0’
/nix/store/46gz3s6zhavr1s566h9yl7gqw7fb94q2-builder: line 3: /nix/store/z3cv7ivid717h0kddwl528wafdzrhy92-closure-info: syntax error: operand expected (error token is "/nix/store/z3cv7ivid717h0kddwl528wafdzrhy92-closure-info")
/nix/store/46gz3s6zhavr1s566h9yl7gqw7fb94q2-builder: line 5: mkdir: command not found
building path(s) ‘/nix/store/sd8h3r7xp6cnrwvrw9ni4fm4j7p56av6-emacs-auto-complete-20170124.1845’
building path(s) ‘/nix/store/7w7y967gy3r3yz0w1n3lkqw1ziw5ncsa-emacs-flycheck-31’
builder for ‘/nix/store/xabyii3ka8bvk1pp0z4gwkgvfry0f09i-closure-info.drv’ failed with exit code 127
building path(s) ‘/nix/store/j7a8lhjsn7s4gjbd8sbm6zdky2q9ns3f-emacs-projectile-20180128.655’
building path(s) ‘/nix/store/bb425wwxq85ssqjghq41j8rzdpbd2xi3-emacs-undo-tree-20170706.246’
building path(s) ‘/nix/store/097gbfyml28h1kp17s6ydk8i8m75rx2j-firefox-unwrapped-58.0.2’
cannot build derivation ‘/nix/store/ifpy9k2vf6hzm8ajqpdvi4yn6alavz6d-initrd.drv’: 1 dependencies couldn't be built
building path(s) ‘/nix/store/5fw96brprz4as3b0ky1nvghq93wbaaf0-nixos-version’
building path(s) ‘/nix/store/m3jsvbx8x9b8z1rswnxmw29gdjfcqbcf-unit-network-local-commands.service’
building path(s) ‘/nix/store/d82pf5pzcwl5i24jp96wp67siv108r9y-unit-network-setup.service’
building path(s) ‘/nix/store/pzpaj3x37pmba1afg0nr2mas5hdngwmy-unit-nix-daemon.service’
building path(s) ‘/nix/store/p7ab83jq1wg3nkr972n8biyj1bjzpk7h-unit-nix-optimise.service’
cannot build derivation ‘/nix/store/vrg5r2mdpm1qzsm9xl5qirr1sj74ab5h-nixos-system-nixus-18.03.git.fdce3d6.drv’: 1 dependencies couldn't be built
error: build of ‘/nix/store/vrg5r2mdpm1qzsm9xl5qirr1sj74ab5h-nixos-system-nixus-18.03.git.fdce3d6.drv’ failed

I am unable to determine what is going on with this.

Technical details

  • system: "x86_64-linux"
  • host os: Linux 4.15.7-hardened, NixOS, 18.03.git.a145640 (Impala)
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 1.11.16
  • channels(root): "nixos-18.03pre130558.7270f2139ae"
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs

Activity

  1. added
    0.kind: bug
    6.topic: nixos
    0.kind: regression
    on Mar 3, 2018
  2. vcunat commented on Mar 3, 2018

    @vcunat
    Member

    That's changed with PR #34636. I can't really look into it properly now, but tomorrow morning I shall.

  3. MP2E commented on Mar 4, 2018

    @MP2E

    I see these same errors, not sure how to proceed

  4. fpletz commented on Mar 4, 2018

    @fpletz
    Member

    The reason for this failure is probably that nix-daemon is still running with Nix 1.x. .attrs.sh was added in Nix 2.0.

  5. added this to the 18.03 milestone on Mar 4, 2018
  6. added
    1.severity: blocker
    on Mar 4, 2018
  7. vcunat commented on Mar 4, 2018

    @vcunat
    Member

    That seems hard to work around. I believe builtins.langVersion will return version of the evaluator and not the daemon (it's a constant defined in libexpr), so the old code won't work either.

  8. vcunat commented on Mar 4, 2018

    @vcunat
    Member

    I expect it's possible to work around this by --no-build-nix when doing the switch, but we would better have compatible builder code anyway.

  9. clefru commented on Mar 4, 2018

    @clefru
    Contributor

    Using --no-build-nix results in the following error:

    [clemens@leto:/tmp]$ nixos-rebuild build --no-build-nix --show-trace
    building the system configuration...
    error: while evaluating the attribute ‘buildCommand’ of the derivation ‘nixos-system-leto-18.03.git.2069a2a’ at /nix/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:148:11:
    while evaluating ‘optionalString’ at /nix/nixpkgs/lib/strings.nix:138:26, called from /nix/nixpkgs/nixos/modules/system/activation/top-level.nix:40:9:
    while evaluating the attribute ‘closure’ of the derivation ‘initrd’ at /nix/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:148:11:
    while evaluating anonymous function at /nix/nixpkgs/pkgs/build-support/closure-info.nix:9:1, called from /nix/nixpkgs/pkgs/build-support/kernel/make-initrd.nix:33:13:
    assertion failed at /nix/nixpkgs/pkgs/build-support/closure-info.nix:11:1
    
  10. vcunat commented on Mar 4, 2018

    @vcunat
    Member

    Yes, of course, I'm sorry :-)

  11. vcunat commented on Mar 4, 2018

    @vcunat
    Member

    Well, always using the nix-1.11 code should work 17ee557, but we would lose some things by that (changes by @edolstra and @shlevy). Any better idea? Perhaps the builder code could detect the daemon version and decide based on that, as a compromise.

  12. shlevy commented on Mar 4, 2018

    @shlevy
    Member

    @vcunat The builder could switch based on the existence of .attrs.sh

  13. shlevy commented on Mar 4, 2018

    @shlevy
    Member

    Ugh no that's probably not enough, because we need to set exportReferencesGraph differently depending on the daemon version...

  14. 30 remaining items

  15. reopened this on Apr 14, 2018
  16. shlevy commented on Apr 14, 2018

    @shlevy
    Member

    I'm confused... This is specifically a problem with upgrading NixOS, unless we have some 18.03 prerelease ISO with nix 1.11 installed this doesn't seem likely to be the same issue...

  17. daveman1010221 commented on Apr 14, 2018

    @daveman1010221
  18. domenkozar commented on Oct 30, 2018

    @domenkozar
    Member

    This issue is not fixed.

    a) NixOS 18.03 is the first release with Nix 2.0

    b) There are nixos utilities using closureInfo which depends on Nix 2.0 features:

    $ git grep closureInfo
    nixos/lib/make-disk-image.nix:  closureInfo = pkgs.closureInfo { rootPaths = [ config.system.build.toplevel channelSources ]; };
    nixos/lib/make-disk-image.nix:    nix-store --load-db < ${closureInfo}/registration
    nixos/lib/make-ext4-fs.nix:  sdClosureInfo = pkgs.closureInfo { rootPaths = storePaths; };
    nixos/lib/make-iso9660-image.nix:{ stdenv, perl, closureInfo, xorriso, syslinux
    nixos/lib/make-iso9660-image.nix:  closureInfo = closureInfo { rootPaths = map (x: x.object) storeContents; };
    nixos/lib/make-iso9660-image.sh:for i in $(< $closureInfo/store-paths); do
    nixos/lib/make-iso9660-image.sh:    cp $closureInfo/registration nix-path-registration
    nixos/lib/make-squashfs.nix:{ stdenv, squashfsTools, closureInfo
    nixos/lib/make-squashfs.nix:      closureInfo=${closureInfo { rootPaths = storeContents; }}
    nixos/lib/make-squashfs.nix:      cp $closureInfo/registration nix-path-registration
    nixos/lib/make-squashfs.nix:      mksquashfs nix-path-registration $(cat $closureInfo/store-paths) $out \
    nixos/modules/installer/netboot/netboot.nix:      inherit (pkgs) stdenv squashfsTools closureInfo;
    nixos/modules/profiles/installation-device.nix:        jq # for closureInfo
    nixos/modules/virtualisation/qemu-vm.nix:  regInfo = pkgs.closureInfo { rootPaths = config.virtualisation.pathsInNixDB; };
    pkgs/build-support/kernel/make-initrd.nix:  # Note: we don't use closureInfo yet, as that won't build with nix-1.x.
    pkgs/build-support/kernel/paths-from-graph.pl:# NOTE: this script is deprecated. Use closureInfo instead.
    pkgs/top-level/all-packages.nix:  closureInfo = callPackage ../build-support/closure-info.nix { };
    

    c) error message is .attrs.sh: No such file or directory

  19. domenkozar commented on Oct 30, 2018

    @domenkozar
    Member

    I wonder if there is a different way than builtins.langVersion to determine it won't work and at least provide a good error what to do.

  20. Synthetica9 commented on Oct 30, 2018

    @Synthetica9
    Member

    Why would you need a different way?

  21. dezgeg commented on Oct 30, 2018

    @dezgeg
    Contributor

    builtins.langVersion doesn't give the version of the nix-daemon running, which is what matters here.

  22. shlevy commented on Oct 31, 2018

    @shlevy
    Member

    I think the best solution is:

    1. Have the builds fail at build time with a nice message, either by the script having some logic coded in or having the needed features expressed in the drv file somehow (the latter would require a new drv format which would break not-nicely on old stores though).
    2. Have nixos-rebuild be aware if some feature is needed that the current store doesn't have, and either transparently use the new nix if the new store is backwards compatible (e.g late nix 1.11 versions can read nix 2.0 stores) or present the user with the options if it's not backwards compatible.
    1. is necessary to cover the nix-build -A sytem case, whereas 2) should give an as-smooth-as-possible path for most users.
  23. removed this from the 18.03 milestone on Jan 22, 2019
  24. arianvp commented on May 31, 2019

    @arianvp
    Member

    Given that we are a year further now, and people should be running 18.09 or 19.03 is the use of closureInfo still an issue?

  25. added this to the 19.09 milestone on Jul 20, 2019
  26. lheckemann commented on Oct 4, 2019

    @lheckemann
    Member

    Closing since nix 2.x has been used for several releases now. Objections welcome :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: bug0.kind: regression1.severity: blocker6.topic: nixos

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions