Skip to content

Upgrade golang to 1.26, and please plugins to latest#3498

Merged
SpangleLabs merged 9 commits intothought-machine:masterfrom
SpangleLabs:INFRA-132027-update-plugins
Apr 17, 2026
Merged

Upgrade golang to 1.26, and please plugins to latest#3498
SpangleLabs merged 9 commits intothought-machine:masterfrom
SpangleLabs:INFRA-132027-update-plugins

Conversation

@SpangleLabs
Copy link
Copy Markdown
Contributor

@SpangleLabs SpangleLabs commented Mar 18, 2026

Mostly, I want the updated version of go-rules, for #3497 , but let's upgrade the others too.

Go rules: v1.21.5 -> v1.29.0
Shell rules: v0.1.1 -> v0.2.1
Python rules: v1.7.4 -> v1.14.0

I held off on upgrading python rules plugin to v2
And the cc-rules plugin is already up to date

And upgrading golang from v1.24.10 to v1.26.1

@SpangleLabs SpangleLabs changed the title Upgrade plugins to latest versions Upgrade plugins and golang to latest versions Mar 18, 2026
SpangleLabs added a commit that referenced this pull request Mar 18, 2026
I think this might be required before trying to upgrade the golang
version in please repository, (#3498) to enable CircleCI setup to run
tests properly

Co-authored-by: roselyn <roselyn@thoughtmachine.net>
@SpangleLabs SpangleLabs requested a review from toastwaffle March 19, 2026 14:12
@SpangleLabs
Copy link
Copy Markdown
Contributor Author

Dang it, I've bisected various changes and the remaining test failure is due to upgrading go-rules from v1.22.0 to v1.23.0, which was a version released by me 1 year ago. I guess we didn't spot this failure back then... Perhaps we should be updating our plugins more frequently

DuBento pushed a commit to DuBento/please that referenced this pull request Mar 27, 2026
I think this might be required before trying to upgrade the golang
version in please repository, (thought-machine#3498) to enable CircleCI setup to run
tests properly

Co-authored-by: roselyn <roselyn@thoughtmachine.net>
@SpangleLabs
Copy link
Copy Markdown
Contributor Author

SpangleLabs commented Apr 13, 2026

Other things took priority, and now I'm struggling to remember where I was with this 😢

So, the failing test is effectively running plz cover on a plz e2e test which is running plz test, and then somehow the plz test being run ends up thinking it's a plz cover, but lacks the coverage file, and fails to set things up here:
https://github.com/please-build/go-rules/blob/165de83303a1604e48df6a998e61fca175b7273e/build_defs/go.build_defs#L859-L865

I can reproduce the failure locally by running:

plz clean && plz build //src:please && plz-out/bin/src/please cover --nocoverage_report //test:extra_test_output_test -c cover -v warn

My investigations a couple weeks ago found I could fix this by always setting the COVERAGE_FILE env variable, outside the check for whether something needs coverage, here:

env["COVERAGE_FILE"] = filepath.Join(testDir, CoverageFile)

Or by removing the state.NeedCoverage check from BuildTarget.NeedCoverage() here:

return state.NeedCoverage && !target.Test.NoOutput && !target.Test.NoCoverage && !target.HasAnyLabel(state.Config.Test.DisableCoverage)

But I'm not too sure the expectation of the test, here:

cmd = "plz test //test:extra_test_output_go_test",

Which runs plz test, but in the build-linux-alt CICD job, we're defining PLZ_COVER here:
PLZ_COVER: "cover --nocoverage_report"

in order to make it run the e2e test itself with plz cover, via the logic here:

please/test.sh

Line 48 in 3997e56

plz-out/bin/src/please -p -v2 $PLZ_ARGS ${PLZ_COVER:-test} $EXCLUDES --include=e2e --log_file plz-out/log/e2e_build.log --log_file_level 4 $@

So, I guess the actual issue is not the lack of COVERAGE_FILE, but actually the fact that the plz binary under test thinks it's running cover, rather than test? I'm not certain

@SpangleLabs
Copy link
Copy Markdown
Contributor Author

SpangleLabs commented Apr 13, 2026

So, I'm left wondering what plz test -c cover is meant to actually do. It doesn't mark something as needing coverage, so it doesn't entirely do what the tests seem to indicate they want to do.

If we swapped this line:

state.NeedCoverage = opts.Cover.active

to be:

state.NeedCoverage = opts.Cover.active || config.Build.Config == "cover"

Then that might fix it, but I'm still not sure of the original intents here

@SpangleLabs
Copy link
Copy Markdown
Contributor Author

I'm testing this now against our code base with #3519 applied also. If it works, I'll get this PR split up into parts, and get the parts reviewed

SpangleLabs pushed a commit to SpangleLabs/please that referenced this pull request Apr 15, 2026
This is extracted from thought-machine#3498, hopefully should work independently of those changes, so we can land it before those
SpangleLabs pushed a commit to SpangleLabs/please that referenced this pull request Apr 15, 2026
These came up during thought-machine#3498, the updated linter complained about a bunch of list allocations being suboptimal, and I spotted a bunch of typos. So let's fix all those
@SpangleLabs SpangleLabs force-pushed the INFRA-132027-update-plugins branch from 12a2c10 to 95adf28 Compare April 15, 2026 14:01
@SpangleLabs
Copy link
Copy Markdown
Contributor Author

Rebased to remove the lint fixes which went into #3522

SpangleLabs added a commit that referenced this pull request Apr 15, 2026
These came up during #3498, the updated linter complained about a bunch
of list allocations being suboptimal, and I spotted a bunch of typos. So
let's fix all those

---------

Co-authored-by: roselyn <roselyn@thoughtmachine.net>
@SpangleLabs SpangleLabs force-pushed the INFRA-132027-update-plugins branch from 95adf28 to f547631 Compare April 15, 2026 14:05
@SpangleLabs
Copy link
Copy Markdown
Contributor Author

Rebased onto master after that landed

SpangleLabs pushed a commit to SpangleLabs/please that referenced this pull request Apr 15, 2026
This got missed in thought-machine#3522, and cropped up again in thought-machine#3498 to haunt me.

This is some minor performance boost, but the upgraded linter gets sad about it, so let's fix it before thought-machine#3498
SpangleLabs added a commit that referenced this pull request Apr 15, 2026
This got missed in #3522, and cropped up again in #3498 to haunt me.

This is some minor performance boost, but the upgraded linter gets sad
about it, so let's fix it before #3498

Co-authored-by: roselyn <roselyn@thoughtmachine.net>
@SpangleLabs SpangleLabs changed the title Upgrade plugins and golang to latest versions Upgrade golang to 1.26, and please plugins to latest Apr 15, 2026
@SpangleLabs SpangleLabs force-pushed the INFRA-132027-update-plugins branch from f547631 to 1fafd33 Compare April 15, 2026 15:06
roselyn added 5 commits April 15, 2026 18:10
@SpangleLabs SpangleLabs force-pushed the INFRA-132027-update-plugins branch from 1fafd33 to d441553 Compare April 15, 2026 17:10
@SpangleLabs SpangleLabs merged commit 4889f52 into thought-machine:master Apr 17, 2026
13 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.

2 participants