1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-08 11:03:54 +02:00

Merge remote-tracking branch 'origin/master' into nixbuildaddprintstorepaths

This commit is contained in:
Théophane Hufschmitt 2022-04-22 11:11:01 +02:00
commit be28603dca
72 changed files with 1538 additions and 1163 deletions

View file

@ -2,7 +2,7 @@ source common.sh
file=build-hook-ca-floating.nix
enableFeatures "ca-derivations ca-references"
enableFeatures "ca-derivations"
CONTENT_ADDRESSED=true

View file

@ -1,5 +1,5 @@
source ../common.sh
enableFeatures "ca-derivations ca-references"
enableFeatures "ca-derivations"
restartDaemon

11
tests/ca/selfref-gc.sh Executable file
View file

@ -0,0 +1,11 @@
#!/usr/bin/env bash
source common.sh
requireDaemonNewerThan "2.4pre20210626"
enableFeatures "ca-derivations nix-command flakes"
export NIX_TESTS_CA_BY_DEFAULT=1
cd ..
source ./selfref-gc.sh

View file

@ -20,6 +20,8 @@ nix eval --expr 'assert 1 + 2 == 3; true'
[[ $(nix eval attr --json -f "./eval.nix") == '{"foo":"bar"}' ]]
[[ $(nix eval int -f - < "./eval.nix") == 123 ]]
# Check if toFile can be utilized during restricted eval
[[ $(nix eval --restrict-eval --expr 'import (builtins.toFile "source" "42")') == 42 ]]
nix-instantiate --eval -E 'assert 1 + 2 == 3; true'
[[ $(nix-instantiate -A int --eval "./eval.nix") == 123 ]]

View file

@ -92,6 +92,7 @@ nix_tests = \
plugins.sh \
build.sh \
ca/nix-run.sh \
selfref-gc.sh ca/selfref-gc.sh \
db-migration.sh \
bash-profile.sh \
pass-as-file.sh \

View file

@ -3,7 +3,7 @@ source common.sh
clearStore
clearProfiles
enableFeatures "ca-derivations ca-references"
enableFeatures "ca-derivations"
restartDaemon
# Make a flake.

View file

@ -13,7 +13,7 @@ MySettings mySettings;
static GlobalConfig::Register rs(&mySettings);
static void prim_anotherNull (EvalState & state, const Pos & pos, Value ** args, Value & v)
static void prim_anotherNull (EvalState & state, const PosIdx pos, Value ** args, Value & v)
{
if (mySettings.settingSet)
v.mkNull();

30
tests/selfref-gc.sh Normal file
View file

@ -0,0 +1,30 @@
source common.sh
requireDaemonNewerThan "2.6.0pre20211215"
clearStore
nix-build --no-out-link -E '
with import ./config.nix;
let d1 = mkDerivation {
name = "selfref-gc";
outputs = [ "out" ];
buildCommand = "
echo SELF_REF: $out > $out
";
}; in
# the only change from d1 is d1 as an (unused) build input
# to get identical store path in CA.
mkDerivation {
name = "selfref-gc";
outputs = [ "out" ];
buildCommand = "
echo UNUSED: ${d1}
echo SELF_REF: $out > $out
";
}
'
nix-collect-garbage