Skip to content

Fix preprend path error - #738

Closed
hv15 wants to merge 3 commits into
envmodules:mainfrom
Pmodules:fix_preprend-path_error
Closed

hv15 wants to merge 3 commits into
envmodules:mainfrom
Pmodules:fix_preprend-path_error

Conversation

@hv15

@hv15 hv15 commented Nov 12, 2026

Copy link
Copy Markdown

When calling envmodules 5.7.0 we get the following errors:

$ . /opt/psi/Tools/Modules/5.7.0/etc/profile.d/modules.sh
Module ERROR: can't read "lst": no such variable
while executing
"module config implicit_requirement 0"
(file "/opt/psi/Tools/Modules/5.7.0/etc/initrc" line 22)
Please contact [[root@localhost](mailto:root@localhost)](mailto:root@localhost)
ERROR: module: Command 'prepend-path' not supported
ERROR: module: Command 'prepend-path' not supported
ERROR: module: Command 'prepend-path' not supported

An analysis shows that this is caused by calling module prepend-path ... within the siteconfig.tcl, which is no longer allowed in version 5.7.0.

This PR fixes this, while maintain the old behaviour for older versions of envmodules.

gsell and others added 3 commits November 7, 2026 22:06
Since envmodules 5.7.0, the module command cannot be used directly
with commands like prepend-path outwith a modulefile. We also can't rely
on $itrp as this interpretor has not yet been set. We instead use the
cmdModuleResurface which wraps the module command, and lets us use
sub-commands this early in the module processing.
@hv15 hv15 closed this Nov 12, 2026
@hv15

hv15 commented Nov 12, 2026

Copy link
Copy Markdown
Author

Sorry, I moved to quickly through the Github options, didn't realise this would open the PR against the upstream project. Sorry for the noise.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants