libstore: don’t include derivation names in build directories
They have variable size, which is bad for #913. Change-Id: I6a6a6964870e984c66277c7556ff3c2bc34ddca1
This commit is contained in:
@@ -456,8 +456,7 @@ try {
|
||||
|
||||
/* Create a temporary directory where the build will take
|
||||
place. */
|
||||
tmpDirRoot =
|
||||
createTempSubdir(buildDir, "nix-build-" + std::string(drvPath.name()), 0700);
|
||||
tmpDirRoot = createTempSubdir(buildDir, std::nullopt, 0700);
|
||||
} catch (SysError & e) {
|
||||
/*
|
||||
* Fallback to the global tmpdir and create a safe space there
|
||||
@@ -482,9 +481,7 @@ try {
|
||||
settings.buildDir.get(),
|
||||
nixBuildsTmp
|
||||
);
|
||||
tmpDirRoot = createTempSubdir(
|
||||
nixBuildsTmp, "nix-build-" + std::string(drvPath.name()), 0700
|
||||
);
|
||||
tmpDirRoot = createTempSubdir(nixBuildsTmp, std::nullopt, 0700);
|
||||
worker.buildDirOverride = nixBuildsTmp;
|
||||
}
|
||||
/* The TOCTOU between the previous mkdir call and this open call is unavoidable due to
|
||||
|
||||
@@ -40,8 +40,8 @@ test_custom_build_dir() {
|
||||
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-"*
|
||||
[[ 1 == "$(count "$customBuildDir/"*)" ]]
|
||||
local buildDir="$customBuildDir/"*
|
||||
grep $checkBuildId $buildDir/b/checkBuildId
|
||||
}
|
||||
test_custom_build_dir
|
||||
|
||||
Reference in New Issue
Block a user