support for 'eb --trace' (REVIEW)#2285
Conversation
|
Example output in current state: |
…g to check value for 'trace' build option all the time
…ace + add more tests for run_cmd & run_cmd_qa
|
Example output with current implementation: |
|
|
||
| # trace output for sources & patches | ||
| if self.src: | ||
| trace_msg("sources:") |
There was a problem hiding this comment.
space behind sources:? (Same below)
There was a problem hiding this comment.
a wait, it's a new line, please ignore.
| if build_option('trace'): | ||
| _log.experimental("Using --trace") | ||
| if timestamp: | ||
| message += " [started at: %s]" % datetime.now().strftime('%Y-%m-%d %H:%M:%S') |
There was a problem hiding this comment.
Don't your normally put the time first and then the message?
There was a problem hiding this comment.
Yeah, I've tried both approaches, not happy with either (because of the >>). I'm open to suggestions.
I'm up for reformatting this, but we can do that later since --trace requires --experimental for now; I want to avoid this being blocked by a bike-shedding discussion and get it merged ASAP to be included in EB v3.4.0...
| """ | ||
| for patch in self.patches: | ||
| self.log.info("Applying patch %s" % patch['name']) | ||
| trace_msg("applying patch %s..." % patch['name']) |
There was a problem hiding this comment.
but here I would add a space after the dots.
There was a problem hiding this comment.
Why, each call to trace_msg prints a separate line, what's the use of having a space after ... if it's followed by a \n?
There was a problem hiding this comment.
I mean a seperate between the filename of the patch and the dots. Or why the dots at all?
There was a problem hiding this comment.
OK, so before the dots. ;-)
But yeah, just dropping the dots makes sense, will change.
| self.log.warning("Sanity check: %s" % self.sanity_check_fail_msgs[-1]) | ||
|
|
||
| cand_paths = ' or '.join(["'%s'" % x for x in xs]) | ||
| trace_msg("%s %s found: %s" % (typ, cand_paths, ('FAILED', 'OK')[found])) |
There was a problem hiding this comment.
Don't you want to print here first a line what you're about to print?
There was a problem hiding this comment.
that's done higher up, output looks like:
== sanity checking...
>> file 'bin/h52gif' found: OK
>> file 'bin/h5c++' found: OK
| else: | ||
| self.log.info("sanity check command %s ran successfully! (output: %s)" % (command, out)) | ||
|
|
||
| trace_msg("running command '%s'... %s" % (command, ('FAILED', 'OK')[ec == 0])) |
There was a problem hiding this comment.
I wouldn't to this here. Put such a thing inside run_cmd.
There was a problem hiding this comment.
I'm deliberately not using the standard trace message printed for run_cmd here because this is the sanity check; the output of the command doesn't matter here, just whether it exits with 0 (OK) or not (FAILED)
|
|
||
| import easybuild.tools.toolchain | ||
| from easybuild.tools.build_log import EasyBuildError, dry_run_msg | ||
| from easybuild.tools.build_log import EasyBuildError, dry_run_msg |
There was a problem hiding this comment.
Yeah, I should, but there's a lot of noise there too currently... Fixed, thx
| for dep_mod in run_dep_mods: | ||
| trace_msg(' * ' + dep_mod) | ||
| else: | ||
| trace_msg("(no build dependencies specified)") |
--trace/-Tcommand line optioneasyblock.py--trace--experimentalfor--tracefor now...--trace