-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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 modules needed to modify MODULEPATH to lmod module loads #29701
base: develop
Are you sure you want to change the base?
Conversation
Currently spack does not load hierarchy prerequisites, so that thegenerated loads scripts fail on some modules whose modules are not in MODULEPATH. This was reported in spack#23380. This change walks through all dependencies of the user supplied constraints, as if --recurse-dependencies had been supplied, and adds those specs that modify the MODULEPATH and which unlock paths that are prefixes of the module paths of the user supplied specs.
Is this tangential / orthogonal to autoloading of transitive dependencies? We now generate |
I think this is orthogonal to that. I have a
but this doesn't really work, since one can only |
that's the whole point of generating
that sounds like a bug then. I don't understand why that module is not generated. It should generate what's required... not just what's "user provided". |
Well,
By default Just doing an, e.g. Hope this makes it a bit clearer. |
Ah okay, I did not realize the root package |
Yes, this patch should enable hierarchies for some things that are dependencies of the supplied specs. It will probably not work for #23380 which was about compilers (haven't tested that) and it will also not work for conditionally enabled hierarchies, because I haven't had the need for that yet so I didn't construct a case for that. It should unbreak the loads scripts for straight-forward "I need this hierarchy enabled through this module to load this other module I am interested in" cases, though. I'm new to the spack codebase and this was the most self-contained way to do this. The proper way might be to put this somewhere in the module context so that the layout can use that information and return multiple modules to the writer, but right now I don't have the time to explore that. Do I need do something about the failing codecov? |
My reminder for this PR just rang. It would be great if somebody could have a look at this. :) |
Currently spack does not load hierarchy prerequisites, so that thegenerated loads scripts fail on some modules whose modules are not in MODULEPATH. This was reported in #23380.
This change walks through all dependencies of the user supplied constraints, as if
--recurse-dependencies
had been supplied, and adds those specs that modify the MODULEPATH and which unlock paths that are prefixes of the module paths of the user supplied specs.This should hopefully be a partial fix for #23380. It only checks for modules that definitely modify
MODULEPATH
, since this is currently the only instance where I encounter this problem, so I haven't touched modules that conditionally changeMODULEPATH
. In terms of performance this shouldn't be much worse than--recurse-dependencies
, although the module paths for the user supplied specs are generated twice (once long, once short).Happy to hear if there is a better way to do this!