lix/src/libstore
Graham Christensen c502831a1d
exportReferencesGraph: support working
Before, we would get:

    [deploy@bastion:~]$ nix-store -r /nix/store/grfnl76cahwls0igd2by2pqv0dimi8h2-nixos-system-eris-19.09.20191213.03f3def.drv
    these derivations will be built:
      /nix/store/3ka4ihvwh6wsyhpd2qa9f59506mnxvx1-initrd-linux-4.19.88.drv
      /nix/store/ssxwmll7v21did1c8j027q0m8w6pg41i-unit-prometheus-alertmanager-irc-notifier.service.drv
      /nix/store/mvyvkj46ay7pp7b1znqbkck2mq98k0qd-unit-script-network-local-commands-start.drv
      /nix/store/vsl1y9mz38qfk6pyirjwnfzfggz5akg6-unit-network-local-commands.service.drv
      /nix/store/wi5ighfwwb83fdmav6z6n2fw6npm9ffl-unit-prometheus-hydra-exporter.service.drv
      /nix/store/x0qkv535n75pbl3xn6nn1w7qkrg9wwyg-unit-prometheus-packet-sd.service.drv
      /nix/store/lv491znsjxdf51xnfxh9ld7r1zg14d52-unit-script-packet-sd-env-key-pre-start.drv
      /nix/store/nw4nzlca49agsajvpibx7zg5b873gk9f-unit-script-packet-sd-env-key-start.drv
      /nix/store/x674wwabdwjrkhnykair4c8mpxa9532w-unit-packet-sd-env-key.service.drv
      /nix/store/ywivz64ilb1ywlv652pkixw3vxzfvgv8-unit-wireguard-wg0.service.drv
      /nix/store/v3b648293g3zl8pnn0m1345nvmyd8dwb-unit-script-acme-selfsigned-status.nixos.org-start.drv
      /nix/store/zci5d3zvr6fgdicz6k7jjka6lmx0v3g4-unit-acme-selfsigned-status.nixos.org.service.drv
      /nix/store/f6pwvnm63d0kw5df0v7sipd1rkhqxk5g-system-units.drv
      /nix/store/iax8071knxk9c7krpm9jqg0lcrawf4lc-etc.drv
      /nix/store/grfnl76cahwls0igd2by2pqv0dimi8h2-nixos-system-eris-19.09.20191213.03f3def.drv
    error: invalid file name 'closure-init-0' in 'exportReferencesGraph'

This was tough to debug, I didn't figure out which one was broken until I did:

    nix-store -r /nix/store/grfnl76cahwls0igd2by2pqv0dimi8h2-nixos-system-eris-19.09.20191213.03f3def.drv 2>&1 | grep  nix/store | xargs -n1 nix-store -r

and then looking at the remaining build graph:

    $ nix-store -r /nix/store/grfnl76cahwls0igd2by2pqv0dimi8h2-nixos-system-eris-19.09.20191213.03f3def.drv
    these derivations will be built:
      /nix/store/3ka4ihvwh6wsyhpd2qa9f59506mnxvx1-initrd-linux-4.19.88.drv
      /nix/store/grfnl76cahwls0igd2by2pqv0dimi8h2-nixos-system-eris-19.09.20191213.03f3def.drv
    error: invalid file name 'closure-init-0' in 'exportReferencesGraph'

and knowing the initrd build is before the system, then:

    $ nix show-derivation /nix/store/3ka4ihvwh6wsyhpd2qa9f59506mnxvx1-initrd-linux-4.19.88.drv
    {
      "/nix/store/3ka4ihvwh6wsyhpd2qa9f59506mnxvx1-initrd-linux-4.19.88.drv": {
        [...]
        "exportReferencesGraph": "closure-init-0 /nix/store/...-stage-1-init.sh closure-mdadm.conf-1 /nix/store/...-mdadm.conf closure-ubuntu.conf-2 ...",
        [...]
      }
    }

I then searched the repo for "in 'exportReferencesGraph'", found this
recently updated regex, and realized it was missing a "-".
2020-01-01 20:50:40 -05:00
..
builtins Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
binary-cache-store.cc Add priority setting to stores 2019-12-17 17:17:53 +01:00
binary-cache-store.hh Add priority setting to stores 2019-12-17 17:17:53 +01:00
build.cc exportReferencesGraph: support working 2020-01-01 20:50:40 -05:00
builtins.hh Make <nix/unpack-channel.nix> a builtin builder 2019-11-26 22:07:28 +01:00
crypto.cc binary-cache-public-keys -> trusted-public-keys 2017-11-20 17:32:34 +01:00
crypto.hh Revert "Get rid of unicode quotes (#1140)" 2016-11-26 00:38:01 +01:00
daemon.cc nix-store -r: Handle symlinks to store paths 2019-12-16 19:11:47 +01:00
daemon.hh Recursive Nix support 2019-11-06 00:52:38 +01:00
derivations.cc nix-store -r: Handle symlinks to store paths 2019-12-16 19:11:47 +01:00
derivations.hh Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
download.cc Merge branch 'libarchive' of https://github.com/yorickvP/nix 2019-12-19 14:47:18 +01:00
download.hh Remove #include 2019-11-07 10:12:35 +01:00
export-import.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
fs-accessor.hh Shut up some warnings 2019-09-22 21:57:05 +02:00
gc.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
globals.cc Disable use-sqlite-wal under WSL 2019-12-21 08:14:19 +11:00
globals.hh Disable use-sqlite-wal under WSL 2019-12-21 08:14:19 +11:00
http-binary-cache-store.cc Add priority setting to stores 2019-12-17 17:17:53 +01:00
legacy-ssh-store.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
local-binary-cache-store.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
local-fs-store.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
local-store.cc Add priority setting to stores 2019-12-17 17:17:53 +01:00
local-store.hh Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
local.mk Only install *.sb files on macOS 2019-12-13 14:42:55 +01:00
machines.cc getMachines(): Cache result 2019-04-01 21:09:35 +02:00
machines.hh Replace $NIX_REMOTE_SYSTEMS with an option "builder-files" 2017-05-02 15:46:09 +02:00
misc.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
nar-accessor.cc Provide random access to cached NARs 2017-12-07 01:07:07 +01:00
nar-accessor.hh Fix build on gcc 7 2017-12-16 00:49:31 +01:00
nar-info-disk-cache.cc Add priority setting to stores 2019-12-17 17:17:53 +01:00
nar-info-disk-cache.hh Add priority setting to stores 2019-12-17 17:17:53 +01:00
nar-info.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
nar-info.hh Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
nix-store.pc.in pkg-config files: Use c++17 2019-03-14 14:11:12 +01:00
optimise-store.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
parsed-derivations.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
parsed-derivations.hh Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
path.cc nix-store -r: Handle symlinks to store paths 2019-12-16 19:11:47 +01:00
path.hh nix-store -r: Handle symlinks to store paths 2019-12-16 19:11:47 +01:00
pathlocks.cc pathlocks: add include to fcntl.h for O_CLOEXEC 2019-08-07 07:41:22 -05:00
pathlocks.hh Use BSD instead of POSIX file locks 2019-08-02 18:39:16 +02:00
profiles.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
profiles.hh this updates issues that were addressed by people in pr 2018-03-01 21:47:57 -05:00
references.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
references.hh Allow content-addressable paths to have references 2019-10-21 17:47:24 +02:00
remote-fs-accessor.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
remote-fs-accessor.hh Provide random access to cached NARs 2017-12-07 01:07:07 +01:00
remote-store.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
remote-store.hh Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
s3-binary-cache-store.cc Add priority setting to stores 2019-12-17 17:17:53 +01:00
s3-binary-cache-store.hh Fix getS3Stats() 2016-10-06 17:00:52 +02:00
s3.hh s3: make scheme configurable 2018-12-07 23:55:38 +01:00
sandbox-defaults.sb Remove extraneous comment 2017-11-08 16:17:32 +01:00
sandbox-minimal.sb Always use the Darwin sandbox 2017-06-06 18:44:49 +02:00
sandbox-network.sb OS X sandbox: Improve builtin sandbox profile 2017-05-31 17:25:51 +02:00
schema.sql Mark content-addressed paths in the Nix database and in .narinfo 2016-08-10 18:05:35 +02:00
serve-protocol.hh Make adding paths via nix-store --serve run in constant memory 2018-08-03 21:21:16 +02:00
sqlite.cc Use extended SQLite error codes 2018-05-30 13:25:03 +02:00
sqlite.hh Add priority setting to stores 2019-12-17 17:17:53 +01:00
ssh-store.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
ssh.cc Simplify 2019-12-13 12:53:20 +01:00
ssh.hh SSHMaster: Bypass SSH when connecting to localhost 2018-08-03 21:20:38 +02:00
store-api.cc Add priority setting to stores 2019-12-17 17:17:53 +01:00
store-api.hh Add priority setting to stores 2019-12-17 17:17:53 +01:00
worker-protocol.hh Make the Store API more type-safe 2019-12-10 22:06:05 +01:00