Bugfix: allow missing modules if they are blacklisted#13540
Bugfix: allow missing modules if they are blacklisted#13540tgamblin merged 10 commits intospack:developfrom
Conversation
…error); also skip local modules if they are blacklisted
|
@tgamblin this should add tests (e.g. for |
tgamblin
left a comment
There was a problem hiding this comment.
@scheibelp: LGTM, though I think it would be good if @alalazo also took a look.
My only request is more tests before we merge this.
…form the test with lmod for the module command test; for now I'm doing the latter because it's easier
tgamblin
left a comment
There was a problem hiding this comment.
@scheibelp: One minor change request: use return None instead of return for functions that are meant to return a value.
And one larger question that @becker33 made me think of: I am not sure these should just be debug messages. I suspect that if a user is using spack env loads, they will want to know that the behavior will be different from spack env activate for the same environment -- specifically that some packages will be omitted. My personal opinion on this is that the user should just activate the environment and not bother with modules in the first place, but I think with blacklisting it's not entirely intuitive.
How much work would it be to:
- Add commented lines to the
loadsfile for each blacklisted module that would have otherwise been loaded. - Emit one warning after
spack env loads-- something like "modules for some packages do not exist due to blacklisting -- see<file>for details, and consider usingspack env activate".
I think this is better behavior than (mostly) silently logging the missing modules.
…dules are omitted (blacklisted or missing from upstream); update 'module loads' output to explicitly mention missing modules in a comment
|
@tgamblin changes are now addressed:
|
tgamblin
left a comment
There was a problem hiding this comment.
@scheibelp: Looks great to me! I think this will help people understand when/which modules are not present.
`spack module loads` and `spack module find` previously failed if any upstream modules were missing. This prevented it from being used with upstreams (or, really, any spack instance) that blacklisted modules. This PR makes module finding is now more lenient (especially for blacklisted modules). - `spack module find` now does not report an error if the spec is blacklisted - instead, it prints a single warning if any modules will be omitted from the loads file - It comments the missing modules out of the loads file so the user can see what's missing - Debug messages are also printed so users can check this with `spack -d...` - also added tests for new functionality
v0.13.2 This release contains major performance improvements for Spack environments, as well as some bugfixes and minor changes. * allow missing modules if they are blacklisted (#13540) * speed up environment activation (#13557) * mirror path works for unknown versions (#13626) * environments: don't try to modify run-env if a spec is not installed (#13589) * use semicolons instead of newlines in module/python command (#13904) * verify.py: os.path.exists exception handling (#13656) * Document use of the maintainers field (#13479) * bugfix with config caching (#13755) * hwloc: added 'master' version pointing at the HEAD of the master branch (#13734) * config option to allow gpg warning suppression (#13744) * fix for relative symlinks when relocating binary packages (#13727) * allow binary relocation of strings in relative binaries (#13724)
v0.13.2 This release contains major performance improvements for Spack environments, as well as some bugfixes and minor changes. * allow missing modules if they are blacklisted (#13540) * speed up environment activation (#13557) * mirror path works for unknown versions (#13626) * environments: don't try to modify run-env if a spec is not installed (#13589) * use semicolons instead of newlines in module/python command (#13904) * verify.py: os.path.exists exception handling (#13656) * Document use of the maintainers field (#13479) * bugfix with config caching (#13755) * hwloc: added 'master' version pointing at the HEAD of the master branch (#13734) * config option to allow gpg warning suppression (#13744) * fix for relative symlinks when relocating binary packages (#13727) * allow binary relocation of strings in relative binaries (#13724)
`spack module loads` and `spack module find` previously failed if any upstream modules were missing. This prevented it from being used with upstreams (or, really, any spack instance) that blacklisted modules. This PR makes module finding is now more lenient (especially for blacklisted modules). - `spack module find` now does not report an error if the spec is blacklisted - instead, it prints a single warning if any modules will be omitted from the loads file - It comments the missing modules out of the loads file so the user can see what's missing - Debug messages are also printed so users can check this with `spack -d...` - also added tests for new functionality
Fixes #13346.
For
spack module loadsandspack module find, allow missing upstream modules (print a debug message vs. raising an error); also skip local modules if they are blacklisted.Old behavior:
spack module findwill report an error if the root spec's module or any dependency module does not exist (regardless of whether it is blacklisted)spack module loadsworks the sameNew behavior: the short version is that the module finding is now more lenient (especially for blacklisted modules):
spack module findwill report an error if the root spec's module does not exist, unlessspack -d...spack module find) a message will not be reported (it's an error if the module is not blacklisted, but if it is blacklisted, the module is silently skipped)spack module loadsworks exactly the same way as the newspack module find, but informational messages are not generated for blacklisted packages