summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorMathew Robinson <mathew.robinson@mongodb.com>2019-08-28 20:16:18 +0000
committerMathew Robinson <chasinglogic@gmail.com>2019-09-09 15:08:05 -0400
commit2eeba9bf12fa5c83f19ca36bc0d20914c22a25bb (patch)
treeea36318efac7d26e5f2577151bb478401d88d02a /SConstruct
parent0798d15a586f3af5dcc4ce582ad1fb29f62a6ea1 (diff)
downloadmongo-2eeba9bf12fa5c83f19ca36bc0d20914c22a25bb.tar.gz
SERVER-42911 Pass %APPDATA% into ENV for python subprocesses on Windows
(cherry picked from commit 89b3607e30edefe76ac84052cfe411ee1fda3b95)
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct9
1 files changed, 9 insertions, 0 deletions
diff --git a/SConstruct b/SConstruct
index ede13c1939b..c190673f31c 100644
--- a/SConstruct
+++ b/SConstruct
@@ -1798,6 +1798,15 @@ if env.TargetOSIs('posix'):
except KeyError:
pass
+ # Python uses APPDATA to determine the location of user installed
+ # site-packages. If we do not pass this variable down to Python
+ # subprocesses then anything installed with `pip install --user`
+ # will be inaccessible leading to import errors.
+ if env.TargetOSIs('windows'):
+ appdata = os.getenv('APPDATA', None)
+ if appdata is not None:
+ env['ENV']['APPDATA'] = appdata
+
if env.TargetOSIs('linux') and has_option( "gcov" ):
env.Append( CCFLAGS=["-fprofile-arcs", "-ftest-coverage"] )
env.Append( LINKFLAGS=["-fprofile-arcs", "-ftest-coverage"] )