|
87 | 87 | from easybuild.tools.hooks import MODULE_STEP, MODULE_WRITE, PACKAGE_STEP, PATCH_STEP, PERMISSIONS_STEP, POSTITER_STEP |
88 | 88 | from easybuild.tools.hooks import POSTPROC_STEP, PREPARE_STEP, READY_STEP, SANITYCHECK_STEP, SOURCE_STEP |
89 | 89 | from easybuild.tools.hooks import SINGLE_EXTENSION, TEST_STEP, TESTCASES_STEP, load_hooks, run_hook |
90 | | -from easybuild.tools.run import check_async_cmd, run_cmd |
| 90 | +from easybuild.tools.run import RunShellCmdError, check_async_cmd, print_run_shell_cmd_error, run_cmd |
91 | 91 | from easybuild.tools.jenkins import write_to_xml |
92 | 92 | from easybuild.tools.module_generator import ModuleGeneratorLua, ModuleGeneratorTcl, module_generator, dependencies_for |
93 | 93 | from easybuild.tools.module_naming_scheme.utilities import det_full_ec_version |
@@ -4124,6 +4124,11 @@ def run_all_steps(self, run_test_cases): |
4124 | 4124 | start_time = datetime.now() |
4125 | 4125 | try: |
4126 | 4126 | self.run_step(step_name, step_methods) |
| 4127 | + except RunShellCmdError as err: |
| 4128 | + print_run_shell_cmd_error(err) |
| 4129 | + ec_path = os.path.basename(self.cfg.path) |
| 4130 | + error_msg = f"shell command '{err.cmd_name} ...' failed in {step_name} step for {ec_path}" |
| 4131 | + raise EasyBuildError(error_msg) |
4127 | 4132 | finally: |
4128 | 4133 | if not self.dry_run: |
4129 | 4134 | step_duration = datetime.now() - start_time |
@@ -4225,7 +4230,7 @@ def build_and_install_one(ecdict, init_env): |
4225 | 4230 | app.cfg['skip'] = skip |
4226 | 4231 |
|
4227 | 4232 | # build easyconfig |
4228 | | - errormsg = '(no error)' |
| 4233 | + error_msg = '(no error)' |
4229 | 4234 | # timing info |
4230 | 4235 | start_time = time.time() |
4231 | 4236 | try: |
@@ -4263,9 +4268,7 @@ def build_and_install_one(ecdict, init_env): |
4263 | 4268 | adjust_permissions(app.installdir, stat.S_IWUSR, add=False, recursive=True) |
4264 | 4269 |
|
4265 | 4270 | except EasyBuildError as err: |
4266 | | - first_n = 300 |
4267 | | - errormsg = "build failed (first %d chars): %s" % (first_n, err.msg[:first_n]) |
4268 | | - _log.warning(errormsg) |
| 4271 | + error_msg = err.msg |
4269 | 4272 | result = False |
4270 | 4273 |
|
4271 | 4274 | ended = 'ended' |
@@ -4387,11 +4390,7 @@ def ensure_writable_log_dir(log_dir): |
4387 | 4390 | # build failed |
4388 | 4391 | success = False |
4389 | 4392 | summary = 'FAILED' |
4390 | | - |
4391 | | - build_dir = '' |
4392 | | - if app.builddir: |
4393 | | - build_dir = " (build directory: %s)" % (app.builddir) |
4394 | | - succ = "unsuccessfully%s: %s" % (build_dir, errormsg) |
| 4393 | + succ = "unsuccessfully: " + error_msg |
4395 | 4394 |
|
4396 | 4395 | # cleanup logs |
4397 | 4396 | app.close_log() |
@@ -4424,7 +4423,7 @@ def ensure_writable_log_dir(log_dir): |
4424 | 4423 |
|
4425 | 4424 | del app |
4426 | 4425 |
|
4427 | | - return (success, application_log, errormsg) |
| 4426 | + return (success, application_log, error_msg) |
4428 | 4427 |
|
4429 | 4428 |
|
4430 | 4429 | def copy_easyblocks_for_reprod(easyblock_instances, reprod_dir): |
|
0 commit comments