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:08:22 -0400 |
commit | 05cddb7914362e3986d5e20d7a37adca105503ac (patch) | |
tree | 2580eabec41fc2bbac2a938ec38963224c761a8a | |
parent | 4765d68aafd351364163365d25ee5cfe6600e356 (diff) | |
download | mongo-05cddb7914362e3986d5e20d7a37adca105503ac.tar.gz |
SERVER-42911 Pass %APPDATA% into ENV for python subprocesses on Windows
(cherry picked from commit 89b3607e30edefe76ac84052cfe411ee1fda3b95)
-rw-r--r-- | SConstruct | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/SConstruct b/SConstruct index aa02a5c978c..65f7e6a05f2 100644 --- a/SConstruct +++ b/SConstruct @@ -1645,6 +1645,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"] ) |