Skip to content

Return the subrepo config error from every Initialise call - #3637

Merged
peterebden merged 1 commit into
thought-machine:masterfrom
r3wretrhy:fix/subrepo-config-error-sticky
Oct 20, 2026
Merged

peterebden merged 1 commit into
thought-machine:masterfrom
r3wretrhy:fix/subrepo-config-error-sticky

Conversation

@r3wretrhy

Copy link
Copy Markdown
Contributor

Related to #3449.

BuildState.Initialise reads 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.

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.

@peterebden peterebden left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@peterebden
peterebden merged commit cedd9f1 into thought-machine:master Oct 20, 2026
16 checks passed
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.

3 participants