Repository navigation
Return the subrepo config error from every Initialise call - #3637
Merged
peterebden merged 1 commit intoOct 20, 2026
Merged
Conversation
Initialise loads the subrepo config in a sync.Once, so only the call that ran it saw the error and later calls got nil. Keep the result on the state instead.
toastwaffle
approved these changes
Oct 20, 2026
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.
Related to #3449.
BuildState.Initialisereads the subrepo's .plzconfig inside a sync.Once, but the error only went back to whichever call happened to run the Once. Any later call for the same subrepo got nil and carried on with a half-read config.Easy to see by building two targets from a subrepo whose .plzconfig doesn't parse. On master only one of them fails, the other gets parsed as if the config were fine. With this change both fail with the config error.
I store the result on the state so every caller gets it, and reset it in Copy() next to initOnce. Added a small test in src/core/subrepo_test.go that fails on master.
Not sure this covers everything in the issue (the arch subrepo case there was against older code), so I didn't mark it as a fix.
Ran
plz test //src/core:core_test //src/plz/... //src/parse/...and//test/subrepo/..., all passing.