diff options
author | Matthew Bauer <mjbauer95@gmail.com> | 2019-10-13 16:41:49 -0400 |
---|---|---|
committer | Matthew Bauer <mjbauer95@gmail.com> | 2019-10-13 16:41:49 -0400 |
commit | 96c84937c49435525d0733437aa88902b2c8caf6 (patch) | |
tree | 46151dc10292155243dd40c8f563efbc967fd588 | |
parent | 499b0388759db0f9f385da402a4bba551268aa99 (diff) |
Move tmpDirInSandbox to initTmpDir
-rw-r--r-- | src/libstore/build.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc index 273f25363..03a069ae2 100644 --- a/src/libstore/build.cc +++ b/src/libstore/build.cc @@ -1961,13 +1961,6 @@ void DerivationGoal::startBuilder() auto drvName = storePathToName(drvPath); tmpDir = createTempDir("", "nix-build-" + drvName, false, false, 0700); - /* In a sandbox, for determinism, always use the same temporary - directory. */ -#if __linux__ - tmpDirInSandbox = useChroot ? settings.sandboxBuildDir : tmpDir; -#else - tmpDirInSandbox = tmpDir; -#endif chownToBuilder(tmpDir); /* Substitute output placeholders with the actual output paths. */ @@ -2385,7 +2378,6 @@ void DerivationGoal::startBuilder() int res = helper.wait(); if (res != 0 && settings.sandboxFallback) { useChroot = false; - tmpDirInSandbox = tmpDir; initTmpDir(); goto fallback; } else if (res != 0) @@ -2443,6 +2435,14 @@ void DerivationGoal::startBuilder() void DerivationGoal::initTmpDir() { + /* In a sandbox, for determinism, always use the same temporary + directory. */ +#if __linux__ + tmpDirInSandbox = useChroot ? settings.sandboxBuildDir : tmpDir; +#else + tmpDirInSandbox = tmpDir; +#endif + /* In non-structured mode, add all bindings specified in the derivation via the environment, except those listed in the passAsFile attribute. Those are passed as file names pointing |