summaryrefslogtreecommitdiffstats
path: root/SCons/Environment.py
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2021-01-16 21:59:06 (GMT)
committerWilliam Deegan <bill@baddogconsulting.com>2021-01-16 21:59:06 (GMT)
commitea7f260bead374ee572763093ad8268233f335fa (patch)
tree819831df0896516bb29a3d4523e0322e39ccf922 /SCons/Environment.py
parentfa24170ac8434d289d1a3061f88eb0556671032e (diff)
downloadSCons-ea7f260bead374ee572763093ad8268233f335fa.zip
SCons-ea7f260bead374ee572763093ad8268233f335fa.tar.gz
SCons-ea7f260bead374ee572763093ad8268233f335fa.tar.bz2
Ensure that when user runs scons -n/--no_exec the CacheDir's config file is not created
Diffstat (limited to 'SCons/Environment.py')
-rw-r--r--SCons/Environment.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/SCons/Environment.py b/SCons/Environment.py
index 89bfa76..9e2870c 100644
--- a/SCons/Environment.py
+++ b/SCons/Environment.py
@@ -1995,15 +1995,16 @@ class Base(SubstitutionEnvironment):
return SCons.Builder.Builder(**nkw)
def CacheDir(self, path):
- import SCons.CacheDir
if path is not None:
path = self.subst(path)
self._CacheDir_path = path
- # Now initialized the CacheDir and prevent a race condition which can
- # happen when there's no existing cache dir and you are building with
- # multiple threads, but initializing it before the task walk starts
- self.get_CacheDir()
+ if SCons.Action.execute_actions:
+ # Only initialize the CacheDir if -n/-no_exec was NOT specified.
+ # Now initialized the CacheDir and prevent a race condition which can
+ # happen when there's no existing cache dir and you are building with
+ # multiple threads, but initializing it before the task walk starts
+ self.get_CacheDir()
def Clean(self, targets, files):
global CleanTargets