Is there any way to get the list of fixed-output derivations in the build time closure of a given package, ideally at evaluation time?
The problem I am trying to solve is that I’m running a NixOS VM Test which performs a nix build (without any substituters configured, so from source), and those tests fail in the build sandbox, because they cannot fetch the FODs because of the sandbox.
I was thinking, if I could add those to virtualisation.additionalPaths
to make those downloads unnecessary, but still build everything else, as required for that particular test.
This is a log from the test in question that shows the problem:
builderA: must succeed: nix build -f '<nixpkgs-ca>' stdenv.__bootPackages.stdenv.__bootPackages.stdenv.__bootPackages.stdenv.__bootPackages.stdenv.__bootPackages.stdenv.__bootPackages.stdenv.__bootPackages.binutils --secret-key-files "/etc/nix/private-key" -L
builderA # warning: error: unable to download 'https://cache.nixos.org/nix-cache-info': Could not resolve hostname (6); retrying in 274 ms
builderA # warning: error: unable to download 'https://cache.nixos.org/nix-cache-info': Could not resolve hostname (6); retrying in 619 ms
builderA # warning: error: unable to download 'https://cache.nixos.org/nix-cache-info': Could not resolve hostname (6); retrying in 1080 ms
builderA # warning: error: unable to download 'https://cache.nixos.org/nix-cache-info': Could not resolve hostname (6); retrying in 2584 ms
builderA # warning: unable to download 'https://cache.nixos.org/nix-cache-info': Could not resolve hostname (6)
builderA # warning: error: unable to download 'http://tarballs.nixos.org/stdenv/x86_64-unknown-linux-gnu/82b583ba2ba2e5706b35dbe23f31362e62be2a9d/bootstrap-tools.tar.xz': Could not resolve hostname (6); retrying in 324 ms
builderA # warning: error: unable to download 'http://tarballs.nixos.org/stdenv/x86_64-unknown-linux-gnu/82b583ba2ba2e5706b35dbe23f31362e62be2a9d/busybox': Could not resolve hostname (6); retrying in 282 ms
builderA # warning: error: unable to download 'http://tarballs.nixos.org/stdenv/x86_64-unknown-linux-gnu/82b583ba2ba2e5706b35dbe23f31362e62be2a9d/busybox': Could not resolve hostname (6); retrying in 640 ms
builderA # warning: error: unable to download 'http://tarballs.nixos.org/stdenv/x86_64-unknown-linux-gnu/82b583ba2ba2e5706b35dbe23f31362e62be2a9d/bootstrap-tools.tar.xz': Could not resolve hostname (6); retrying in 596 ms
builderA # warning: error: unable to download 'http://tarballs.nixos.org/stdenv/x86_64-unknown-linux-gnu/82b583ba2ba2e5706b35dbe23f31362e62be2a9d/bootstrap-tools.tar.xz': Could not resolve hostname (6); retrying in 1009 ms
builderA # warning: error: unable to download 'http://tarballs.nixos.org/stdenv/x86_64-unknown-linux-gnu/82b583ba2ba2e5706b35dbe23f31362e62be2a9d/busybox': Could not resolve hostname (6); retrying in 1102 ms
builderA # warning: error: unable to download 'http://tarballs.nixos.org/stdenv/x86_64-unknown-linux-gnu/82b583ba2ba2e5706b35dbe23f31362e62be2a9d/bootstrap-tools.tar.xz': Could not resolve hostname (6); retrying in 2293 ms
builderA # warning: error: unable to download 'http://tarballs.nixos.org/stdenv/x86_64-unknown-linux-gnu/82b583ba2ba2e5706b35dbe23f31362e62be2a9d/busybox': Could not resolve hostname (6); retrying in 2544 ms
builderA # bootstrap-tools.tar.xz> error: unable to download 'http://tarballs.nixos.org/stdenv/x86_64-unknown-linux-gnu/82b583ba2ba2e5706b35dbe23f31362e62be2a9d/bootstrap-tools.tar.xz': Could not resolve hostname (6)
builderA # error: builder for '/nix/store/xjkydxc0n24mwxp8kh4wn5jq0fppga9k-bootstrap-tools.tar.xz.drv' failed with exit code 1
builderA # error: 1 dependencies of derivation '/nix/store/w14fhgwzx0421c2ry4d9hx1cpsfsjlf5-bootstrap-tools.drv' failed to build
builderA # error: 1 dependencies of derivation '/nix/store/ppliqnlksscm1hy0s9qpghbdxw3r3c2w-bootstrap-stage0-binutils-wrapper-.drv' failed to build
builderA: output:
Exception in thread Thread-5 (build_and_upload):
Traceback (most recent call last):
File "/nix/store/px2nj16i5gc3d4mnw5l1nclfdxhry61p-python3-3.12.7/lib/python3.12/threading.py", line 1075, in _bootstrap_inner
self.run()
File "/nix/store/px2nj16i5gc3d4mnw5l1nclfdxhry61p-python3-3.12.7/lib/python3.12/threading.py", line 1012, in run
self._target(*self._args, **self._kwargs)
File "<string>", line 43, in build_and_upload
File "/nix/store/f6x385m1zyr28q26z8rxbs9h63ljvy9s-nixos-test-driver-1.1/lib/python3.12/site-packages/test_driver/machine.py", line 612, in succeed
raise Exception(f"command `{command}` failed (exit code {status})")
Exception: command `nix build -f '<nixpkgs-ca>' stdenv.__bootPackages.stdenv.__bootPackages.stdenv.__bootPackages.stdenv.__bootPackages.stdenv.__bootPackages.stdenv.__bootPackages.stdenv.__bootPackages.binutils --secret-key-files "/etc/nix/private-key" -L` failed (exit code 1)
(finished: run the VM test script, in 156.83 seconds)
test script finished in 156.91s
It’s from this CI run: Merge remote-tracking branch 'SomeoneSerge/draft/unflake' · mschwaig/laut@93af691 · GitHub