From: Gabe Black Date: Thu, 26 Mar 2020 10:07:53 +0000 (-0700) Subject: scons: Use the scons environment when marshalling. X-Git-Tag: v20.0.0.0~251 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bb3bc1fdd07ba383005357d5a6213b6c8f6e59af;p=gem5.git scons: Use the scons environment when marshalling. scons maintains an environment (in the shell sense) in the ENV construction variable for use when running external programs. When we run the "marshal" program which gathers up python objects to embed in the gem5 binary, it's run by subprocess instead of through scons, and it uses its own environment inherited from the host system. Instead, this change makes the subprocess function use the scons environment when calling "marshal". This ensures the environment is consistent between this command and other commands scons runs. This is usually not very important, but some tools like asan take options set through the environment, and they may need to be adjusted sometimes. Change-Id: I671b447657ed8fad45fac7393cc1c09073bf3d3a Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27123 Reviewed-by: Nikos Nikoleris Maintainer: Bobby R. Bruce Tested-by: kokoro --- diff --git a/src/SConscript b/src/SConscript index 2cdf6cb0c..ed7e1ea54 100644 --- a/src/SConscript +++ b/src/SConscript @@ -1166,7 +1166,8 @@ def embedPyFile(target, source, env): import subprocess - marshalled = subprocess.check_output([source[0].abspath, str(source[1])]) + marshalled = subprocess.check_output( + [source[0].abspath, str(source[1])], env=env['ENV']) compressed = zlib.compress(marshalled) data = compressed