Skip to content
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

filter-out Modules internal variables on sh-to-mod/source-sh #427

Closed
xdelaruelle opened this issue Oct 16, 2021 · 2 comments
Closed

filter-out Modules internal variables on sh-to-mod/source-sh #427

xdelaruelle opened this issue Oct 16, 2021 · 2 comments
Milestone

Comments

@xdelaruelle
Copy link
Collaborator

If script currently evaluated by sh-to-mod sub-command or source-sh modulefile command relies itself on module to load some modulefiles, the environment variables intended for Modules internal use are reported.

Such environment variables (LOADEDMODULES, _LMFILES_ and __MODULES_*) should be filtered-out to get a consistent result not reporting/setting these internal variables.

@xdelaruelle xdelaruelle added this to the 5.1 milestone Oct 16, 2021
@mgsternberg
Copy link

Xavier, thank you for taking up the suggestion.

It occurred to me that multiple (chained) invocations of sh-to-mod should produce the same modules code, i.e., be idempotent up to sorting, and therefore that should be a good unit test even if more internals are added in the future. I haven’t thought through yet if it’s dispositive, though.

Michael

@xdelaruelle
Copy link
Collaborator Author

It occurred to me that multiple (chained) invocations of sh-to-mod should produce the same modules code, i.e., be idempotent up to sorting, and therefore that should be a good unit test even if more internals are added in the future. I haven’t thought through yet if it’s dispositive, though.

@mgsternberg Could you elaborate more on that point by giving an example (that I could reproduce on my side) of the behavior you currently get.

Xavier

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants