mirror of
https://github.com/NixOS/nix
synced 2025-06-25 06:31:14 +02:00
Merge pull request #9415 from NixOS/fix-dynamic-derivations
Revert "Revert "Adapt scheduler to work with dynamic derivations
This commit is contained in:
commit
07f853b295
17 changed files with 397 additions and 42 deletions
|
@ -18,4 +18,9 @@ clearStore
|
|||
|
||||
drvDep=$(nix-instantiate ./text-hashed-output.nix -A producingDrv)
|
||||
|
||||
expectStderr 1 nix build "${drvDep}^out^out" --no-link | grepQuiet "Building dynamic derivations in one shot is not yet implemented"
|
||||
# Store layer needs bugfix
|
||||
requireDaemonNewerThan "2.27pre20250205"
|
||||
|
||||
out2=$(nix build "${drvDep}^out^out" --no-link)
|
||||
|
||||
test $out1 == $out2
|
||||
|
|
|
@ -4,8 +4,11 @@ source common.sh
|
|||
|
||||
out1=$(nix-build ./text-hashed-output.nix -A hello --no-out-link)
|
||||
|
||||
# Store layer needs bugfix
|
||||
requireDaemonNewerThan "2.27pre20250205"
|
||||
|
||||
clearStore
|
||||
|
||||
expectStderr 1 nix-build ./text-hashed-output.nix -A wrapper --no-out-link | grepQuiet "Building dynamic derivations in one shot is not yet implemented"
|
||||
out2=$(nix-build ./text-hashed-output.nix -A wrapper --no-out-link)
|
||||
|
||||
# diff -r $out1 $out2
|
||||
diff -r $out1 $out2
|
||||
|
|
12
tests/functional/dyn-drv/failing-outer.sh
Normal file
12
tests/functional/dyn-drv/failing-outer.sh
Normal file
|
@ -0,0 +1,12 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
source common.sh
|
||||
|
||||
# Store layer needs bugfix
|
||||
requireDaemonNewerThan "2.27pre20250205"
|
||||
|
||||
expected=100
|
||||
if [[ -v NIX_DAEMON_PACKAGE ]]; then expected=1; fi # work around the daemon not returning a 100 status correctly
|
||||
|
||||
expectStderr "$expected" nix-build ./text-hashed-output.nix -A failingWrapper --no-out-link \
|
||||
| grepQuiet "build of '.*use-dynamic-drv-in-non-dynamic-drv-wrong.drv' failed"
|
|
@ -12,6 +12,7 @@ suites += {
|
|||
'recursive-mod-json.sh',
|
||||
'build-built-drv.sh',
|
||||
'eval-outputOf.sh',
|
||||
'failing-outer.sh',
|
||||
'dep-built-drv.sh',
|
||||
'old-daemon-error-hack.sh',
|
||||
],
|
||||
|
|
|
@ -13,6 +13,7 @@ rec {
|
|||
echo "Hello World" > $out/hello
|
||||
'';
|
||||
};
|
||||
|
||||
producingDrv = mkDerivation {
|
||||
name = "hello.drv";
|
||||
buildCommand = ''
|
||||
|
@ -23,6 +24,7 @@ rec {
|
|||
outputHashMode = "text";
|
||||
outputHashAlgo = "sha256";
|
||||
};
|
||||
|
||||
wrapper = mkDerivation {
|
||||
name = "use-dynamic-drv-in-non-dynamic-drv";
|
||||
buildCommand = ''
|
||||
|
@ -30,4 +32,12 @@ rec {
|
|||
cp -r ${builtins.outputOf producingDrv.outPath "out"} $out
|
||||
'';
|
||||
};
|
||||
|
||||
failingWrapper = mkDerivation {
|
||||
name = "use-dynamic-drv-in-non-dynamic-drv-wrong";
|
||||
buildCommand = ''
|
||||
echo "Fail at copying the output of the dynamic derivation"
|
||||
fail ${builtins.outputOf producingDrv.outPath "out"} $out
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue