Avoid processing the same EasyConfig multiple times#4767
Merged
boegel merged 1 commit intoeasybuilders:developfrom Mar 16, 2025
Merged
Avoid processing the same EasyConfig multiple times#4767boegel merged 1 commit intoeasybuilders:developfrom
boegel merged 1 commit intoeasybuilders:developfrom
Conversation
When passing the same EasyConfig file multiple times on the commandline it will be parsed once and put into a cache. Every future call will get the same `EasyConfig` instance so any modification to it will be reflected in all future uses of supposedly "freshly parsed EasyConfigs". This leads to confusing failures when trying to build the same file twice which is likely a mistake anyway, especially when one file is a symlink to another one passed too. So just make sure each physical file is parsed only once.
Contributor
Author
|
Shall we fix the copy issue too? I.e. again use |
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.
When passing the same EasyConfig file multiple times on the commandline it will be parsed once and put into a cache.
Every future call will get the same
EasyConfiginstance so any modification to it will be reflected in all future uses of supposedly "freshly parsed EasyConfigs".This leads to confusing failures when trying to build the same file twice which is likely a mistake anyway, especially when one file is a symlink to another one passed too.
So just make sure each physical file is parsed only once.
I ran into this when building a software using
usempi: Truethat errored during configure due to this:This is actually a bug introduced by 3836140:
copy.deepcopywas used which would copy the easyconfig instances contained in the cached dictI don't think this was intentional, the commit message reads
But the operation is done on dict instances not EasyConfig instances. Shall we fix that too @boegel ?
That would we an alternative to this PR: If we do get independent EC instances then building the same EC twice should work. But I'd prefer this or both.