1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-12-14 21:11:04 +01:00

Add test for output warning to ensure stability

This commit is contained in:
gustavderdrache 2025-05-21 11:11:09 -04:00
parent 8825cd56b5
commit 4355b7cbd5
2 changed files with 34 additions and 0 deletions

View file

@ -33,6 +33,7 @@ suites += {
'debugger.sh',
'source-paths.sh',
'old-lockfiles.sh',
'trace-ifd.sh',
],
'workdir': meson.current_source_dir(),
}

View file

@ -0,0 +1,33 @@
#!/usr/bin/env bash
source ./common.sh
requireGit
flake1Dir="$TEST_ROOT/flake"
createGitRepo "$flake1Dir"
createSimpleGitFlake "$flake1Dir"
cat > "$flake1Dir/flake.nix" <<'EOF'
{
outputs = { self }: let inherit (import ./config.nix) mkDerivation; in {
drv = mkDerivation {
name = "drv";
buildCommand = ''
echo drv >$out
'';
};
ifd = mkDerivation {
name = "ifd";
buildCommand = ''
echo ${builtins.readFile self.drv} >$out
'';
};
};
}
EOF
nix build "$flake1Dir#ifd" --option trace-import-from-derivation true 2>&1 \
| grepQuiet 'warning: built .* during evaluation due to an import from derivation'