Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: adopt Go 1.22 as bootstrap toolchain for Go 1.24 #64751

Open
dmitshur opened this issue Dec 15, 2023 · 35 comments
Open

build: adopt Go 1.22 as bootstrap toolchain for Go 1.24 #64751

dmitshur opened this issue Dec 15, 2023 · 35 comments
Assignees
Labels
early-in-cycle A change that should be done early in the 3 month dev cycle. NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@dmitshur
Copy link
Contributor

dmitshur commented Dec 15, 2023

This is the tracking issue for the Go 1.24 iteration of proposal #54265.

@dmitshur dmitshur added NeedsFix The path to resolution is known, but the work has not been done. early-in-cycle A change that should be done early in the 3 month dev cycle. release-blocker labels Dec 15, 2023
@dmitshur dmitshur added this to the Go1.24 milestone Dec 15, 2023
@smiletrl

This comment was marked as off-topic.

@dmitshur

This comment was marked as resolved.

@smiletrl

This comment was marked as resolved.

@gopherbot
Copy link
Contributor

This issue is currently labeled as early-in-cycle for Go 1.24.
That time is now, so a friendly reminder to look at it again.

@timothy-king

This comment was marked as resolved.

@dmitshur
Copy link
Contributor Author

There's an order we'll need to follow for this.

First, the builders need to be configured to start using Go 1.22 as the bootstrap. I'll be working on this part.
After that's done, cmd/dist and more code in the main Go repo can start to require it and take advantage of it (CC @aclements).

I'll likely target Go 1.22.6 (to be out soon) as the initial concrete bootstrap version.

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/605978 mentions this issue: main.star: use Go 1.22.6 as bootstrap on tip (Go 1.24 to be)

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/606156 mentions this issue: cmd/dist: require Go 1.22.6 as minimum bootstrap toolchain

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/605980 mentions this issue: dashboard: update bootstrap Go version to 1.22.6

gopherbot pushed a commit to golang/build that referenced this issue Aug 20, 2024
For golang/go#64751.

Change-Id: I68b42b295f48a57f7016e8d70f068c7cb3548df8
Reviewed-on: https://go-review.googlesource.com/c/build/+/605978
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
Reviewed-by: Carlos Amedee <[email protected]>
Auto-Submit: Dmitri Shuralyov <[email protected]>
gopherbot pushed a commit to golang/build that referenced this issue Aug 20, 2024
For golang/go#64751.

Change-Id: Ib8ba94bafc661bd4142dc2f180254d484ce3efa6
Reviewed-on: https://go-review.googlesource.com/c/build/+/605980
Auto-Submit: Dmitri Shuralyov <[email protected]>
Reviewed-by: Cherry Mui <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
gopherbot pushed a commit that referenced this issue Aug 20, 2024
This is a minimal change to start to require the new minimum bootstrap.
Taking advantage of the newer bootstap to simplify and improve code is
left to be done in separate CLs.

For #64751.

Change-Id: I1d4f883fae3026354a199174d51e79a36cd2dc53
Reviewed-on: https://go-review.googlesource.com/c/go/+/606156
LUCI-TryBot-Result: Go LUCI <[email protected]>
Run-TryBot: Dmitri Shuralyov <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
Reviewed-by: Cherry Mui <[email protected]>
Auto-Submit: Dmitri Shuralyov <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/607315 mentions this issue: sort: drop implementation for Go <1.21

gopherbot pushed a commit that referenced this issue Aug 21, 2024
Now that Go 1.22.6 is the minimum bootstrap toolchain (cf. CL 606156),
the fallback implementation for Go versions <1.21 can be dropped.

For #61180
For #64751

Change-Id: Idfeca0a6e9f490e1ab0f308ead372612402923ea
Reviewed-on: https://go-review.googlesource.com/c/go/+/607315
Reviewed-by: Dmitri Shuralyov <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Ian Lance Taylor <[email protected]>
Commit-Queue: Tobias Klauser <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
Auto-Submit: Tobias Klauser <[email protected]>
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/604799 mentions this issue: cmd/dist: set go version in bootstrap go.mod file

gopherbot pushed a commit that referenced this issue Aug 22, 2024
The commands to build the bootstrap toolchains and go commands are run
from modules created by two bootstrap go.mod files: one is used when
building toolchain1 and go_bootstrap, and the other is used for
toolchain2 and toolchain3, and the final build. Currently the first has
a go directive specifying go 1.20, and the second one does not have a go
directive at all. This affects the default GODEBUG setting when building
the final toolchain: the default GODEBUG value is based on the go
version of the go.mod file, and when the go.mod file does not have a
version it defaults to go1.16. We should set the go directive on the
bootstrap used for the second half of the builds to use the current go
verison from the std's go.mod file (which is the same as the version on
cmd's go.mod file).

The go.mod file used for the initial bootstrap should have a go
directive with the minimum version of the toolchain required for
bootstrapping. That version is the current version - 2 rounded down to
an even number.

For #64751
Fixes #68797

Change-Id: Ibdddf4bc36dc963291979d603c4f3fc55264f65b
Reviewed-on: https://go-review.googlesource.com/c/go/+/604799
Reviewed-by: Dmitri Shuralyov <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/607821 mentions this issue: cmd/dist: update tryDirs list to match make scripts

gopherbot pushed a commit that referenced this issue Aug 27, 2024
The $HOME/sdk/go1.17 and $HOME/go1.17 paths were initially added as
places to look for a bootstrap toolchain to make.{bash,bat,rc} scripts
and in cmd/dist (CL 370274). Those two go1.17 directories have since
been updated in the make scripts to go1.20.6 (CL 512275) and later on
to go1.22.6 (CL 606156), but the same list in cmd/dist was missed.

Fix the inconsistency now. But maybe cmd/dist doesn't need to maintain
this logic, if it's required to be invoked via one of the make scripts,
since they're responsible for setting GOROOT_BOOTSTRAP?

For #64751.

Change-Id: I0988005c559014791363138f2f722cc1f9a78bcf
Reviewed-on: https://go-review.googlesource.com/c/go/+/607821
Reviewed-by: Ian Lance Taylor <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Cherry Mui <[email protected]>
Auto-Submit: Dmitri Shuralyov <[email protected]>
@dmitshur
Copy link
Contributor Author

The builders are updated to provide a go1.22.6 bootstrap, and cmd/dist is updated to require it.

This is still open (but no longer a release blocker—that aspect of this issue is complete) to track any remaining opportunities in the Go tree to take advantage of the updated bootstrap requirement.

@qiulaidongfeng
Copy link
Member

release note say:
Go 1.24 now requires Go 1.22.6 or later for bootstrap.

But master can now also bootstrap with 1.22.2.
go1.24 does require a minimum go1.22 bootstrap (by less than this version dist two source code declaration package names different enforcement), but currently does not enforce a minimum go1.22.6. I asked if go1.22.6 was the go team demanding more from themselves when developing it, or did the release notes mean something else?

@dmitshur
Copy link
Contributor Author

dmitshur commented Aug 30, 2024

currently does not enforce a minimum go1.22.6

We might be able to improve this in the future. Earlier point releases are likely to work too, but they're not supported. We use go1.22.6 bootstraps in testing, so if there's a problem with using an older version, automated testing won't uncover it.

See https://go.dev/doc/go1.20#bootstrap and #54265 (comment) for why we changed from selecting a .0 release to the latest available minor release (at the time we adopt the requirement) as the bootstrap.

qiulaidongfeng added a commit to qiulaidongfeng/go that referenced this issue Aug 30, 2024
The go1.24 release notes say that go1.22.6 is the
minimum bootstraps required,
the go team also use go1.22.6 bootstraps in testing,
so if there's a problem with using an older version,
automated testing won't uncover it.

Now enforce this in dist to avoid
release notes that do not match reality, which can be confusing.

For golang#64751

Change-Id: I8d50770e19f7f014e1316f0ac872e288a27c20fe
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/610597 mentions this issue: cmd: use 20 bytes hash when possible

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/610596 mentions this issue: cmd: do not use notsha256

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/610599 mentions this issue: cmd: remove notsha256 package

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/610598 mentions this issue: cmd: use 20 bytes hash when possible

apocelipes added a commit to apocelipes/go that referenced this issue Sep 4, 2024
The new bootstrap toolchain allows us to use the built-in clear.

Updates golang#64751
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/610516 mentions this issue: compress/flate: use built-in clear to simplify the code

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/610775 mentions this issue: cmd/compile/internal/liveness: use slices.Reverse

gopherbot pushed a commit that referenced this issue Sep 4, 2024
CL 402595 used notsha256 to prevent the compiler from depending on
cgo-based implementations of sha1 and sha256.

However, since CL 454836, cmd is built with CGO_ENABLED=0, which
will disable boringcrypto. Thus all usages of notsha256 is not necessary
anymore.

Updates #51940
Updates #64751

Change-Id: I503090f7a2efb5723e8a79523b143dc7cdb4edd0
Reviewed-on: https://go-review.googlesource.com/c/go/+/610596
Auto-Submit: Cuong Manh Le <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Keith Randall <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
Reviewed-by: Keith Randall <[email protected]>
gopherbot pushed a commit that referenced this issue Sep 4, 2024
CL 402595 changes all usages of 20 bytes hash to 32 bytes hash by using
notsha256.

However, since CL 454836, notsha256 is not necessary anymore, so this CL
reverts those changes to 20 bytes hash using cmd/internal/hash package.

Updates #51940
Updates #64751

Change-Id: Icb08d5a0d8032a3c4d050ff7b2298d31c483b88b
Reviewed-on: https://go-review.googlesource.com/c/go/+/610597
Reviewed-by: Dmitri Shuralyov <[email protected]>
Auto-Submit: Cuong Manh Le <[email protected]>
Reviewed-by: Keith Randall <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Keith Randall <[email protected]>
gopherbot pushed a commit that referenced this issue Sep 4, 2024
CL 402595 changes all usages of 16 bytes hash to 32 bytes hash by using
notsha256.

However, since CL 454836, notsha256 is not necessary anymore, so this CL
reverts those changes to 16 bytes hash using cmd/internal/hash package.

Updates #51940
Updates #64751

Change-Id: Ic015468ca4a49d0c3b1fb9fdbed93fddef3c838f
Reviewed-on: https://go-review.googlesource.com/c/go/+/610598
Auto-Submit: Cuong Manh Le <[email protected]>
Reviewed-by: Keith Randall <[email protected]>
Reviewed-by: Keith Randall <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
gopherbot pushed a commit that referenced this issue Sep 4, 2024
All of its usages were removed in CL 610596.

Updates #51940
Updates #64751

Change-Id: I72a0ea4bd44a2f671e032bffa1facf84822a90f2
Reviewed-on: https://go-review.googlesource.com/c/go/+/610599
Auto-Submit: Cuong Manh Le <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
Reviewed-by: Keith Randall <[email protected]>
Reviewed-by: Keith Randall <[email protected]>
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/610601 mentions this issue: cmd/compile: use slices.SortFunc

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/610603 mentions this issue: types2, go/types: use slices.SortFunc

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/610602 mentions this issue: cmd/compile: use slices.SortStatbleFunc

gopherbot pushed a commit that referenced this issue Sep 4, 2024
Now that we're bootstrapping from a toolchain that has the slices
package.

Updates #64751

Change-Id: Id50d76de05e353ef06d64b47ad6400b2b7572205
Reviewed-on: https://go-review.googlesource.com/c/go/+/610775
Auto-Submit: Cuong Manh Le <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Cherry Mui <[email protected]>
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/610855 mentions this issue: all: replace sort.Slice with slices.Sort

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/611095 mentions this issue: cmd/asm/internal: use slices.Contains

gopherbot pushed a commit that referenced this issue Sep 5, 2024
Now that we're bootstrapping from a toolchain that has the slices
package.

Updates #64751

Change-Id: I3227e55f87e033dae63a2d1712b7f9373fe49731
Reviewed-on: https://go-review.googlesource.com/c/go/+/610603
Reviewed-by: Robert Griesemer <[email protected]>
Auto-Submit: Cuong Manh Le <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Robert Findley <[email protected]>
gopherbot pushed a commit that referenced this issue Sep 5, 2024
Now that Go 1.22.6 is the minimum bootstrap toolchain (cf. CL 606156),
the slices package (introduced in Go 1.21) can be used in packages built
using the bootstrap toolchain.

For #64751

Change-Id: Ife0daa37c0982d9ec1afab07b9d40a1dfee9b7d4
Reviewed-on: https://go-review.googlesource.com/c/go/+/610575
Reviewed-by: Dmitri Shuralyov <[email protected]>
Auto-Submit: Tobias Klauser <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Ian Lance Taylor <[email protected]>
gopherbot pushed a commit that referenced this issue Sep 5, 2024
Now that we're bootstrapping from a toolchain that has the slices
package.

Updates #64751

Change-Id: I2e63d95577d058670d3dc75bd45d6e050c6f0e25
Reviewed-on: https://go-review.googlesource.com/c/go/+/610601
Reviewed-by: Cherry Mui <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
Auto-Submit: Cuong Manh Le <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
gopherbot pushed a commit that referenced this issue Sep 5, 2024
Now that we're bootstrapping from a toolchain that has the slices
package.

Updates #64751

Change-Id: I876ec6d261466344faf33f8c5cda229dd1e4185f
Reviewed-on: https://go-review.googlesource.com/c/go/+/610602
Auto-Submit: Cuong Manh Le <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Cherry Mui <[email protected]>
gopherbot pushed a commit that referenced this issue Sep 6, 2024
The new bootstrap toolchain allows us to use the built-in clear.

Updates #64751

Change-Id: Ic363e1059f34c46eaa4267c0b40a4ed8d5b3961b
GitHub-Last-Rev: 46ca735
GitHub-Pull-Request: #69253
Reviewed-on: https://go-review.googlesource.com/c/go/+/610516
Reviewed-by: Dmitri Shuralyov <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Ian Lance Taylor <[email protected]>
Auto-Submit: Ian Lance Taylor <[email protected]>
gopherbot pushed a commit that referenced this issue Sep 6, 2024
Now that Go 1.22.6 is the minimum bootstrap toolchain (cf. CL 606156),
the slices package (introduced in Go 1.21) can be used in packages built
using the bootstrap toolchain.

For #64751

Change-Id: I0115213da4b1f0a1fa0ef7ad34456fbf52e00fae
Reviewed-on: https://go-review.googlesource.com/c/go/+/611095
Reviewed-by: Cherry Mui <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
Auto-Submit: Tobias Klauser <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/612316 mentions this issue: cmd/cgo: use slices.ContainsFunc

gopherbot pushed a commit that referenced this issue Sep 11, 2024
Now that Go 1.22.6 is the minimum bootstrap toolchain (cf. CL 606156),
the slices package (introduced in Go 1.21) can be used in packages built
using the bootstrap toolchain.

For #64751

Change-Id: Ib36f39016f57c5e110f78a85ca9c806d91356024
Reviewed-on: https://go-review.googlesource.com/c/go/+/612316
Reviewed-by: Dmitri Shuralyov <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
Auto-Submit: Tobias Klauser <[email protected]>
Reviewed-by: Ian Lance Taylor <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
gopherbot pushed a commit that referenced this issue Sep 26, 2024
The go1.24 release notes say that go1.22.6 is the
minimum bootstraps required,
the go team also use go1.22.6 bootstraps in testing,
so if there's a problem with using an older version,
automated testing won't uncover it.

Now enforce this in dist to avoid
release notes that do not match reality, which can be confusing.

For #64751

Change-Id: Icd2f8a47b2bbb2d7c3dab9be9a228f43b9630063
GitHub-Last-Rev: 425cd7f
GitHub-Pull-Request: #69168
Reviewed-on: https://go-review.googlesource.com/c/go/+/609762
Reviewed-by: David Chase <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
Auto-Submit: Dmitri Shuralyov <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
early-in-cycle A change that should be done early in the 3 month dev cycle. NeedsFix The path to resolution is known, but the work has not been done.
Projects
Status: In Progress
Development

No branches or pull requests

6 participants