Repository navigation
Fix implicit_requirement change from sourced modulefile - #743
Open
xdelaruelle wants to merge 1 commit into
Open
xdelaruelle wants to merge 1 commit into
xdelaruelle wants to merge 1 commit into
Conversation
The module modulefile command tests the implicit_requirement option twice: before running the sub-command to push an entry on the inhibit_req_record state, then after to pop it. When the sub-command is "config implicit_requirement <value>", the option value changes between these two tests. When the option is disabled this way from an initialization rc file or a sourced modulefile, the state is popped without having been pushed, which raises an error as this state is not defined. When the option is enabled, the pushed entry is never removed. Evaluate the condition once before running the sub-command and reuse its result afterward, so push and pop are always paired. Fixes envmodules#740 Assisted-by: Claude:claude-fable-5-2 Signed-off-by: Xavier Delaruelle <xavier.delaruelle@cea.fr>
This branch has not been deployed
This file contains hidden or 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
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
modulemodulefile command tests theimplicit_requirementoption twice: before running the sub-command to push an entry on theinhibit_req_recordstate, then after to pop it. When the sub-command isconfig implicit_requirement <value>, the option value changes between these two tests.When the option is disabled this way from an initialization rc file or a sourced modulefile, the state is popped without having been pushed, which raises an error as this state is not defined. When the option is enabled, the pushed entry is never removed.
The condition is now evaluated once before running the sub-command and its result reused afterward, so push and pop are always paired.
Fixes #740