diff options
author | Zack Galbreath <zack.galbreath@kitware.com> | 2018-04-19 15:20:48 -0400 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2018-05-15 05:43:07 -0700 |
commit | ae0ba373b8dea2350a8845a15a47f837b9152d2c (patch) | |
tree | 13178fac9233624c47532168d029d48b05ff1ba6 /lib | |
parent | d7581697a53f7b7f4bb7abadc37abf0dfa924ea1 (diff) | |
download | spack-ae0ba373b8dea2350a8845a15a47f837b9152d2c.tar.gz spack-ae0ba373b8dea2350a8845a15a47f837b9152d2c.tar.bz2 spack-ae0ba373b8dea2350a8845a15a47f837b9152d2c.tar.xz spack-ae0ba373b8dea2350a8845a15a47f837b9152d2c.zip |
CDash report for concretization errors
Capture any concretization errors and record them in a CTest Update.xml file.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/cmd/install.py | 7 | ||||
-rw-r--r-- | lib/spack/spack/report.py | 18 |
2 files changed, 24 insertions, 1 deletions
diff --git a/lib/spack/spack/cmd/install.py b/lib/spack/spack/cmd/install.py index 81f84dd1a2..71e5ea38ef 100644 --- a/lib/spack/spack/cmd/install.py +++ b/lib/spack/spack/cmd/install.py @@ -36,6 +36,7 @@ import spack.cmd import spack.cmd.common.arguments as arguments import spack.fetch_strategy import spack.report +from spack.error import SpackError description = "build and install packages" @@ -203,7 +204,11 @@ def install(parser, args, **kwargs): for spec in specs: spack.package_testing.test(spec.name) - specs = spack.cmd.parse_specs(args.package, concretize=True) + try: + specs = spack.cmd.parse_specs(args.package, concretize=True) + except SpackError as e: + reporter.concretization_report(e.message) + raise # 2. Concrete specs from yaml files for file in args.specfiles: diff --git a/lib/spack/spack/report.py b/lib/spack/spack/report.py index 404799604a..01d4e25611 100644 --- a/lib/spack/spack/report.py +++ b/lib/spack/spack/report.py @@ -360,6 +360,24 @@ class collect_info(object): t = env.get_template(phase_template) f.write(t.render(report_data)) + def concretization_report(self, msg): + if not self.format_name == 'cdash': + return + + report_data = {} + report_data['starttime'] = self.starttime + report_data['endtime'] = self.starttime + self.cdash_initialize_report(report_data) + + report_data['msg'] = msg + env = spack.tengine.make_environment() + update_template = os.path.join(templates[self.format_name], + 'Update.xml') + t = env.get_template(update_template) + output_filename = os.path.join(self.filename, 'Update.xml') + with open(output_filename, 'w') as f: + f.write(t.render(report_data)) + def __exit__(self, exc_type, exc_val, exc_tb): if self.format_name: # Close the collector and restore the |