Gabe Black has submitted this change. ( )

Change subject: scons: Use the scons environment when marshalling.

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

Change-Id: I671b447657ed8fad45fac7393cc1c09073bf3d3a
Reviewed-by: Nikos Nikoleris <>
Maintainer: Bobby R. Bruce <>
Tested-by: kokoro <>
M src/SConscript
1 file changed, 2 insertions(+), 1 deletion(-)

  Nikos Nikoleris: Looks good to me, approved
  Bobby R. Bruce: Looks good to me, approved
  kokoro: Regressions pass

diff --git a/src/SConscript b/src/SConscript
index 2cdf6cb..ed7e1ea 100644
--- a/src/SConscript
+++ b/src/SConscript
@@ -1166,7 +1166,8 @@

     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

To view, visit
To unsubscribe, or for help writing mail filters, visit

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I671b447657ed8fad45fac7393cc1c09073bf3d3a
Gerrit-Change-Number: 27123
Gerrit-PatchSet: 2
Gerrit-Owner: Gabe Black <>
Gerrit-Reviewer: Bobby R. Bruce <>
Gerrit-Reviewer: Gabe Black <>
Gerrit-Reviewer: Gabe Black <>
Gerrit-Reviewer: Jason Lowe-Power <>
Gerrit-Reviewer: Nikos Nikoleris <>
Gerrit-Reviewer: kokoro <>
Gerrit-CC: Earl Ou <>
Gerrit-CC: Jui-min Lee <>
Gerrit-CC: Yu-hsin Wang <>
Gerrit-MessageType: merged
gem5-dev mailing list

Reply via email to