From dd0bc4758718abc47050f0b91dfc777a54b67899 Mon Sep 17 00:00:00 2001 From: Mathew Robinson Date: Wed, 28 Aug 2019 20:16:18 +0000 Subject: SERVER-42911 Pass %APPDATA% into ENV for python subprocesses on Windows (cherry picked from commit 89b3607e30edefe76ac84052cfe411ee1fda3b95) --- SConstruct | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/SConstruct b/SConstruct index f72671f57e8..75539154e8c 100644 --- a/SConstruct +++ b/SConstruct @@ -1595,6 +1595,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"] ) -- cgit v1.2.1