diff --git a/lix/libstore/build/local-derivation-goal.cc b/lix/libstore/build/local-derivation-goal.cc index e82e93ebd..eda71b410 100644 --- a/lix/libstore/build/local-derivation-goal.cc +++ b/lix/libstore/build/local-derivation-goal.cc @@ -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 diff --git a/tests/functional/check.sh b/tests/functional/check.sh index 87fb5e245..671ec2761 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/nix-build-"*)" ]] - local buildDir="$customBuildDir/nix-build-"* + [[ 1 == "$(count "$customBuildDir/"*)" ]] + local buildDir="$customBuildDir/"* grep $checkBuildId $buildDir/b/checkBuildId } test_custom_build_dir