Skip to content

Conversation

@Flamefire
Copy link
Contributor

@Flamefire Flamefire commented Nov 14, 2025

(created using eb --new-pr)

This improves debugging issues/crashes as it not only includes the location of the error but also the backtrace.
This is especially useful for very generic errors like the template-resolving failure where it would be important to know where exactly it failed to resolve and not the location of the error (inside the resolve function)

The log now looks like this:

== 2025-11-14 17:17:03,179 build_log.py:226 ERROR EasyBuild encountered an error (at easybuild/base/exceptions.py:140 in __init__): get_software_root software root for M4 was not found in environment (at easybuild/tools/toolchain/toolchain.py:443 in _get_software_root)
Callstack: 
        easybuild/tools/toolchain/toolchain.py:443 in _get_software_root
        easybuild/tools/toolchain/toolchain.py:435 in _get_software_multiple
        easybuild/tools/toolchain/toolchain.py:423 in get_software_root
        easybuild/tools/toolchain/toolchain.py:1153 in _add_dependency_variables
        easybuild/tools/toolchain/toolchain.py:899 in prepare
        easybuild/framework/easyblock.py:2988 in prepare_step
        easybuild/easyblocks/generic/cargo.py:468 in prepare_step
        easybuild/framework/easyblock.py:4753 in run_step
        easybuild/framework/easyblock.py:4912 in run_all_steps
        easybuild/framework/easyblock.py:5099 in build_and_install_one
        easybuild/main.py:163 in build_and_install_software
        easybuild/main.py:596 in process_eb_args
        easybuild/main.py:780 in main
        easybuild/main.py:829 in main_with_hooks
        easybuild/main.py:843 in <module>

"Callstack" because the most recent call is at the top

@boegel
Copy link
Member

boegel commented Nov 19, 2025

@Flamefire Is there any reasonable way we can come up with a test that verifies that this is working as intended?

`caller_info` will return the direct caller which is not useful in this case
as every log will look like:

>  build_log.py:226 ERROR EasyBuild encountered an error (at easybuild/base/exceptions.py:126 in __init__): [...]
@Flamefire Flamefire force-pushed the 20251114172150_new_pr_YMYMOpxEbY branch from 9f0f935 to 91252e1 Compare November 20, 2025 12:27
@Flamefire
Copy link
Contributor Author

A bit tricky because the call stack is limitted to things from the easybuild package and the test is a separate package.

But found something reasonable.

Don't mind the force-push, I only had to fixup the 2nd-last of the new commit. It is still only the 4 commits added since your last review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants