-
Notifications
You must be signed in to change notification settings - Fork 203
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
Deprecate adding a non-existing path to $MODULEPATH #3637
Merged
akesandgren
merged 10 commits into
easybuilders:develop
from
Flamefire:deprecateCreatingDirInUse
May 25, 2021
Merged
Deprecate adding a non-existing path to $MODULEPATH #3637
akesandgren
merged 10 commits into
easybuilders:develop
from
Flamefire:deprecateCreatingDirInUse
May 25, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Flamefire
force-pushed
the
deprecateCreatingDirInUse
branch
3 times, most recently
from
April 8, 2021 15:29
29c791d
to
ac903ea
Compare
Flamefire
force-pushed
the
deprecateCreatingDirInUse
branch
from
April 15, 2021 10:55
ac903ea
to
65676df
Compare
akesandgren
reviewed
May 24, 2021
akesandgren
reviewed
May 24, 2021
Flamefire
commented
May 25, 2021
akesandgren
requested changes
May 25, 2021
akesandgren
approved these changes
May 25, 2021
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.
LGTM
Still more places where we should do os.pathsep.join and os.path.join but let's leave that for another cleanup PR someday.
Going in, thanks @Flamefire! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
module.use
function is not actually supposed to create a directory, but we require that the directories of$MODULEPATH
exist incurr_module_paths
Hence deprecate adding a path which does not exist
As a side effect we need to explicitly disallow the empty path
''
, as that also does not exist. EnvironmentModules ignores such paths, LMod does create an empty entry in$MODULEPATH
but doesn't really use it. We also filter it incurr_module_paths
so it makes sense to fully disallow adding it.During the tests on CI another bug was discovered: The module tools (at least Lmod) strip trailing slashes before adding a path to $MODULEPATH. However we sometimes do
add_module_path(os.path.join(some_prefix, modpath))
wheremodpath
could be empty which leads to a trailing slash andadd_module_path
(andremove_module_path
) not finding the path incurr_module_paths
(which do not contain the trailing slashes) This means that paths wrongly were retained in $MODULEPATH or unnecessarily added again.I added a test to catch this issue and fixed it.
I also had to add checks before adding Hierarchical MNS paths, such as
Core
if they exist (already). Not adding non-existing ones is fine as far as I can tell and even leads to more speed by avoiding module calls, cache invalidation and work for the modules tool (repeatably checking a non-existing folder)