From 9cabe56fcd72a724a8ebcd3f918f215037955321 Mon Sep 17 00:00:00 2001 From: Raito Bezarius Date: Thu, 21 Aug 2025 14:36:10 +0000 Subject: [PATCH] =?UTF-8?q?Revert=20"libstore:=20don=E2=80=99t=20include?= =?UTF-8?q?=20derivation=20names=20in=20build=20direct..."?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- lix/libstore/build/local-derivation-goal.cc | 7 +++++-- tests/functional/check.sh | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lix/libstore/build/local-derivation-goal.cc b/lix/libstore/build/local-derivation-goal.cc index be1240ce5..7b5d9a141 100644 --- a/lix/libstore/build/local-derivation-goal.cc +++ b/lix/libstore/build/local-derivation-goal.cc @@ -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 diff --git a/tests/functional/check.sh b/tests/functional/check.sh index 671ec2761..87fb5e245 100644 --- a/tests/functional/check.sh +++ b/tests/functional/check.sh @@ -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