2021-07-27 09:17:56 +00:00
|
|
|
source common.sh
|
|
|
|
|
2021-10-15 12:15:43 +00:00
|
|
|
# Using `--eval-store` with the daemon will eventually copy everything
|
|
|
|
# to the build store, invalidating most of the tests here
|
2021-12-09 15:26:46 +00:00
|
|
|
needLocalStore "“--eval-store” doesn't achieve much with the daemon"
|
2021-07-26 04:54:55 +00:00
|
|
|
|
2021-07-27 09:17:56 +00:00
|
|
|
eval_store=$TEST_ROOT/eval-store
|
|
|
|
|
|
|
|
clearStore
|
|
|
|
rm -rf "$eval_store"
|
|
|
|
|
|
|
|
nix build -f dependencies.nix --eval-store "$eval_store" -o "$TEST_ROOT/result"
|
|
|
|
[[ -e $TEST_ROOT/result/foobar ]]
|
2024-03-04 06:15:08 +00:00
|
|
|
if [[ ! -n "${NIX_TESTS_CA_BY_DEFAULT:-}" ]]; then
|
|
|
|
# Resolved CA derivations are written to store for building
|
|
|
|
#
|
|
|
|
# TODO when we something more systematic
|
|
|
|
# (https://github.com/NixOS/nix/issues/5025) that distinguishes
|
|
|
|
# between scratch storage for building and the final destination
|
|
|
|
# store, we'll be able to make this unconditional again -- resolved
|
|
|
|
# derivations should only appear in the scratch store.
|
|
|
|
(! ls $NIX_STORE_DIR/*.drv)
|
|
|
|
fi
|
2021-07-27 09:17:56 +00:00
|
|
|
ls $eval_store/nix/store/*.drv
|
|
|
|
|
|
|
|
clearStore
|
|
|
|
rm -rf "$eval_store"
|
|
|
|
|
|
|
|
nix-instantiate dependencies.nix --eval-store "$eval_store"
|
|
|
|
(! ls $NIX_STORE_DIR/*.drv)
|
|
|
|
ls $eval_store/nix/store/*.drv
|
|
|
|
|
|
|
|
clearStore
|
|
|
|
rm -rf "$eval_store"
|
|
|
|
|
|
|
|
nix-build dependencies.nix --eval-store "$eval_store" -o "$TEST_ROOT/result"
|
|
|
|
[[ -e $TEST_ROOT/result/foobar ]]
|
2024-03-04 06:15:08 +00:00
|
|
|
if [[ ! -n "${NIX_TESTS_CA_BY_DEFAULT:-}" ]]; then
|
|
|
|
# See above
|
|
|
|
(! ls $NIX_STORE_DIR/*.drv)
|
|
|
|
fi
|
2021-07-27 09:17:56 +00:00
|
|
|
ls $eval_store/nix/store/*.drv
|
2023-12-24 02:26:12 +00:00
|
|
|
|
|
|
|
clearStore
|
|
|
|
rm -rf "$eval_store"
|
|
|
|
|
|
|
|
# Confirm that import-from-derivation builds on the build store
|
|
|
|
[[ $(nix eval --eval-store "$eval_store?require-sigs=false" --impure --raw --file ./ifd.nix) = hi ]]
|
|
|
|
ls $NIX_STORE_DIR/*dependencies-top/foobar
|
|
|
|
(! ls $eval_store/nix/store/*dependencies-top/foobar)
|