Bug 15095

Summary: recipes-devtools/go-1.20 native: not possible to build with go 1.4
Product: [Build System, Metadata & Runtime] OE-Core Reporter: jonas.licht
Component: devtools / tool chainAssignee: Unassigned <unassigned>
Status: RESOLVED INVALID QA Contact:
Severity: normal    
Priority: Medium+ CC: meta.mr.watcher, meta.watcher, randy.macleod, sakib.sajal, tgamblin
Version: unspecified   
Target Milestone: 5.1 M2   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description jonas.licht 2023-04-05 08:57:35 UTC
To bootstrap golang version 1.20 at least Go 1.17.13 is required. https://go.dev/doc/go1.20#bootstrap

So trying to build go-native-1.20.1-r0 fails with:
| DEBUG: Executing shell function do_compile
| Building Go cmd/dist using /home/bitbake/oe-build/build/tmp/work/x86_64-linux/go-native/1.20.1-r0/go1.4/go. (go1.4-bootstrap-20170531 linux/amd64)
| can't load package: package ./cmd/dist: found packages build.go (main) and notgo117.go (building_Go_requires_Go_1_17_13_or_later) in /home/bitbake/oe-build/build/tmp/work/x86_64-linux/go-native/1.20.1-r0/go/src/cmd/dist
| WARNING: exit code 1 from a shell command.
| ERROR: Execution of '/home/bitbake/oe-build/build/tmp/work/x86_64-linux/go-native/1.20.1-r0/temp/run.do_compile.4163319' failed with exit code 1
Comment 1 Randy MacLeod 2023-04-06 14:46:36 UTC
The bootstrap mechanism seems to use the same PV when building go so it's not clear how you are encountering this problem. Can you explain how to reproduce the issue in detail?
Comment 2 jonas.licht 2023-04-11 08:47:35 UTC
(In reply to Randy MacLeod from comment #1)
> The bootstrap mechanism seems to use the same PV when building go so it's
> not clear how you are encountering this problem. Can you explain how to
> reproduce the issue in detail?

Did you have some e.g. docker environment for a yocto example build to demonstrate the issue?

If I look into the go-native_1.20.1.bb it says in it's comment to first build go1.4 as the bootstrap version [0].
Buildroot is encountering some simualr error [1].

However, you can avoid to build you native go with the bootstrapping version by using the go-binary-native recipe.
Therefor I need to set PREFERRED_PROVIDER_go-native = "go-binary-native"


[0] https://github.com/openembedded/openembedded-core/blob/master/meta/recipes-devtools/go/go-native_1.20.1.bb
[1] https://lore.kernel.org/buildroot/CA+h8R2rtcynkCBsz=_9yANOEguyPCOcQDj8_ns+cv8RS8+8t9A@mail.gmail.com/T/
Comment 3 Randy MacLeod 2023-04-13 14:59:22 UTC
Movign to unassigned. Jonas, you want to work on this go for it.
Comment 4 jonas.licht 2023-04-14 15:03:20 UTC
(In reply to Randy MacLeod from comment #3)
> Movign to unassigned. Jonas, you want to work on this go for it.

I think the best solution would be to build the go-native directly with gccgo.
But this will require at least gcc version 12 and this will limit the supported Ubuntu version to 22.04 and above.

Another way could be a multistage bootstrapping, so building some intermediate version. But I think this will be a never ending storie.
Comment 5 Randy MacLeod 2023-07-26 21:22:02 UTC
Bulk move of 64 bugs to 4.3 M3 after a quick review.
If a bug is actually fixed, please add a commit link and resolve it.
-- Randy for YP bug team.
Comment 6 Trevor Gamblin 2023-09-14 16:53:44 UTC
Moved to M4.
Comment 7 Randy MacLeod 2023-10-30 15:29:11 UTC
Bulk move to 5.0 M1. -- Randy
Comment 8 Randy MacLeod 2023-12-21 23:28:27 UTC
Bulk move of 52 5.0-M1 bugs to M2.
Comment 9 Randy MacLeod 2024-01-25 14:28:53 UTC
Bulk move of bugs owned by "unassigned" from 5.0-M2 to 5.0-M3.
Comment 10 Randy MacLeod 2024-07-25 15:04:44 UTC
We deleted the 1.4 recipe so this is no longer a valid bug.