-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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.17 as bootstrap toolchain for Go 1.20 #44505
Comments
Actually, I confused myself while writing this. |
Being able to assume a recent compiler for bootstrapping would be really nice for not having to remember all the quirks of Go 1.4, or needing to worry about working around long-fixed issues. FWIW, OpenJDK appears to require the immediately previous release for bootstrapping (see https://openjdk.java.net/groups/build/doc/building.html, "Build JDK Requirements"), and also has a 6-month release cycle (https://en.wikipedia.org/wiki/OpenJDK#OpenJDK_versions), but building OpenJDK takes way longer than running make.bash does. I don't think we need to be nearly as aggressive at uprev'ing Go bootstrap versions, but I think it at least suggests end users could tolerate another uprev before 1.256. :) |
This is a good idea, however, perhaps it would make sense to additionaly declare that the bootstrap version of Go is also going to be the long term support or "LTS" version, which keeps receiving backports of bugfixes for 4 years (or whatever the support period for the bootstrap version is going to be). In some organizations and for some developments, having a stable LTS version that keeps receiving bug fixes is extremely valuable. |
FWIW, the level of aggressive bootstrap version bumps OpenJDK does are a big hurdle towards having recent OpenJDK packaged for backported distribution releases (and require a lot of extra coordination / "fancy footwork" from maintainers to coordinate or "hack" around). As a concrete example for Go, this could make adding new architectures more difficult for a distribution until/unless IMO this would be easier to understand/stomach if the proposed version were one that's already supported by at least the most recent |
Just a note that GCC 11 will support Go 1.16. |
This proposal has been added to the active column of the proposals project |
Based on the discussion above, this proposal seems like a likely accept. |
No change in consensus, so accepted. 🎉 |
This should be mentioned in the release notes for Go 1.18. And maybe even in the release notes for Go 1.17, if still possible? (since the removal of support for old macOS versions is usually noted one release note in advance) |
A few lingering references to Go 1.4 remain. Fix them, and document the ones that should stay. For #44505. Fixes #54301. Change-Id: Ieb9c0f08e4d1890ea3fdfd9c8df5493934ae7493 Reviewed-on: https://go-review.googlesource.com/c/go/+/423354 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Go 1.4 is no longer used for bootstrap. (Hooray!) For golang/go#44505. Change-Id: Id8ad641fa8ed88a2114879eb35ee45fff135eab6 Reviewed-on: https://go-review.googlesource.com/c/build/+/420215 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Russ Cox <rsc@golang.org>
Change https://go.dev/cl/427114 mentions this issue: |
Go 1.17 will be used instead of Go 1.4 as minimum required version for bootstrap, so runtime.KeepAlive introduced in Go 1.7 can be used in cmd/compile. For #44505 Change-Id: I96bd6619c4476e36ee1d93ca049da622a3a78f97 Reviewed-on: https://go-review.googlesource.com/c/go/+/427114 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com> Auto-Submit: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Heschi Kreinick <heschi@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
Change https://go.dev/cl/427958 mentions this issue: |
Change https://go.dev/cl/427957 mentions this issue: |
Change https://go.dev/cl/428218 mentions this issue: |
Change https://go.dev/cl/430335 mentions this issue: |
Go 1.17 is the minimum required version for bootstrap as of Go 1.20. Also, the package no longer builds with Go 1.12 used for bootstrap. Thus, drop the Go 1.12 compatibility and used linkname unconditionally. For #44505 Change-Id: Ic160aba4a33d580987b4633a3db03a025804d090 Reviewed-on: https://go-review.googlesource.com/c/go/+/430335 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Now that the required Go bootstrap version is 1.17, we can simplify some of the logic for working with exec.Cmd.Env as those APIs have been simplified. Updates #44505. Change-Id: Ia62ab9830320c7daf65a15f2313471dfaba687b5 Reviewed-on: https://go-review.googlesource.com/c/go/+/427957 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> Run-TryBot: Austin Clements <austin@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
When running on Go 1.19, we can further simplify some of the exec.Cmd helpers due to API improvements. There's not much point in doing this while the bootstrap is still 1.17, but this will queue up this simplification in an obvious way for when we next upgrade the bootstrap toolchain (#54265). Updates #44505. Change-Id: I2ebc3d5c584375ec862a1d48138ab134bd9b2366 Reviewed-on: https://go-review.googlesource.com/c/go/+/427958 Reviewed-by: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Austin Clements <austin@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Change https://go.dev/cl/436915 mentions this issue: |
The minimum bootstrap version for Go ≥ 1.20 is Go 1.17. That version supports the new style //go:build lines. Thus the old style //+build lines can be dropped in this part of the tree as well. Leave the //+build lines in cmd/dist which will ensure the minimum Go version during bootstrap. As suggested by Cherry during review of CL 430496 For #44505 Change-Id: If53c0b02cacbfb055a33e73cfd38578dfd3aa340 Reviewed-on: https://go-review.googlesource.com/c/go/+/436915 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: Than McIntosh <thanm@google.com>
Change https://go.dev/cl/435473 mentions this issue: |
[Roll-forward of CL 436915 by Tobias Klauser, with builtin and gen directories dropped now that they've been handled separately.] The minimum bootstrap version for Go ≥ 1.20 is Go 1.17. That version supports the new style //go:build lines. Thus the old style //+build lines can be dropped in this part of the tree as well. Leave the //+build lines in cmd/dist which will ensure the minimum Go version during bootstrap. As suggested by Cherry during review of CL 430496 For #44505 Change-Id: Ifa686656c3e50bf7f92f70747b44d74a7d51bad8 Reviewed-on: https://go-review.googlesource.com/c/go/+/435473 Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Russ Cox <rsc@golang.org>
Replace explicit Go version names where possible with generic reference to Go bootstrap version. Updates #44505 Change-Id: I4a6439576efd40e72acd26fcc1472a1a8b0b06e7 Reviewed-on: https://go-review.googlesource.com/c/go/+/344330 Auto-Submit: Martin Möhrmann <martin@golang.org> Reviewed-by: Than McIntosh <thanm@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Run-TryBot: Martin Möhrmann <moehrmann@google.com> Reviewed-by: Russ Cox <rsc@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
Replace explicit Go version names where possible with generic reference to Go bootstrap version. Updates golang#44505 Change-Id: I4a6439576efd40e72acd26fcc1472a1a8b0b06e7 Reviewed-on: https://go-review.googlesource.com/c/go/+/344330 Auto-Submit: Martin Möhrmann <martin@golang.org> Reviewed-by: Than McIntosh <thanm@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Run-TryBot: Martin Möhrmann <moehrmann@google.com> Reviewed-by: Russ Cox <rsc@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
Change https://go.dev/cl/522197 mentions this issue: |
Previously, strings.LastIndexByte couldn't be used because it was only added in Go 1.5 but Go 1.4 was required for bootstrapping. In Go 1.18, the bootstrap toolchain was bumped to Go 1.17 (see #44505), thus strings.LastIndexByte can be used now. Change-Id: I01a70a59dbfc853cf03d49747a2dd62d21ba74e9 Reviewed-on: https://go-review.googlesource.com/c/go/+/522197 Reviewed-by: Ian Lance Taylor <iant@google.com> Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com> Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Change https://go.dev/cl/524335 mentions this issue: |
Change https://go.dev/cl/524336 mentions this issue: |
Change https://go.dev/cl/562619 mentions this issue: |
Fixes golang/go#65654 Updates golang/go#54265 Updates golang/go#44505 Change-Id: Ia1c9b50a2f66b67db43e8dcd21b1002b66cf30fa Reviewed-on: https://go-review.googlesource.com/c/website/+/562619 Auto-Submit: Robert Findley <rfindley@google.com> Reviewed-by: Robert Findley <rfindley@google.com> Reviewed-by: Austin Clements <austin@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Change https://go.dev/cl/609955 mentions this issue: |
Now that golang/go#44505 is resolved, we can simplify frames_go1*.go. This was already done in GOROOT in https://go.dev/cl/420903. Change-Id: Ia7f2a123794fad62532bae2da267b0c8034917bc Reviewed-on: https://go-review.googlesource.com/c/tools/+/609955 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
I propose that starting with the Go 1.18 dev cycle, we require Go 1.16 as the Go bootstrap version (instead of Go 1.4).
When we switched to writing the Go compiler in itself, I wrote two proposals related to the bootstrap process.
The original proposal, https://golang.org/s/go13compiler (December 2013), was about the overall process of converting the compiler to Go.
In that proposal, I wrote:
This was all fairly hypothetical, and I certainly no longer believe it makes any sense to write a C back end for the Go compiler. (In fact, for the windows/arm64 port I did, I now have a working Go toolchain but still don't know what C compiler I'm supposed to use!)
The final proposal, https://golang.org/s/go15bootstrap (January 2015), simplified the process from an iterative one to hard-coding Go 1.4 as the bootstrap toolchain:
This was an important simplification, especially for people packaging Go for other systems. That decision has served us well.
But it has now been over six years since Go 1.4. Much has happened in the world of Go, and many bugs have been fixed. Many of the systems Go runs on today aren't supported by Go 1.4 (including darwin/arm64 for M1 Macs). Those are using newer toolchains to bootstrap, and the other systems could too. At a higher level, Go is far more mature and widely available now than it was in the Go 1.4 era. There are tons of available binary distributions to use for bootstrapping.
I propose that Go 1.17 be the last version of Go requiring Go 1.4 for bootstrapping, and that Go 1.18 require Go 1.16 for bootstrapping.
Go 1.16 would remain the bootstrap version for the next few years at least.
Why not Go 1.15?
//go:build
support. We don't want the compiler to have to keep using+build
even once the Go world has moved on. (Edit: this is only half true: see build: adopt Go 1.17 as bootstrap toolchain for Go 1.20 #44505 (comment).)Why not Go 1.17?
which would still work with Go 1.4.
(See next section.)
Why not Go 1.18?
Why not a quickly rolling version?
As noted above, I think it has served us well to have a fixed version required to build Go, as opposed to an automatically sliding version as originally envisioned. Packagers benefit from not having to update their package-building scripts to provide a different environment to each new Go release.
At the same time, bumping the version forward every five years or so lets us take advantage of newer Go capabilities and ports and to let us retire old compatibility shims (standard library packages like sort are carrying various +build'ed files to keep them building with Go 1.4). Modern C compilers are not written in pre-ANSI C.
What about a slow-rolling version?
That's essentially what this proposal would establish as our practice, although without a specific timeline.
The next obvious entry in the sequence after Go 1.4 and Go 1.16 is Go 1.256, followed by Go 1.65536.
(Or perhaps that is not quite the right pattern to establish.)
Using dates instead, assuming we switch to Go 1.16 in Go 1.18 (Feb 2022), it seems reasonable to me to revisit the bootstrap version four years later, which at our current release cycle would mean using Go 1.24 (Feb 2025) for Go 1.26 (Feb 2026).
But this proposal is not about establishing the sequence, which would depend on many other factors.
It is only about picking Go 1.16 as the bootstrap version starting in Go 1.18.
The text was updated successfully, but these errors were encountered: