-
Notifications
You must be signed in to change notification settings - Fork 205
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
add support for specifying dependencies required to obtain source files via source_deps
easyconfig parameter
#4766
base: develop
Are you sure you want to change the base?
Conversation
When testing on
|
@PetrKralCZ How are you specifying |
source_deps = [
('git-lfs', '3.5.1', '', SYSTEM),
] |
We should make sure that entries in |
Fails with
In that case there's no real |
@@ -766,6 +766,14 @@ def remove_false_versions(deps): | |||
builddeps = [self._parse_dependency(dep, build_only=True) for dep in builddeps] | |||
self['builddependencies'] = remove_false_versions(builddeps) | |||
|
|||
sourcedeps = self['source_deps'] | |||
if sourcedeps and all(isinstance(x, (list, tuple)) for b in sourcedeps for x in b): | |||
self.iterate_options.append('source_deps') |
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.
source_deps
should not be an iterative parameter (see also https://docs.easybuild.io/writing-easyconfig-files/#configure_build_install_command_options_iterate)
self.iterate_options.append('source_deps') |
@@ -766,6 +766,14 @@ def remove_false_versions(deps): | |||
builddeps = [self._parse_dependency(dep, build_only=True) for dep in builddeps] | |||
self['builddependencies'] = remove_false_versions(builddeps) | |||
|
|||
sourcedeps = self['source_deps'] |
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.
@PetrKralCZ Let's avoid confusion and use source_deps
consistently (more changes needed below):
sourcedeps = self['source_deps'] | |
source_deps = self['source_deps'] |
if source_deps: | ||
pre_fetch_env = copy.deepcopy(os.environ) | ||
source_deps_mod_names = [d['short_mod_name'] for d in source_deps] | ||
self.modules_tool.load(source_deps_mod_names) |
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.
@PetrKralCZ Before trying to load modules, we need to take into account that self.modules_tool
may be a NoModulesTool
instance (that will be the case when eb --fetch
is used).
If so, then we need to re-initialize self.modules_tool
to a proper ModulesTool
instance (via the modules_tool
function available in tools/config.py
).
This will need changes in options.py
too though, because there we're now overwriting self.options.modules_tool
with None
, we also need to keep track of the original value so we can then pass it to the modules_tool
function (which will also need to be adjusted)...
# load modules for source dependencies (if any) | ||
if source_deps: | ||
pre_fetch_env = copy.deepcopy(os.environ) | ||
source_deps_mod_names = [d['short_mod_name'] for d in source_deps] |
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.
@PetrKralCZ short_mod_name
field is still None
at this point, which causes the crash in run_module
, so we're overlooking something when parsing dependencies I think...
source_deps
source_deps
easyconfig parameter
(created using
eb --new-pr
)