diff options
Diffstat (limited to 'lib/spack/spack/report.py')
-rw-r--r-- | lib/spack/spack/report.py | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/lib/spack/spack/report.py b/lib/spack/spack/report.py index 4685321bc8..83bb89e27f 100644 --- a/lib/spack/spack/report.py +++ b/lib/spack/spack/report.py @@ -151,6 +151,22 @@ class InfoCollector(object): 'installed_from_binary_cache': False } + # Append the package to the correct spec report. In some + # cases it may happen that a spec that is asked to be + # installed explicitly will also be installed as a + # dependency of another spec. In this case append to both + # spec reports. + for s in llnl.util.lang.dedupe([pkg.spec.root, pkg.spec]): + name = name_fmt.format(s.name, s.dag_hash(length=7)) + try: + item = next(( + x for x in self.specs + if x['name'] == name + )) + item['packages'].append(package) + except StopIteration: + pass + start_time = time.time() value = None try: @@ -170,6 +186,7 @@ class InfoCollector(object): package['stdout'] = fetch_log(pkg, do_fn, self.dir) package['stdout'] += package['message'] package['exception'] = e.traceback + raise except (Exception, BaseException) as e: # Everything else is an error (the installation @@ -178,26 +195,11 @@ class InfoCollector(object): package['stdout'] = fetch_log(pkg, do_fn, self.dir) package['message'] = str(e) or 'Unknown error' package['exception'] = traceback.format_exc() + raise finally: package['elapsed_time'] = time.time() - start_time - # Append the package to the correct spec report. In some - # cases it may happen that a spec that is asked to be - # installed explicitly will also be installed as a - # dependency of another spec. In this case append to both - # spec reports. - for s in llnl.util.lang.dedupe([pkg.spec.root, pkg.spec]): - name = name_fmt.format(s.name, s.dag_hash(length=7)) - try: - item = next(( - x for x in self.specs - if x['name'] == name - )) - item['packages'].append(package) - except StopIteration: - pass - return value return wrapper |