mirror of
https://github.com/NixOS/nix.git
synced 2024-11-29 18:22:27 +00:00
Merge branch 'test-RemoteStore-buildDerivation' of https://github.com/obsidiansystems/nix
This commit is contained in:
commit
3c619f6290
@ -688,7 +688,7 @@ static void performOp(TunnelLogger * logger, ref<Store> store,
|
|||||||
auto path = store->parseStorePath(readString(from));
|
auto path = store->parseStorePath(readString(from));
|
||||||
logger->startWork();
|
logger->startWork();
|
||||||
logger->stopWork();
|
logger->stopWork();
|
||||||
dumpPath(store->printStorePath(path), to);
|
dumpPath(store->toRealPath(path), to);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,6 +26,16 @@ let
|
|||||||
requiredSystemFeatures = ["bar"];
|
requiredSystemFeatures = ["bar"];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
input3 = mkDerivation {
|
||||||
|
shell = busybox;
|
||||||
|
name = "build-remote-input-3";
|
||||||
|
buildCommand = ''
|
||||||
|
read x < ${input2}
|
||||||
|
echo $x BAZ > $out
|
||||||
|
'';
|
||||||
|
requiredSystemFeatures = ["baz"];
|
||||||
|
};
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
mkDerivation {
|
mkDerivation {
|
||||||
@ -34,7 +44,7 @@ in
|
|||||||
buildCommand =
|
buildCommand =
|
||||||
''
|
''
|
||||||
read x < ${input1}
|
read x < ${input1}
|
||||||
read y < ${input2}
|
read y < ${input3}
|
||||||
echo "$x $y" > $out
|
echo "$x $y" > $out
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,7 @@ builders=(
|
|||||||
# remote-store URL.
|
# remote-store URL.
|
||||||
"ssh://localhost?remote-store=$TEST_ROOT/machine1?system-features=foo - - 1 1 foo"
|
"ssh://localhost?remote-store=$TEST_ROOT/machine1?system-features=foo - - 1 1 foo"
|
||||||
"$TEST_ROOT/machine2 - - 1 1 bar"
|
"$TEST_ROOT/machine2 - - 1 1 bar"
|
||||||
|
"ssh-ng://localhost?remote-store=$TEST_ROOT/machine3?system-features=baz - - 1 1 baz"
|
||||||
)
|
)
|
||||||
|
|
||||||
# Note: ssh://localhost bypasses ssh, directly invoking nix-store as a
|
# Note: ssh://localhost bypasses ssh, directly invoking nix-store as a
|
||||||
@ -25,12 +26,24 @@ nix build -L -v -f build-hook.nix -o $TEST_ROOT/result --max-jobs 0 \
|
|||||||
|
|
||||||
outPath=$(readlink -f $TEST_ROOT/result)
|
outPath=$(readlink -f $TEST_ROOT/result)
|
||||||
|
|
||||||
grep 'FOO BAR' $TEST_ROOT/machine0/$outPath
|
grep 'FOO BAR BAZ' $TEST_ROOT/machine0/$outPath
|
||||||
|
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
# Ensure that input1 was built on store1 due to the required feature.
|
# Ensure that input1 was built on store1 due to the required feature.
|
||||||
(! nix path-info --store $TEST_ROOT/machine2 --all | grep builder-build-remote-input-1.sh)
|
nix path-info --store $TEST_ROOT/machine1 --all \
|
||||||
nix path-info --store $TEST_ROOT/machine1 --all | grep builder-build-remote-input-1.sh
|
| grep builder-build-remote-input-1.sh \
|
||||||
|
| grep -v builder-build-remote-input-2.sh \
|
||||||
|
| grep -v builder-build-remote-input-3.sh
|
||||||
|
|
||||||
# Ensure that input2 was built on store2 due to the required feature.
|
# Ensure that input2 was built on store2 due to the required feature.
|
||||||
(! nix path-info --store $TEST_ROOT/machine1 --all | grep builder-build-remote-input-2.sh)
|
nix path-info --store $TEST_ROOT/machine2 --all \
|
||||||
nix path-info --store $TEST_ROOT/machine2 --all | grep builder-build-remote-input-2.sh
|
| grep -v builder-build-remote-input-1.sh \
|
||||||
|
| grep builder-build-remote-input-2.sh \
|
||||||
|
| grep -v builder-build-remote-input-3.sh
|
||||||
|
|
||||||
|
# Ensure that input3 was built on store3 due to the required feature.
|
||||||
|
nix path-info --store $TEST_ROOT/machine3 --all \
|
||||||
|
| grep -v builder-build-remote-input-1.sh \
|
||||||
|
| grep -v builder-build-remote-input-2.sh \
|
||||||
|
| grep builder-build-remote-input-3.sh
|
||||||
|
Loading…
Reference in New Issue
Block a user