summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/Node/FS.py
diff options
context:
space:
mode:
authorGary Oberbrunner <garyo@genarts.com>2018-01-05 19:03:31 (GMT)
committerGary Oberbrunner <garyo@genarts.com>2018-01-05 19:12:39 (GMT)
commit25887d95760e9e4ac65f8bbde3a99a0b3a1d471a (patch)
treed1ac77219834117edd2bfd6d7c05fdecfd2269c6 /src/engine/SCons/Node/FS.py
parent91d11918ad131c816dd481b82ca90b6aa15dc56b (diff)
downloadSCons-25887d95760e9e4ac65f8bbde3a99a0b3a1d471a.zip
SCons-25887d95760e9e4ac65f8bbde3a99a0b3a1d471a.tar.gz
SCons-25887d95760e9e4ac65f8bbde3a99a0b3a1d471a.tar.bz2
Fix problem with Install and multiple dirs outside src tree.
In some cases it's possible to get a case where the target path already does exist, but the dir node for it hasn't been updated yet. This fix prevents MkdirFunc from trying to create it when it already exists. Added a testcase which failed before the fix and works after it. Also fixes a problem running tests on Windows, using standard python 3 which is installed in "C:/Program Files/Python36". The python path name has to be escaped in that case. See runtest.py.
Diffstat (limited to 'src/engine/SCons/Node/FS.py')
-rw-r--r--src/engine/SCons/Node/FS.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py
index 684f0d1..9a48432 100644
--- a/src/engine/SCons/Node/FS.py
+++ b/src/engine/SCons/Node/FS.py
@@ -328,7 +328,12 @@ Unlink = SCons.Action.Action(UnlinkFunc, None)
def MkdirFunc(target, source, env):
t = target[0]
- if not t.exists():
+ # This os.path.exists test looks redundant, but it's possible
+ # when using Install() to install multiple dirs outside the
+ # source tree to get a case where t.exists() is true but
+ # the path does already exist, so this prevents spurious
+ # build failures in that case. See test/Install/multi-dir.
+ if not t.exists() and not os.path.exists(t.get_abspath()):
t.fs.mkdir(t.get_abspath())
return 0