Hello Giacomo Travaglini,
I'd like you to do a code review. Please visit
https://gem5-review.googlesource.com/c/public/gem5/+/29614
to review the following change.
Change subject: misc: Run cpt_upgrader using the same Python interpreter as
Scons
......................................................................
misc: Run cpt_upgrader using the same Python interpreter as Scons
This fixes a potentially broken build for Ubuntu 20.04.
An Ubuntu 20.04 system only has Python 3 installed, linked by the
command 'python3'. There is no 'python' symlink on the path.
Python 2 is not installed by default, but if it is installed
manually (e.g. by following the current instructions in 'Learning
gem5') it will use the 'python' symlink to point to Python 2.
Therefore, the symlink 'python' is normally either not present, or
points to Python 2.
In this state, a gem5 build will fail on util/cpt_upgrader.py due to
the missing 'python' specified in the shebang line, or the missing
Python 2 'six' package.
On other systems the command 'python' may link to Python 3, and the
'python3' commmand may or may not be present.
This patch fixes the problem by running cpt_upgrader.py using the same
Python interpreter that is running the Scons build.
Tested on an upgraded Ubuntu 20.04 system, a fresh Ubuntu 20.04 LXD
container, and Ubuntu 18.04.
Change-Id: Ib9dd451e2cd7565853a3f36eedbcb2c10caa6e9f
Reviewed-by: Giacomo Travaglini <[email protected]>
---
M src/SConscript
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/SConscript b/src/SConscript
index 7cd628a..5cc1fc2 100644
--- a/src/SConscript
+++ b/src/SConscript
@@ -1131,9 +1131,13 @@
Source('debug/flags.cc')
# version tags
+python_executable = (sys.executable
+ if os.path.exists(sys.executable)
+ else "python")
tags = \
env.Command('sim/tags.cc', None,
- MakeAction('util/cpt_upgrader.py --get-cc-file > $TARGET',
+ MakeAction('{} util/cpt_upgrader.py --get-cc-file > $TARGET'
+ .format(python_executable),
Transform("VER TAGS")))
env.AlwaysBuild(tags)
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/29614
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: Ib9dd451e2cd7565853a3f36eedbcb2c10caa6e9f
Gerrit-Change-Number: 29614
Gerrit-PatchSet: 1
Gerrit-Owner: Richard Cooper <[email protected]>
Gerrit-Reviewer: Giacomo Travaglini <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s