Closed Groxx closed 1 month ago
❯ GOTOOLCHAIN=auto make
Makefile:46: warning: your Go toolchain is explicitly set to GOTOOLCHAIN=auto, ignoring go.work version go1.22.3...
which seems pretty good.
CI has a bunch of lines like
Makefile:46: warning: your Go toolchain is explicitly set to GOTOOLCHAIN=local, ignoring go.work version go1.22.3...
which could be handled more quietly by querying go version
... but that'd potentially force a download before it responds, which could cause a big surprising lag if it happened on a dev's machine.
but maybe. or maybe there's a different, better option somewhere. not sure at the moment.
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 68.01%. Comparing base (
2f08de5
) to head (aedc290
).
Files with Coverage Reduction | New Missed Lines | % | ||
---|---|---|---|---|
service/history/queue/timer_queue_processor_base.go | 1 | 77.66% | ||
common/cache/lru.go | 2 | 92.89% | ||
service/history/replication/task_processor.go | 2 | 81.25% | ||
common/archiver/filestore/historyArchiver.go | 4 | 80.95% | ||
service/matching/tasklist/task_list_manager.go | 4 | 76.09% | ||
service/frontend/api/handler.go | 6 | 62.2% | ||
service/history/task/transfer_standby_task_executor.go | 9 | 85.8% | ||
service/history/engine/engineimpl/poll_mutable_state.go | 9 | 74.16% | ||
service/frontend/wrappers/metered/metered.go | 9 | 63.18% | ||
<!-- | Total: | 46 | --> |
Totals | |
---|---|
Change from base Build 018facb4-1556-4d0a-a60a-2fec545c95e9: | -0.02% |
Covered Lines: | 102502 |
Relevant Lines: | 147479 |
Go 1.21 brought us "toolchains": We can now describe the version we want, and the Go CLI will automagically download, install, and use that version, with no extra effort. It should give us a MUCH more reliable way to ensure identical builds and formats and whatnot, and all us devs will auto-switch as we jump between git SHAs.
So let's use that!
This does a few things:
go
version to work on Cadence.go 1.20
lines. just development in this workspace.go.work
toolchain (if there's ago.work
file, toolchains in individualgo.mod
files are ignored)go.mod
files too if it helps, it just won't have any effect on CLIgo
use so it may be misleading.GOTOOLCHAIN=...
inside the Makefile, so ALL makefile-driven builds by everyone use exactly the same version (you can override this with an explicitGOTOOLCHAIN
)For future upgrades, upgrading the toolchain should be very simple:
go.work
to a new toolchain versionmake lint
ormake pr
or CI will tell you to change the Dockerfiles / other locations, if you don'tgit grep -F 1.22.3
to find and update those first.And temporarily trying a different version to check a bug / performance / try the new version is:
GOTOOLCHAIN=go1.23.4 make whatever
and it'll do exactly that (except for the version check inmake lint
)make clean
as well, to rebuild tools if that's relevant.build/go1.23.4/etc
folders, if we want that.