Luming Wang has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/58369 )

Change subject: scons: fix build failed caused by Non-ASCII directory path
......................................................................

scons: fix build failed caused by Non-ASCII directory path

This path fix build failed when gem5's path contains Non-ASCII
characters.

build_tools/marshal.py embed "abspath" and "modpath" into the
generated c++ file. However, if either of them contains Non-ASCII
characters, marshal.py will throw an exception.

This can be fixed if we set a suitable $LANG for gem5py. For
example, we can simply set $LANG=en_US.UTF-8 in src/SConscript
to fix this.

This patch fixes this bug by passing the host's $LANG environment
variable to gem5py. Because for users who may use Non-ASCII
characters, their $LANG is generally set to their native language
(e.g. zh_CN.UTF-8, en_US.UTF-8, etc.), which contains Non-ASCII
characters. Also, it is more reasonable to use the host $LANG than
to directly hard-code the $LANG used by gem5py into a language
that supports non-ASCII characters.

Change-Id: Ia0343cbd6995af3a9e43bf217ad3f186d5633fed
---
M src/SConscript
1 file changed, 29 insertions(+), 0 deletions(-)



diff --git a/src/SConscript b/src/SConscript
index c1b00f0..b760dfe 100644
--- a/src/SConscript
+++ b/src/SConscript
@@ -87,6 +87,7 @@
 gem5py_m5 = gem5py_env.File('gem5py_m5')
 gem5py_env['GEM5PY'] = gem5py
 gem5py_env['GEM5PY_M5'] = gem5py_m5
+gem5py_env['ENV']['LANG'] = os.environ.get('LANG', 'en_US.UTF-8')
 gem5py_env['OBJSUFFIX'] = '.pyo'
 # Inject build_tools into PYTHONPATH for when we run gem5py.
 pythonpath = gem5py_env['ENV'].get('PYTHONPATH', '').split(':')

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/58369
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: Ia0343cbd6995af3a9e43bf217ad3f186d5633fed
Gerrit-Change-Number: 58369
Gerrit-PatchSet: 1
Gerrit-Owner: Luming Wang <wlm199...@126.com>
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

Reply via email to