[gem5-dev] Change in gem5/gem5[develop]: scons: Build the marshal binary in a bare minimum environment

2020-05-01 Thread Nikos Nikoleris (Gerrit) via gem5-dev
Nikos Nikoleris has submitted this change. (  
https://gem5-review.googlesource.com/c/public/gem5/+/28428 )


Change subject: scons: Build the marshal binary in a bare minimum  
environment

..

scons: Build the marshal binary in a bare minimum environment

This change adds an additional bare minimum environment that includes
python only and changes the marshal binary to compile using it.

Change-Id: Id5d1ee6899796d746d8dc1a004cfe4795f040c55
Signed-off-by: Nikos Nikoleris 
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/28428
Reviewed-by: Gabe Black 
Maintainer: Gabe Black 
Tested-by: kokoro 
---
M SConstruct
M src/SConscript
2 files changed, 10 insertions(+), 7 deletions(-)

Approvals:
  Gabe Black: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass



diff --git a/SConstruct b/SConstruct
index 3345148..ba4affa 100755
--- a/SConstruct
+++ b/SConstruct
@@ -709,6 +709,10 @@
 if not conf.CheckLib(lib):
 error("Can't find library %s required by python." % lib)

+main.Prepend(CPPPATH=Dir('ext/pybind11/include/'))
+# Bare minimum environment that only includes python
+base_py_env = main.Clone()
+
 # On Solaris you need to use libsocket for socket ops
 if not  
conf.CheckLibWithHeader(None, 'sys/socket.h', 'C++', 'accept(0,0,0);'):

if not conf.CheckLibWithHeader('socket', 'sys/socket.h',
@@ -1100,8 +1104,6 @@
 gdb_xml_dir = joinpath(ext_dir, 'gdb-xml')
 Export('gdb_xml_dir')

-main.Prepend(CPPPATH=Dir('ext/pybind11/include/'))
-
 ###
 #
 # This builder and wrapper method are used to set up a directory with
@@ -1259,7 +1261,8 @@
 # The src/SConscript file sets up the build rules in 'env' according
 # to the configured variables.  It returns a list of environments,
 # one for each variant build (debug, opt, etc.)
-SConscript('src/SConscript', variant_dir = variant_path, exports  
= 'env')

+SConscript('src/SConscript', variant_dir=variant_path,
+   exports=['env', 'base_py_env'])

 # base help text
 Help('''
diff --git a/src/SConscript b/src/SConscript
index c7251fc..134e2a5 100644
--- a/src/SConscript
+++ b/src/SConscript
@@ -1,6 +1,6 @@
 # -*- mode:python -*-

-# Copyright (c) 2018 ARM Limited
+# Copyright (c) 2018, 2020 ARM Limited
 #
 # The license below extends only to copyright in the software and shall
 # not be construed as granting a license to any other intellectual
@@ -1140,7 +1140,7 @@
 # Build a small helper that marshals the Python code using the same
 # version of Python as gem5. This is in an unorthodox location to
 # avoid building it for every variant.
-py_marshal = env.Program('marshal', 'python/marshal.cc')[0]
+py_marshal = base_py_env.Program('marshal', 'python/marshal.cc')[0]

 # Embed python files.  All .py files that have been indicated by a
 # PySource() call in a SConscript need to be embedded into the M5
@@ -1196,8 +1196,8 @@
 code.write(str(target[0]))

 for source in PySource.all:
-env.Command(source.cpp, [ py_marshal, source.tnode ],
-MakeAction(embedPyFile, Transform("EMBED PY")))
+base_py_env.Command(source.cpp, [ py_marshal, source.tnode ],
+MakeAction(embedPyFile, Transform("EMBED PY")))
 Source(source.cpp, tags=source.tags, add_tags='python')

 

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/28428
To unsubscribe, or for help writing mail filters, visit  
https://gem5-review.googlesource.com/settings


Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Id5d1ee6899796d746d8dc1a004cfe4795f040c55
Gerrit-Change-Number: 28428
Gerrit-PatchSet: 2
Gerrit-Owner: Nikos Nikoleris 
Gerrit-Reviewer: Bobby R. Bruce 
Gerrit-Reviewer: Gabe Black 
Gerrit-Reviewer: Giacomo Travaglini 
Gerrit-Reviewer: Jason Lowe-Power 
Gerrit-Reviewer: Nikos Nikoleris 
Gerrit-Reviewer: Yu-hsin Wang 
Gerrit-Reviewer: kokoro 
Gerrit-MessageType: merged
___
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s


[gem5-dev] Change in gem5/gem5[develop]: scons: Build the marshal binary in a bare minimum environment

2020-05-01 Thread Nikos Nikoleris (Gerrit) via gem5-dev
Nikos Nikoleris has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/28428 )



Change subject: scons: Build the marshal binary in a bare minimum  
environment

..

scons: Build the marshal binary in a bare minimum environment

This change adds an additional bare minimum environment that includes
python only and changes the marshal binary to compile using it.

Change-Id: Id5d1ee6899796d746d8dc1a004cfe4795f040c55
Signed-off-by: Nikos Nikoleris 
---
M SConstruct
M src/SConscript
2 files changed, 10 insertions(+), 7 deletions(-)



diff --git a/SConstruct b/SConstruct
index 3345148..ba4affa 100755
--- a/SConstruct
+++ b/SConstruct
@@ -709,6 +709,10 @@
 if not conf.CheckLib(lib):
 error("Can't find library %s required by python." % lib)

+main.Prepend(CPPPATH=Dir('ext/pybind11/include/'))
+# Bare minimum environment that only includes python
+base_py_env = main.Clone()
+
 # On Solaris you need to use libsocket for socket ops
 if not  
conf.CheckLibWithHeader(None, 'sys/socket.h', 'C++', 'accept(0,0,0);'):

if not conf.CheckLibWithHeader('socket', 'sys/socket.h',
@@ -1100,8 +1104,6 @@
 gdb_xml_dir = joinpath(ext_dir, 'gdb-xml')
 Export('gdb_xml_dir')

-main.Prepend(CPPPATH=Dir('ext/pybind11/include/'))
-
 ###
 #
 # This builder and wrapper method are used to set up a directory with
@@ -1259,7 +1261,8 @@
 # The src/SConscript file sets up the build rules in 'env' according
 # to the configured variables.  It returns a list of environments,
 # one for each variant build (debug, opt, etc.)
-SConscript('src/SConscript', variant_dir = variant_path, exports  
= 'env')

+SConscript('src/SConscript', variant_dir=variant_path,
+   exports=['env', 'base_py_env'])

 # base help text
 Help('''
diff --git a/src/SConscript b/src/SConscript
index c7251fc..134e2a5 100644
--- a/src/SConscript
+++ b/src/SConscript
@@ -1,6 +1,6 @@
 # -*- mode:python -*-

-# Copyright (c) 2018 ARM Limited
+# Copyright (c) 2018, 2020 ARM Limited
 #
 # The license below extends only to copyright in the software and shall
 # not be construed as granting a license to any other intellectual
@@ -1140,7 +1140,7 @@
 # Build a small helper that marshals the Python code using the same
 # version of Python as gem5. This is in an unorthodox location to
 # avoid building it for every variant.
-py_marshal = env.Program('marshal', 'python/marshal.cc')[0]
+py_marshal = base_py_env.Program('marshal', 'python/marshal.cc')[0]

 # Embed python files.  All .py files that have been indicated by a
 # PySource() call in a SConscript need to be embedded into the M5
@@ -1196,8 +1196,8 @@
 code.write(str(target[0]))

 for source in PySource.all:
-env.Command(source.cpp, [ py_marshal, source.tnode ],
-MakeAction(embedPyFile, Transform("EMBED PY")))
+base_py_env.Command(source.cpp, [ py_marshal, source.tnode ],
+MakeAction(embedPyFile, Transform("EMBED PY")))
 Source(source.cpp, tags=source.tags, add_tags='python')

 

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/28428
To unsubscribe, or for help writing mail filters, visit  
https://gem5-review.googlesource.com/settings


Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Id5d1ee6899796d746d8dc1a004cfe4795f040c55
Gerrit-Change-Number: 28428
Gerrit-PatchSet: 1
Gerrit-Owner: Nikos Nikoleris 
Gerrit-MessageType: newchange
___
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s