summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathew Robinson <mathew.robinson@mongodb.com>2019-11-21 15:43:54 +0000
committerevergreen <evergreen@mongodb.com>2019-11-21 15:43:54 +0000
commit38d755811646ceb967436122d4c80194d76821e6 (patch)
tree27fe6785cf4809fc29ba807fe3c7220271901a07
parent81318c61ba8b2f88f1e43359fc4b5ffbc7d1934b (diff)
downloadmongo-38d755811646ceb967436122d4c80194d76821e6.tar.gz
SERVER-44542 Propagation of APPDATA environment variable never gets executed on Windows
-rw-r--r--SConstruct21
1 files changed, 12 insertions, 9 deletions
diff --git a/SConstruct b/SConstruct
index fd7fd420a91..321ce8595ff 100644
--- a/SConstruct
+++ b/SConstruct
@@ -1892,6 +1892,18 @@ elif env.TargetOSIs('windows'):
if env.ToolchainIs('msvc'):
env['PDB'] = '${TARGET.base}.pdb'
+# 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.
+#
+# Use env['PLATFORM'] instead of TargetOSIs since we always want this
+# to run on Windows hosts but not always for Windows targets.
+if env['PLATFORM'] == 'win32':
+ appdata = os.getenv('APPDATA', None)
+ if appdata is not None:
+ env['ENV']['APPDATA'] = appdata
+
if env.TargetOSIs('posix'):
# On linux, C code compiled with gcc/clang -std=c11 causes
@@ -1981,15 +1993,6 @@ 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"] )