mirror of
https://github.com/NixOS/nix
synced 2025-07-07 14:21:48 +02:00
Merge pull request #10312 from hercules-ci/add-build-dir
Add build-dir setting
This commit is contained in:
commit
6c10cc0eda
4 changed files with 47 additions and 7 deletions
|
@ -34,6 +34,21 @@ nix-build check.nix -A failed --argstr checkBuildId $checkBuildId \
|
|||
[ "$status" = "100" ]
|
||||
if checkBuildTempDirRemoved $TEST_ROOT/log; then false; fi
|
||||
|
||||
test_custom_build_dir() {
|
||||
local customBuildDir="$TEST_ROOT/custom-build-dir"
|
||||
|
||||
# Nix does not create the parent directories, and perhaps it shouldn't try to
|
||||
# decide the permissions of build-dir.
|
||||
mkdir "$customBuildDir"
|
||||
nix-build check.nix -A failed --argstr checkBuildId $checkBuildId \
|
||||
--no-out-link --keep-failed --option build-dir "$TEST_ROOT/custom-build-dir" 2> $TEST_ROOT/log || status=$?
|
||||
[ "$status" = "100" ]
|
||||
[[ 1 == "$(count "$customBuildDir/nix-build-"*)" ]]
|
||||
local buildDir="$customBuildDir/nix-build-"*
|
||||
grep $checkBuildId $buildDir/checkBuildId
|
||||
}
|
||||
test_custom_build_dir
|
||||
|
||||
nix-build check.nix -A deterministic --argstr checkBuildId $checkBuildId \
|
||||
--no-out-link 2> $TEST_ROOT/log
|
||||
checkBuildTempDirRemoved $TEST_ROOT/log
|
||||
|
|
|
@ -283,6 +283,11 @@ grepQuietInverse() {
|
|||
! grep "$@" > /dev/null
|
||||
}
|
||||
|
||||
# Return the number of arguments
|
||||
count() {
|
||||
echo $#
|
||||
}
|
||||
|
||||
trap onError ERR
|
||||
|
||||
fi # COMMON_VARS_AND_FUNCTIONS_SH_SOURCED
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue