Skip to content

[25.12] golang: add support for multiple versions#28446

Merged
GeorgeSapkin merged 5 commits intoopenwrt:openwrt-25.12from
GeorgeSapkin:25.12/golang-support-multiple-versions
Jan 29, 2026
Merged

[25.12] golang: add support for multiple versions#28446
GeorgeSapkin merged 5 commits intoopenwrt:openwrt-25.12from
GeorgeSapkin:25.12/golang-support-multiple-versions

Conversation

@GeorgeSapkin
Copy link
Member

📦 Package Details

Maintainer: me

Description:

Backport #28378 and #28309 to 25.12


🧪 Run Testing Details

  • OpenWrt Version: 25.12-rc3
  • OpenWrt Target/Subtarget: x86/64
  • OpenWrt Device: QEMU

✅ Formalities

  • I have reviewed the CONTRIBUTING.md file for detailed contributing guidelines.

smallprogram and others added 5 commits January 29, 2026 03:26
Fixes: CVE-2025-61726
Fixes: CVE-2025-61728
Fixes: CVE-2025-61730
Fixes: CVE-2025-61731
Fixes: CVE-2025-68119
Fixes: CVE-2025-68121
Link: https://github.com/golang/go/issues?q=milestone%3AGo1.25.6+label%3ACherryPickApproved
Signed-off-by: David Mandy <smallprogramzhusir@gmail.com>
(cherry picked from commit dbaeeb3)
Signed-off-by: George Sapkin <george@sapk.in>
Link: https://spdx.org/licenses/GPL-2.0-only.html
Link: openwrt#28309
Signed-off-by: George Sapkin <george@sapk.in>
(cherry picked from commit 51aa478)
Split bootstrap into a new package to enable multiple versions of go to
reuse the same bootstrap.

Add more source mirrors.

Link: openwrt#28309
Signed-off-by: George Sapkin <george@sapk.in>
(cherry picked from commit 662972a)
Add versioned package for 1.25 to enable having multiple host go
versions side by side.

Set default version to 1.25 in golang-values.mk

Add unversioned dummy package to allow go-based packages to continue
using the default go host version. Packages can use it by specifying:

PKG_BUILD_DEPENDS:=golang/host

or use a specific version out of the ones that are available in that
branch by specifying:

PKG_BUILD_DEPENDS:=golang1.25/host

Host go is exposed to each package through PATH set in
GO_PKG_BUILD_CONFIG_VARS and GO_PKG_VARS.

Target go is installed through alternatives with the default version
having higher priority.

Newer versions can reuse older ones as bootstraps by setting
GO_BOOTSTRAP_VERSION package variable to older version, e.g.:

GO_BOOTSTRAP_VERSION:=1.24

All subpackages provide suffix-less names, e.g. golang, golang-src, etc.
Default versions are marked as default variants.

Link: openwrt#28309
Signed-off-by: George Sapkin <george@sapk.in>
(cherry picked from commit ca501ee)
Move version definition to a helper file so multiple versions can be
easily defined using it.

Variables HOST_GO_VARS, PKG_GO_ASMFLAGS, PKG_GO_GCFLAGS,
PKG_GO_INSTALL_ARGS, PKG_GO_LDFLAGS, PKG_GO_VARS, and
PKG_GO_ZBOOTSTRAP_MODS are defined using conditional variable
assignment and can be overridden for each go version.

Link: openwrt#28309
Signed-off-by: George Sapkin <george@sapk.in>
(cherry picked from commit 8958c99)
@github-actions github-actions bot added OpenWrt 25.12 Issues/PR on branch 25.12 Add package labels Jan 29, 2026
@GeorgeSapkin GeorgeSapkin merged commit c9b3dc2 into openwrt:openwrt-25.12 Jan 29, 2026
12 checks passed
@GeorgeSapkin GeorgeSapkin deleted the 25.12/golang-support-multiple-versions branch January 29, 2026 06:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Add package OpenWrt 25.12 Issues/PR on branch 25.12

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants