Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inject custom '%(python)s' template value before getting value of 'buildcmd' custom easyconfig parameter in PythonPackage easyblock #3539

Merged

Conversation

boegel
Copy link
Member

@boegel boegel commented Dec 19, 2024

Fix for crash when installing PySide2-5.14.2.3-GCCcore-10.2.0.eb:

Traceback (most recent call last):
  File "/usr/lib64/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib64/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/user/gent/400/vsc40023/easybuild/eb5/easybuild-framework/easybuild/main.py", line 801, in <module>
    main_with_hooks()
  File "/user/gent/400/vsc40023/easybuild/eb5/easybuild-framework/easybuild/main.py", line 787, in main_with_hooks
    main(args=args, prepared_cfg_data=(init_session_state, eb_go, cfg_settings))
  File "/user/gent/400/vsc40023/easybuild/eb5/easybuild-framework/easybuild/main.py", line 743, in main
    hooks, do_build)
  File "/user/gent/400/vsc40023/easybuild/eb5/easybuild-framework/easybuild/main.py", line 567, in process_eb_args
    exit_on_failure=exit_on_failure)
  File "/user/gent/400/vsc40023/easybuild/eb5/easybuild-framework/easybuild/main.py", line 175, in build_and_install_software
    raise ec_res['err']
  File "/user/gent/400/vsc40023/easybuild/eb5/easybuild-framework/easybuild/main.py", line 136, in build_and_install_software
    (ec_res['success'], app_log, err_msg, err_code) = build_and_install_one(ec, init_env)
  File "/user/gent/400/vsc40023/easybuild/eb5/easybuild-framework/easybuild/framework/easyblock.py", line 4461, in build_and_install_one
    result = app.run_all_steps(run_test_cases=run_test_cases)
  File "/user/gent/400/vsc40023/easybuild/eb5/easybuild-framework/easybuild/framework/easyblock.py", line 4329, in run_all_steps
    self.run_step(step_name, step_methods)
  File "/user/gent/400/vsc40023/easybuild/eb5/easybuild-framework/easybuild/framework/easyblock.py", line 4172, in run_step
    step_method(self)()
  File "/user/gent/400/vsc40023/easybuild/eb5/easybuild-easyblocks/easybuild/easyblocks/generic/pythonpackage.py", line 835, in build_step
    build_cmd = build_cmd % {'python': self.python_cmd}
KeyError: 'parallel'

The tricky thing here is that while the buildcmd value may contain general template values (like %(parallel)s), there's also this custom %(python)s that is used locally here in PythonPackage.build_step.
The only proper way of correctly handling any possible combination of these cases at this point is by injecting the value for the %(python)s template in the dictionary of template values (which shouldn't cause trouble anywhere).

…ildcmd' custom easyconfig parameter in PythonPackage easyblock
@boegel
Copy link
Member Author

boegel commented Dec 19, 2024

Test report by @boegel

Overview of tested easyconfigs (in order)

  • SUCCESS PySide2-5.14.2.3-GCCcore-10.2.0.eb

Build succeeded for 1 out of 1 (1 easyconfigs in total)
node3509.doduo.os - Linux RHEL 8.8, x86_64, AMD EPYC 7552 48-Core Processor, Python 3.6.8
See https://gist.github.com/boegel/079c47d10614bf1af84493aec01f6ed3 for a full test report.

Copy link
Contributor

@lexming lexming left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lexming lexming merged commit 90c14fe into easybuilders:5.0.x Dec 19, 2024
19 checks passed
@boegel
Copy link
Member Author

boegel commented Dec 19, 2024

Test report by @boegel

Overview of tested easyconfigs (in order)

  • SUCCESS PySide2-5.14.2.3-GCCcore-10.2.0.eb

Build succeeded for 1 out of 1 (1 easyconfigs in total)
node3509.doduo.os - Linux RHEL 8.8, x86_64, AMD EPYC 7552 48-Core Processor, Python 3.6.8
See https://gist.github.com/boegel/5f57495c82101a4afcafe64683cde4ba for a full test report.

@boegel boegel deleted the pythonpackage_fix_builcmd_python_template branch December 20, 2024 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Breaking changes
Development

Successfully merging this pull request may close these issues.

2 participants