Gabe Black has submitted this change. (
https://gem5-review.googlesource.com/c/public/gem5/+/49407 )
(
29 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the
submitted one.
)Change subject: scons: When importing SimObjects, use a copy of globals().
......................................................................
scons: When importing SimObjects, use a copy of globals().
Use a copy of globals when importing SimObjects, instead of the real
deal that the SConscript runs under. This avoids polluting the
SConscript namespace.
Change-Id: I689d693d93cc8998be0967ec2b0c58f5851d39cf
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49407
Reviewed-by: Jason Lowe-Power <[email protected]>
Maintainer: Jason Lowe-Power <[email protected]>
Tested-by: kokoro <[email protected]>
---
M src/SConscript
1 file changed, 19 insertions(+), 1 deletion(-)
Approvals:
Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved
kokoro: Regressions pass
diff --git a/src/SConscript b/src/SConscript
index 9cbfbdf..c514fc7 100644
--- a/src/SConscript
+++ b/src/SConscript
@@ -594,12 +594,13 @@
importer = M5MetaPathFinder(PySource.modules)
sys.meta_path[0:0] = [ importer ]
+import_globals = globals().copy()
# import all sim objects so we can populate the all_objects list
# make sure that we're working with a list, then let's sort it
gem5_lib_simobjects = SimObject.all.with_tag(env, 'gem5 lib')
gem5_lib_modnames = sorted(map(lambda so: so.modname, gem5_lib_simobjects))
for modname in gem5_lib_modnames:
- exec('from m5.objects import %s' % modname)
+ exec('from m5.objects import %s' % modname, import_globals)
# we need to unload all of the currently imported modules so that they
# will be re-imported the next time the sconscript is run
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/49407
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: I689d693d93cc8998be0967ec2b0c58f5851d39cf
Gerrit-Change-Number: 49407
Gerrit-PatchSet: 31
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s