diff options
author | Mathew Robinson <mathew.robinson@mongodb.com> | 2019-08-28 20:16:18 +0000 |
---|---|---|
committer | Mathew Robinson <chasinglogic@gmail.com> | 2019-09-09 15:07:46 -0400 |
commit | 8caf0e6c0dd80689bb79e02b977d0e76123285bc (patch) | |
tree | e5e04b37cfef9ab8fece9804dac44ad43be744ab /SConstruct | |
parent | d1c52b7aafac44e16dd62ce94663eab1aa16f921 (diff) | |
download | mongo-8caf0e6c0dd80689bb79e02b977d0e76123285bc.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-- | SConstruct | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/SConstruct b/SConstruct index 7ebbcbcc344..ad53d59279e 100644 --- a/SConstruct +++ b/SConstruct @@ -1897,6 +1897,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", "-fprofile-update=single"] ) env.Append( LINKFLAGS=["-fprofile-arcs", "-ftest-coverage", "-fprofile-update=single"] ) |