-
Notifications
You must be signed in to change notification settings - Fork 204
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
refactor generation of required environment variables in module files + deprecate make_module_req_guess
method in EasyBlock
class
#4653
base: 5.0.x
Are you sure you want to change the base?
Conversation
@boegel look all the beautiful green tests! Compared to what I showed on the meeting yesterday, I have undone all changes to This seems ready on my side. I tested it with several easyblocks that add custom stuff to |
…d_module_search_path
…nment variables for module files
…r modules on load
…ed library directories
…ding paths for environment of modules
…er explicit checks in the module step
…vironmentVariable
easybuild/tools/modules.py
Outdated
|
||
|
||
# singleton metaclass: only one instance is created | ||
BaseModuleEnvironment = create_base_metaclass('BaseModuleEnvironment', Singleton, object) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lexming Using a singleton here (so a single instance that is shared across all EasyBlock
instances) seems like a bad idea to me...
If EasyBuild installs two things in the same session (via --robot
, or by being fed multiple easyconfigs on the command line), you'll end up with incorrect stuff in the generated module file due to this, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…file of subsequent installations
add test to verify that environment variables don't leak into module file of subsequent installations
@lexming Can you look into fixing the merge conflict, and get the test to pass? |
make_module_req_guess
method in EasyBlock
class
Goal is to lay groundwork to be able to fix #3331 and add new option to control which search path variables are added in modules by simplifying the code injecting environment variables to module files.
This PR should not alter the resulting module files to what is currently generated by EB. If it changes the list of environment variables it should have no effect (e.g. because those paths are empty).
Simplification of logic handling environment variables for module files:
(fixes directories that don't contain any library files shouldn't be added to
$LD_LIBRARY_PATH
#3504)top_level_file
attribute ofModuleEnvironmentVariable
lib64
that generate duplicate paths and need explicit exceptions with:lib64
are always ignored iflib64
is a symlink tolib
lib
are always ignored iflib
is a symlink tolib64
lib32
from list of library search pathsChangelog:
ModuleEnvironmentVariable
pseudo-dataclass toeasybuild.tools.modules
to hold definitions of environment variables for modulesModuleLoadEnvironment
singleton class toeasybuild.tools.modules
to hold environment definition for modules on loadEasyBlock.make_module_req_guess
in favor ofModuleLoadEnvironment
easybuild.framework.easyblock
to define possible linkage states of lib directoriesinstall_lib_symlink
attribute to EasyBlcok to keep track of symlink status between lib dirseasybuild.tools.config
that define known directories for binaries, libraries and headerseasyblock.make_module_req
by working with absolute paths instead