[Buildroot] Go 1.20 changes required in Buildroot

Christian Stewart christian at paral.in
Thu Feb 2 08:49:50 UTC 2023


Hi all,

Go 1.20 includes a change which breaks our build infra for go in Buildroot:

https://go.dev/doc/go1.20#bootstrap

The minimum required version of go-bootstrap is now go 1.17.13 or later.

Otherwise the build fails with this error:

building_Go_requires_Go_1_17_13_or_later

As Go 1.4 was the previous version that could be compiled with C,
there is now no way to bootstrap go with a C compiler.

... unless a process like this is used:

 - build host-go-bootstrap-1.4-20170531
 - build host-go-bootstrap-1.19.5 with go1.4-bootstrap
 - build host-go-1.20 with host-go-bootstrap-1.19.5

... which could be viable for Buildroot, at least for now.

Previous discussion on this:

https://lore.kernel.org/all/20220525234312.643dfc03@windsurf/T/

An existing patch is still Pending Review which fixes a separate but
related issue: we cannot build go-bootstrap-1.4 on arm64. The proposed
fix above would still not work correctly on arm64. That patch linked
above fixes this issue by using a Go compiler installed on the host
machine (/usr/bin/go) to bootstrap host-go in that case.

I'll send a patch soon which upgrades to go1.20 using the above
3-stage bootstrap process. It's not pretty, but it will work for now.

A potentially cleaner solution would be to bootstrap with gccgo, or
depend on the host Go binaries to bootstrap (as linked above), or to
download pre-compiled binaries to bootstrap.

Best regards,
Christian Stewart

---------- Forwarded message ---------
From: 'Michael Knyszek' via golang-nuts <golang-nuts at googlegroups.com>
Date: Wed, Feb 1, 2023 at 11:36 AM
Subject: [go-nuts] Go 1.20 is released
To: <golang-announce at googlegroups.com>
Cc: golang-dev <golang-dev at googlegroups.com>, golang-nuts
<golang-nuts at googlegroups.com>


Hello gophers,

We have just released Go 1.20.

To find out what has changed in Go 1.20, read the release notes:
https://go.dev/doc/go1.20

You can download binary and source distributions from our download page:
https://go.dev/dl/#go1.20

If you have Go installed already, an easy way to try go1.20
is by using the go command:
$ go install golang.org/dl/go1.20 at latest
$ go1.20 download

To compile from source using a Git clone, update to the release with
git checkout go1.20 and build as usual.

Thanks to everyone who contributed to the release!

Cheers,
Michael, Matthew, and Dmitri for the Go team



More information about the buildroot mailing list