Split 'module' into multiple commands#7098
Conversation
7c5d756 to
b8ab3e6
Compare
b8ab3e6 to
2fde417
Compare
2fde417 to
54cdb8a
Compare
54cdb8a to
4b791ef
Compare
4b791ef to
623acef
Compare
2e349a5 to
87ccb12
Compare
ffd13eb to
ade16fc
Compare
ade16fc to
07629b5
Compare
|
@tgamblin @adamjstewart Do you have time to look at this PR? Despite the lot of lines changed, the PR only restructures the module command so that: $ spack module <subcommand> -m <module_type> ...becomes: $ spack <module_type> <subcommand> ...and adds a new feature specific to lmod: $ spack lmod setdefaultThe rationale is to differentiate the commands so that we could map features that are specific to each module type in a more natural manner. |
|
I've never used |
e8b7a6d to
c011b96
Compare
b3c8685 to
c90c7e6
Compare
ax3l
left a comment
There was a problem hiding this comment.
Just from reviewing the UI, it works great for me! Thank you so much!
Solves both the proper error on load of missing packages as well as loading only one package.
|
Not sure if I'll get to it today, but I'll try to have tested this by the end of tomorrow |
|
Couple of things that I found (but I'm not sure whether I'm at fault or the current implementation): Doing while the other two ( I expected to have e.g. the On a more high level note: I think we should rearrange the help now, currently there is this section: The module systems should be somehow group, shouldn't they? |
'spack module' has been split into multiple commands, each one tied to a specific module type. This permits the specialization of the new commands with features that are module type specific (e.g. set the default module file in lmod when multiple versions of the same package are installed at the same time).
Added a subcommand that sets the default module to be loaded, if multiple installations of the same package are present.
This just because the fixture has been moved one level above the one it was originally defined. In this more general context there's more than one configuration file that could be patched for tests.
fixes spack#4400 The feature requested in spack#4400 was already part of the module file configuration, but it was neither tested nor documented. This commit takes care of adding a few lines in the documentation and a regression test.
This reverts commit 732c24f.
fixes spack#2215 fixes spack#2570 fixes spack#6676 fixes spack#7281 closes spack#3827 This PR reverts the use of `spack module loads` in favor of `spack module find` when loading module files via Spack. After this PR `spack load` will accept a single spec at a time, and will be able to interpret correctly the `--dependencies` option.
As requested in the review all the commands meant to manage module files have been grouped under the `spack module` command. Unit tests have been refactored to match the new command structure.
bb7a505 to
a9886b7
Compare
This comment has been minimized.
This comment has been minimized.
|
@tgamblin I uploaded |
|
Can we tweak this slightly: $ spack module refresh --delete-tree -m tcl -m lmod -y cmake lmod ^python
==> Error: deprecated command. Try to use:
$ spack module tcl refresh --delete-tree -y cmake lmod ^python
$ spack module lmod refresh --delete-tree -y cmake lmod ^python
instead.to look at the We should either say it's moved (if it's broken) or warn and do the old thing until we finally remove it (if it's deprecated) |
In case a deprecated form of the module command is used, the program will exit non-zero and print an informative error message suggesting which command should be used instead.
a9886b7 to
4d5a985
Compare
|
@tgamblin Latest commit $ spack module refresh --delete-tree -m tcl -m lmod -y cmake lmod ^python
==> Error: `spack module refresh -m tcl -m lmod ...` has been moved. Try this instead:
$ spack module tcl refresh --delete-tree -y cmake lmod ^python
$ spack module lmod refresh --delete-tree -y cmake lmod ^python
|
| fi ;; | ||
| "load") | ||
| if _sp_full_spec=$(command spack $_sp_flags module loads --input-only $_sp_subcommand_args --module-type tcl "${_sp_spec[@]}"); then | ||
| if _sp_full_spec=$(command spack $_sp_flags module tcl find $_sp_subcommand_args "${_sp_spec[@]}"); then |
There was a problem hiding this comment.
@alalazo: doesn't this and the rest of d4b4be4 get rid of the loading of dependencies? Is this PR a decent place to fix that or is this something you want to save for later? I can't find the PR where we recently discussed this, but I do think the default module scheme should load transitive run dependencies by default.
@michaelkuhn: can you comment on this PR?
There was a problem hiding this comment.
This keeps the existing behavior, that is, spack load spec only loads spec and spack load -r spec loads spec and all of its dependencies.
I agree that autoloading (at least) the run dependencies by default makes sense. I have been using autoload: 'all' for quite some time for our installation since users kept forgetting to use -r. Maybe a new autoload option would make sense for this?
There was a problem hiding this comment.
Is this PR a decent place to fix that or is this something you want to save for later?
If it is fine with you I'd save this for a later (and smaller) PR. In any case I plan to continue working on module issues in the next couple of weeks.
|
I think the only thing this needs is more tests! |
|
It looks like |
The commands have been deprecated in spack#7098, and have been failing with an error message since then. Cleaning the code since it is unlikely that somebody is still using them.
The commands have been deprecated in #7098, and have been failing with an error message since then. Cleaning the code since it is unlikely that somebody is still using them.
fixes #2215
fixes #2570
fixes #4400
fixes #6676
fixes #7281
fixes #8646
closes #3827
Summary
has been turned into multiple
commands, each one tied to a specific module type. This permits the specialization of the new commands with features that are module type specific.
A few known bugs have been fixed in the process.
List of modifications
spack modulecommandspack loadfails for any reason--dependenciesoption tospack help loadspack modulecommandExample: specify a default module to be loaded for lmod
As an example the possibility to specify a default module to be loaded for
lmodhas been implemented: