scons: show sources and targets when building.
Review Request #366 - Created Jan. 3, 2011 and submitted
| Information | |
|---|---|
| Steve Reinhardt | |
| gem5 | |
| Reviewers | |
| Default | |
| ali, gblack, nate, stever | |
scons: show sources and targets when building. I like the brevity of Ali's recent change, but the ambiguity of sometimes showing the source and sometimes the target is a little confusing. This patch makes scons typically list all sources and all targets for each action, with the common path prefix factored out for brevity. It's a little more verbose now but also more informative.
quick regressions pass
Screenshots
I think we talked about this and I'm ok with what we ended up on the mailing list... Bonus points if you colorize the output :)... Blue = '\033[94m' Yellow = '\033[94m' Green = '\033[92m' End = '\0330m' CCCOMSTR = Blue + ' [ CC] ' + Yellow + '$TRANSFORMATION' + End
Review request changed
Updated (Jan. 6, 2011, 3:04 a.m.)
Description: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 3 (+135 -37) |
Review request changed
Updated (Jan. 6, 2011, 3:15 a.m.)
Change Summary:
Added a screenshot to show color scheme.
We've beaten this to death, so I don't care about any of my comments enough to hold you up if you don't want to deal with them at all.
-
SConstruct (Diff revision 3) -
Can you derive from object? I really hate classic classes as they make various things annoying and the cause is not always obvious.
-
SConstruct (Diff revision 3) -
I hate lines like this. I'll register my annoyance, but won't continue further discussion.
-
SConstruct (Diff revision 3) -
This is probably pedantic, but these could be @classmethod (and self should be cls)
-
SConstruct (Diff revision 3) -
99 seems like a lot and goes against the idea of being concise. I don't care much though. Would anyone object to [%-8s] instead? the right justified seems odd.
-
SConstruct (Diff revision 3) -
out of curiosity, can you do the following instead? main['CCCOMSTR'] = TRANSFORM("CC") Certainly, I am pretty sure that the parameter to MakeAction/Action could be the callable and not the string. (String substitution just slows down SCons)
Posted (Jan. 6, 2011, 4:45 a.m.)
-
SConstruct (Diff revision 3) -
Wow, we're having fun with this bikeshed, no? Which color is it? (Feel free to ignore me at any time) if use_colors: try: from curses import setupterm, tigetstr, tparm setupterm() setaf = tigetstr('setaf') except: use_colors = False if not use_colors: def tparm(*args): return '' Blue = tparm(setaf, 4) Yellow = tparm(setaf, 3) Bold = tparm(tigetstr('bold')) Normal = tparm(tigetstr('sgr0')) # all specific color settings should be here and nowhere else tool_color = Blue pfx_color = Yellow srcs_color = Yellow + Bold arrow_color = Blue + Bold tgts_color = Yellow + Bold Seems to me that Arrow and the various color functions are overkill. (and the self.tool = self.color(...) seems like that should be self.tool = tool and the final line of Transform should be: return ' [%8s] %s %s %s' % (self.tool_color + self.tool, self.srcs_color + fmt(srcs), self.arrow_color + '->', self.tgts_color + fmt(tgts)) + self.Normal -
SConstruct (Diff revision 3) -
Yeah, I was just wondering if we wanted to limit to say 5 otherwise, but no big deal.
-
SConstruct (Diff revision 3) -
Oops, that's what I meant.
