Revert "libstore: don’t include derivation names in build direct..."

Revert submission 3850

Reason for revert: caused multiple regressions noticed in https://git.lix.systems/lix-project/lix/issues/975 and https://git.lix.systems/lix-project/lix/issues/966 (suspected).

Root cause analysis has not been done yet and this breaks Lix on Darwin on HEAD.

Reverted changes: /q/submissionid:3850

Change-Id: Iee4c3f071238fa58e0e92f0bcc5584ded4a9d71f
This commit is contained in:
Raito Bezarius
2025-08-21 14:37:46 +00:00
parent 61955d0a40
commit 9cabe56fcd
2 changed files with 7 additions and 4 deletions
+5 -2
View File
@@ -446,7 +446,8 @@ try {
/* Create a temporary directory where the build will take
place. */
tmpDirRoot = createTempSubdir(buildDir, std::nullopt, 0700);
tmpDirRoot =
createTempSubdir(buildDir, "nix-build-" + std::string(drvPath.name()), 0700);
} catch (SysError & e) {
/*
* Fallback to the global tmpdir and create a safe space there
@@ -471,7 +472,9 @@ try {
settings.buildDir.get(),
nixBuildsTmp
);
tmpDirRoot = createTempSubdir(nixBuildsTmp, std::nullopt, 0700);
tmpDirRoot = createTempSubdir(
nixBuildsTmp, "nix-build-" + std::string(drvPath.name()), 0700
);
worker.buildDirOverride = nixBuildsTmp;
}
/* The TOCTOU between the previous mkdir call and this open call is unavoidable due to
+2 -2
View File
@@ -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/"*)" ]]
local buildDir="$customBuildDir/"*
[[ 1 == "$(count "$customBuildDir/nix-build-"*)" ]]
local buildDir="$customBuildDir/nix-build-"*
grep $checkBuildId $buildDir/b/checkBuildId
}
test_custom_build_dir