Gabe Black has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/58353 )

Change subject: scons: Stop the fast model project file parser from writing files.
......................................................................

scons: Stop the fast model project file parser from writing files.

PLY tries to write these little files into the SCons installation
directory, which it shouldn't even if it was allowed to. This avoids
a bunch of annoying messages about not having enough permission.

Change-Id: Ifd4eda9dd9f8518b3fd075e8a46de1b6c12c2127
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/58353
Reviewed-by: Gabe Black <gabe.bl...@gmail.com>
Maintainer: Gabe Black <gabe.bl...@gmail.com>
Tested-by: kokoro <noreply+kok...@google.com>
Reviewed-by: Jui-min Lee <f...@google.com>
---
M SConstruct
M src/arch/arm/fastmodel/SConscript
2 files changed, 35 insertions(+), 0 deletions(-)

Approvals:
  Gabe Black: Looks good to me, approved; Looks good to me, approved
  Jui-min Lee: Looks good to me, approved
  kokoro: Regressions pass




diff --git a/SConstruct b/SConstruct
index 684cc8c..b170cf4 100755
--- a/SConstruct
+++ b/SConstruct
@@ -85,6 +85,9 @@
 from os.path import isdir, isfile
 from os.path import join, split

+import logging
+logging.basicConfig()
+
 # SCons imports
 import SCons
 import SCons.Node
diff --git a/src/arch/arm/fastmodel/SConscript b/src/arch/arm/fastmodel/SConscript
index a8734cd..5c4bbf9 100644
--- a/src/arch/arm/fastmodel/SConscript
+++ b/src/arch/arm/fastmodel/SConscript
@@ -36,6 +36,7 @@
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

 from itertools import cycle
+import logging
 import shlex

 Import('*')
@@ -147,6 +148,19 @@
 SourceLib('rt')

 class ProjectFileParser(Grammar):
+    def __init__(self):
+        self.log = logging.getLogger('fm_proj_ply')
+        if GetOption('verbose'):
+            self.log.setLevel(logging.DEBUG)
+
+        self.yacc_kwargs['write_tables'] = False
+
+        self.yacc_kwargs['debuglog'] = self.log
+        self.yacc_kwargs['errorlog'] = self.log
+
+        self.lex_kwargs['debuglog'] = self.log
+        self.lex_kwargs['errorlog'] = self.log
+
     class Param(object):
         def __init__(self, is_object):
             self.is_object = is_object

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/58353
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: Ifd4eda9dd9f8518b3fd075e8a46de1b6c12c2127
Gerrit-Change-Number: 58353
Gerrit-PatchSet: 3
Gerrit-Owner: Gabe Black <gabe.bl...@gmail.com>
Gerrit-Reviewer: Gabe Black <gabe.bl...@gmail.com>
Gerrit-Reviewer: Giacomo Travaglini <giacomo.travagl...@arm.com>
Gerrit-Reviewer: Jui-min Lee <f...@google.com>
Gerrit-Reviewer: Yu-hsin Wang <yuhsi...@google.com>
Gerrit-Reviewer: kokoro <noreply+kok...@google.com>
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

Reply via email to