Jonathan Amsterdam would like Robert Findley and Hyang-Ah Hana Kim to review this change.
go.mod: upgrade to go 1.23.0
The go.mod major version now matches what we use for Dockerfiles.
Use a patch release (final ".0") to cause a toolchain download
when pkgsite is the main module (like the toolchain directive).
Staticcheck is not ready for 1.23 yet, so comment it out.
diff --git a/all.bash b/all.bash
index a8d81c2..1b99d31 100755
--- a/all.bash
+++ b/all.bash
@@ -154,7 +154,8 @@
# check_staticcheck runs staticcheck on source files.
check_staticcheck() {
ensure_go_binary honnef.co/go/tools/cmd/staticcheck
- runcmd staticcheck $(go list ./... | grep -v third_party | grep -v internal/doc | grep -v internal/render)
+ # TODO: re-enable staticcheck when it can work on Go 1.23.
+ # runcmd staticcheck $(go list ./... | grep -v third_party | grep -v internal/doc | grep -v internal/render)
}
# check_misspell runs misspell on source files.
diff --git a/go.mod b/go.mod
index b59f65e..03a775d 100644
--- a/go.mod
+++ b/go.mod
@@ -1,6 +1,6 @@
module golang.org/x/pkgsite
-go 1.19
+go 1.23
require (
cloud.google.com/go/cloudtasks v1.10.0
diff --git a/go.sum b/go.sum
index af6848e..fe492be 100644
--- a/go.sum
+++ b/go.sum
@@ -556,6 +556,7 @@
github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk=
github.com/google/martian/v3 v3.3.2 h1:IqNFLAmvJOgVlpdEBiQbDc2EwKW77amAycfTuWKdfvw=
+github.com/google/martian/v3 v3.3.2/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk=
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
@@ -1037,6 +1038,7 @@
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
github.com/yuin/goldmark v1.6.0 h1:boZcn2GTjpsynOsC0iJHnBWa4Bi0qzfJjthwauItG68=
+github.com/yuin/goldmark v1.6.0/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
github.com/yuin/gopher-lua v0.0.0-20200816102855-ee81675732da h1:NimzV1aGyq29m5ukMK0AMWEhFaL/lrEOaephfuoiARg=
github.com/yuin/gopher-lua v0.0.0-20200816102855-ee81675732da/go.mod h1:E1AXubJBdNmFERAOucpDIxNzeGfLzg0mYh+UfMWdChA=
github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43/go.mod h1:aX5oPXxHm3bOH+xeAttToC8pqch2ScQN/JoXYupl6xs=
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Kokoro presubmit build finished with status: SUCCESS
Logs at: https://source.cloud.google.com/results/invocations/babd9d02-5058-49aa-9b6c-d9d07e4cc6e1
| kokoro-CI | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Use a patch release (final ".0") to cause a toolchain download
when pkgsite is the main module (like the toolchain directive).(Suggested rewording to reduce possibility of confusion for future readers.)
Use a released version of Go ("go1.23.0" with a final ".0") to cause
successful toolchain download for Go 1.22 users that are on go1.22.3
or older (before CL 583915 fixed it in go1.22.4). Anyone still using
go1.23rc1 or go1.23rc2 will also benefit from an upgrade to a stable
go1.23.0 release as well.
Staticcheck is not ready for 1.23 yet, so comment it out.Its latest version claims to have Go 1.23 support (https://staticcheck.dev/changes/2024.1/#added-go-123-support), is that not the case in practice?
go 1.23To match what the commit message says:
```suggestion
go 1.23.0
```
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Use a patch release (final ".0") to cause a toolchain download
when pkgsite is the main module (like the toolchain directive).(Suggested rewording to reduce possibility of confusion for future readers.)
Use a released version of Go ("go1.23.0" with a final ".0") to cause
successful toolchain download for Go 1.22 users that are on go1.22.3
or older (before CL 583915 fixed it in go1.22.4). Anyone still using
go1.23rc1 or go1.23rc2 will also benefit from an upgrade to a stable
go1.23.0 release as well.
Done
Staticcheck is not ready for 1.23 yet, so comment it out.Its latest version claims to have Go 1.23 support (https://staticcheck.dev/changes/2024.1/#added-go-123-support), is that not the case in practice?
It's built on an rc:
-: module requires at least go1.23.0, but Staticcheck was built with go1.23-20240626-RC01 (compile)
To match what the commit message says:
```suggestion
go 1.23.0
```
Done
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
The latest failure in go1.22 builder is:
go: go.mod requires go >= 1.23.0 (running go 1.22.6; GOTOOLCHAIN=local)
I think LUCI sets `GOTOOLCHAIN=local` by default. To work with go1.23.x and enable toolchain upgrade, we need adjust the LUCI builder for pkgsite.
FYI x/tools/gopls had to override to `GOTOOLCHAIN=auto` to make its tests work. (https://source.chromium.org/chromium/infra/infra_superproject/+/main:infra/go/src/infra/experimental/golangbuild/testmode.go;l=307-322?q=GOTOOLCHAIN%20%22auto%22&ss=chromium%2Finfra%2Finfra_superproject:infra%2F). Dmitri - is this still the recommended way?
Staticcheck is not ready for 1.23 yet, so comment it out.Jonathan AmsterdamIts latest version claims to have Go 1.23 support (https://staticcheck.dev/changes/2024.1/#added-go-123-support), is that not the case in practice?
It's built on an rc:
-: module requires at least go1.23.0, but Staticcheck was built with go1.23-20240626-RC01 (compile)
Can you tell us how/where this project is building staticcheck? If staticcheck is built with `go install` or `go run`, it's likely that the go command is running outside the project module and picks up the system default which is probably lagging. Staticcheck builds and supports go1.23.0.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
The latest failure in go1.22 builder is:
go: go.mod requires go >= 1.23.0 (running go 1.22.6; GOTOOLCHAIN=local)I think LUCI sets `GOTOOLCHAIN=local` by default. To work with go1.23.x and enable toolchain upgrade, we need adjust the LUCI builder for pkgsite.
FYI x/tools/gopls had to override to `GOTOOLCHAIN=auto` to make its tests work. (https://source.chromium.org/chromium/infra/infra_superproject/+/main:infra/go/src/infra/experimental/golangbuild/testmode.go;l=307-322?q=GOTOOLCHAIN%20%22auto%22&ss=chromium%2Finfra%2Finfra_superproject:infra%2F). Dmitri - is this still the recommended way?
The go1.22 LUCI builders are intentionally configured with GOTOOLCHAIN=local (i.e., without the default '+auto' suffix) to catch accidental/unintended cases where something other than the toolchain the builder selected is being tested. For gopls there is a special case discussed in #67749.
For x/pkgsite, there aren't tests exercising behavior with an older 'go' command, so it's just a matter of not running those builders since they won't be producing useful signal. There are already cmd/go tests to verify its toolchain switching behavior, we don't need to use significant builder resources to only test that. Sent CL 609279.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Staticcheck is not ready for 1.23 yet, so comment it out.Jonathan AmsterdamIts latest version claims to have Go 1.23 support (https://staticcheck.dev/changes/2024.1/#added-go-123-support), is that not the case in practice?
Hyang-Ah Hana KimIt's built on an rc:
-: module requires at least go1.23.0, but Staticcheck was built with go1.23-20240626-RC01 (compile)
Can you tell us how/where this project is building staticcheck? If staticcheck is built with `go install` or `go run`, it's likely that the go command is running outside the project module and picks up the system default which is probably lagging. Staticcheck builds and supports go1.23.0.
Hmm, I don't know what I was seeing. Fixed.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Kokoro presubmit build finished with status: FAILURE
Logs at: https://source.cloud.google.com/results/invocations/97ef362a-2f2a-41ab-802c-1b7f5d60f371
| kokoro-CI | -1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Kokoro presubmit build finished with status: FAILURE
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
The Kokoro failure looks real (a screentest diff). Is that expected?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
The Kokoro failure looks real (a screentest diff). Is that expected?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Kokoro presubmit build finished with status: SUCCESS
Logs at: https://source.cloud.google.com/results/invocations/4562e369-d2ea-40d6-8325-e500365e2e56
| kokoro-CI | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Jonathan AmsterdamThe Kokoro failure looks real (a screentest diff). Is that expected?
No. Works for me locally. Looking into it.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +2 |
Jonathan AmsterdamThe Kokoro failure looks real (a screentest diff). Is that expected?
Jonathan AmsterdamNo. Works for me locally. Looking into it.
It was a flake.
Curious why a screentest would flake...
func readFieldNames(filename string) (map[string][]string, error) {This behavior of preserving existing field order in the generated codec is, while elegant, rather nonstandard. In particular, it's surprising to have a generated file that is path dependent (meaning: if I deleted it and regenerated it, I'd get a different file). I think this could use better documentation, perhaps here or perhaps at the top of the generated file (or perhaps both).
Not necessarily for this CL.
//lint:file-ignore SA1019 TODO: fixCan you make all of these TODO(jba)? Thanks.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Jonathan AmsterdamThe Kokoro failure looks real (a screentest diff). Is that expected?
Jonathan AmsterdamNo. Works for me locally. Looking into it.
Robert FindleyIt was a flake.
Curious why a screentest would flake...
I believe there are timing issues. I'm going to look deeper into the screen tests if I have time.
func readFieldNames(filename string) (map[string][]string, error) {This behavior of preserving existing field order in the generated codec is, while elegant, rather nonstandard. In particular, it's surprising to have a generated file that is path dependent (meaning: if I deleted it and regenerated it, I'd get a different file). I think this could use better documentation, perhaps here or perhaps at the top of the generated file (or perhaps both).
Not necessarily for this CL.
Noted.
Can you make all of these TODO(jba)? Thanks.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Kokoro presubmit build finished with status: SUCCESS
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
5 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:
```
The name of the file: internal/godoc/codec/generate.go
Insertions: 1, Deletions: 1.
@@ -437,7 +437,7 @@
// Code generated by the codec package. DO NOT EDIT.
-//lint:file-ignore SA1019 TODO: fix
+//lint:file-ignore SA1019 TODO(jba): fix
package «.Package»
```
```
The name of the file: internal/godoc/codec/testdata/map.go
Insertions: 1, Deletions: 1.
@@ -4,7 +4,7 @@
// Code generated by the codec package. DO NOT EDIT.
-//lint:file-ignore SA1019 TODO: fix
+//lint:file-ignore SA1019 TODO(jba): fix
package somepkg
```
```
The name of the file: internal/godoc/codec/testdata/struct.go
Insertions: 1, Deletions: 1.
@@ -4,7 +4,7 @@
// Code generated by the codec package. DO NOT EDIT.
-//lint:file-ignore SA1019 TODO: fix
+//lint:file-ignore SA1019 TODO(jba): fix
package somepkg
```
```
The name of the file: internal/godoc/encode_ast.gen.go
Insertions: 1, Deletions: 1.
@@ -4,7 +4,7 @@
// Code generated by the codec package. DO NOT EDIT.
-//lint:file-ignore SA1019 TODO: fix
+//lint:file-ignore SA1019 TODO(jba): fix
package godoc
```
```
The name of the file: internal/godoc/codec/testdata/slice.go
Insertions: 1, Deletions: 1.
@@ -4,7 +4,7 @@
// Code generated by the codec package. DO NOT EDIT.
-//lint:file-ignore SA1019 TODO: fix
+//lint:file-ignore SA1019 TODO(jba): fix
package somepkg
```
go.mod: upgrade to go 1.23
The go.mod major version now matches what we use for Dockerfiles.
The version of staticcheck that works with Go 1.23 revealed several
uses of deprecated functions. Some of these were easy to change,
but other require more care and will be addressed in some later CLs.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |