add generic ModuleRC easyblock#1503
Conversation
|
I should mention that this doesn't require any changes to EasyBuild framework, strictly speaking... The aliased module is seen by EasyBuild thanks to the fallback to The hardcoding of the contents of |
|
The tests only fail with EnvironmentModulesC 3.2.10, looks like there was a weird bug with @xdelaruelle Any ideas what's going on here? In this case, there's only a singe Then how can it trigger a |
|
OK, the problem was probably that there was an actual module file That should be fixed now by user different versions for the |
|
@boegel It seems that |
|
@xdelaruelle The problem was that there was both a |
…_step in ModuleAlias generic easyblock
| from easybuild.tools.build_log import EasyBuildError | ||
| from easybuild.tools.config import build_option | ||
| from easybuild.tools.filetools import write_file | ||
| from easybuild.tools.module_generator import ModuleGeneratorTcl |
There was a problem hiding this comment.
'easybuild.tools.module_generator.ModuleGeneratorTcl' imported but unused
| if self.name != deps[0]['name']: | ||
| raise EasyBuildError("Name does not match dependency name: %s vs %s", self.name, deps[0]['name']) | ||
|
|
||
| # version to prefix of version to alias to |
There was a problem hiding this comment.
Awful lot of tos there...not sure what you mean, is it
# ensure version to alias to is a prefix match for the version of the dependency
There was a problem hiding this comment.
Yes, exactly that, and you're right, the comment that was there didn't make any sense, it should have been something like # version is prefix of version to alias to, but yours is better :)
There was a problem hiding this comment.
Yes, exactly that, and you're right, the comment that was there didn't make any sense, it should have been something like # version is prefix of version to alias to, but yours is better :)
| modfile_path = self.module_generator.get_module_filepath(fake=fake) | ||
| modulerc = os.path.join(os.path.dirname(modfile_path), '.modulerc') | ||
|
|
||
| if os.path.exists(modulerc) and not build_option('force'): |
There was a problem hiding this comment.
This implies that you can only have one entry in the .modulerc per software package. Probably ok, but worth noting the limitation
There was a problem hiding this comment.
Indeed, that's a rather strict limitation for now, which we can review later when the need for it pops up?
A whole bunch of questions come into play to relax this:
- What do we do with an existing
.modulercthat was not created by EasyBuild? - How do we allow both appending to an existing
.modulercand overwriting the existing one (from theebcommand line, I don't think specifying this in the easyconfig makes much sense)? - Should we detect potentially conflicting lines in an existing
.modulerc?
There was a problem hiding this comment.
Indeed, that's a rather strict limitation for now, which we can review later when the need for it pops up?
A whole bunch of questions come into play to relax this:
- What do we do with an existing
.modulercthat was not created by EasyBuild? - How do we allow both appending to an existing
.modulercand overwriting the existing one (from theebcommand line, I don't think specifying this in the easyconfig makes much sense)? - Should we detect potentially conflicting lines in an existing
.modulerc?
This is a new generic easyblock that generates a
.modulercfile to define a module version alias rather than installing an actual module file (cfr. suggestion by @mboisson in easybuilders/easybuild-easyconfigs#5203 (comment)).This can be used to for example install a
Java/1.8wrapper (see easybuilders/easybuild-easyconfigs#6712) for anotherJavamodule, without causing trouble with for example Lmod's module collection concept...edit: now requires
easybuilders/easybuild-framework#2571andeasybuilders/easybuild-framework#2575