easybuild-framework icon indicating copy to clipboard operation
easybuild-framework copied to clipboard

Don't log variables (un)set when cleaning up fake module

Open Flamefire opened this issue 5 months ago • 0 comments

Unloading a module (and its dependencies) changes a massive amount of variables. As the changes done by unloading the fake module aren't really relevant for the remaining build (it is usually done at the end) do not log them.

This avoids filling up the part of the log uploaded with test reports with irrelevant information.

Example: https://gist.github.com/Flamefire/afae1a8e2b18a4bc2786f539d5f439d3

This change silences the output of the module unload <fake module> command by introducing an additional parameter to run_shell_command that suppresses output for successful commands.
Another parameter for the environment module allows to suppress output for each set variable, e.g.

== 2025-06-26 19:43:42,596 environment.py:93 INFO Environment variable EBEXTSLISTMPI4PY set to mpi4py-4.0.1 (previously undefined)

Closes #4937 (mostly, we might want to suppress output of all module commands or print them only in debug logs)

I think that unloading the fake module and removing the module path is not useful. The succeeding restore_env already undoes all changes done by loading the module.

Note that e.g. loading the fake module unsets many environment variables. E.g. CUDA_CACHE_DISABLE which the restore_env then sets again. So directly calling restore_env would already reduce the amount of changes done and hence reduce the number of log lines.
Why don't we do that?

Flamefire avatar Jun 27 '25 10:06 Flamefire