diff options
author | Mathew Robinson <mathew.robinson@mongodb.com> | 2019-11-21 15:43:54 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2019-11-21 15:43:54 +0000 |
commit | 38d755811646ceb967436122d4c80194d76821e6 (patch) | |
tree | 27fe6785cf4809fc29ba807fe3c7220271901a07 /SConstruct | |
parent | 81318c61ba8b2f88f1e43359fc4b5ffbc7d1934b (diff) | |
download | mongo-38d755811646ceb967436122d4c80194d76821e6.tar.gz |
SERVER-44542 Propagation of APPDATA environment variable never gets executed on Windows
Diffstat (limited to 'SConstruct')
-rw-r--r-- | SConstruct | 21 |
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"] ) |