Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30,057 changes: 30,057 additions & 0 deletions base/comps/ms-golang/CVE-2026-39821.patch

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions base/comps/ms-golang/go14_bootstrap_aarch64.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff -Naur ./go/src/cmd/dist/unix.c ./go_/src/cmd/dist/unix.c
--- ./go/src/cmd/dist/unix.c 2017-11-21 17:33:56.000000000 -0800
+++ ./go_/src/cmd/dist/unix.c 2020-02-05 22:40:39.501947515 -0800
@@ -706,7 +706,7 @@
gohostarch = "amd64";
else if(hassuffix(u.machine, "86"))
gohostarch = "386";
- else if(contains(u.machine, "arm"))
+ else if(contains(u.machine, "arm") || contains(u.machine, "aarch64"))
gohostarch = "arm";
else
fatal("unknown architecture: %s", u.machine);
54 changes: 54 additions & 0 deletions base/comps/ms-golang/ms-golang.comp.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# ms-golang — the Microsoft build of Go (https://github.com/microsoft/go).
# Azure Linux 4.0 ships Fedora's upstream `golang`; this component adds the Microsoft
# build alongside it as a distinct package named `ms-golang`. The spec is a local copy
# of the AzL 3.0-dev golang.spec, adjusted to:
# - build as `ms-golang` (instead of `golang`),
# - keep `Provides: golang` so it can satisfy golang dependencies, and
# - `Conflicts: golang` so it cannot be installed alongside the Fedora golang package.
# Maintained as a local spec (not available upstream in Fedora); uses a static Release

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@liunan-ms What's the trade-off you see of maintaining it locally vs. trying to adapt the upstream Feodora spec to build the MSFT sources/config? (Are they that different that it necessitates diverging?)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean using the Fedora spec and adding overlays to point to MS sources/config? If yes, we'll add a large set of overlays to rewrite Source*, %prep, the crypto config, and the bootstrap model (ms-golang uses 5-stage C bootstrap), also since Fedora spec defines a lot more macros it may break whenever Fedora refactors its Go macros, so a clean local spec might be easier to maintain.

One heavy part in the local spec that I think we can drop but not sure is the staged bootstrap from C which come from the ms-golang spec on 3.0-dev, since Fedora Go already exists on 4.0, adding BuildRequires: golang >= 1.24 would pull Fedora's golang into the buildroot instead. It built successfully and has the same crypto behavior.

trying to adapt the upstream Feodora spec to build the MSFT sources/config?

# and a hand-written %changelog, so release.calculation is "manual".
[components.ms-golang]
spec = { type = "local", path = "ms-golang.spec" }
release = { calculation = "manual" }

# Source0 — Microsoft build of Go source tarball.
[[components.ms-golang.source-files]]
filename = "go1.26.5-20260709.6.src.tar.gz"
hash = "52aafddac2d7c6245d7759e65021197dc385732d4a7aefb4f15f064d0e3babfe"
hash-type = "SHA256"
origin = { type = "download", uri = "https://github.com/microsoft/go/releases/download/v1.26.5-2/go1.26.5-20260709.6.src.tar.gz" }

# Source1 — bootstrap 00 (Go 1.4, C-bootstrappable).
[[components.ms-golang.source-files]]
filename = "go1.4-bootstrap-20171003.tar.gz"
hash = "f4ff5b5eb3a3cae1c993723f3eab519c5bae18866b5e5f96fe1102f0cb5c3e52"
hash-type = "SHA256"
origin = { type = "download", uri = "https://github.com/microsoft/go/releases/download/v1.4.0-1/go1.4-bootstrap-20171003.tar.gz" }

# Source2 — bootstrap 01.
[[components.ms-golang.source-files]]
filename = "go.20230802.5.src.tar.gz"
hash = "56b9e0e0c3c13ca95d5efa6de4e7d49a9d190eca77919beff99d33cd3fa74e95"
hash-type = "SHA256"
origin = { type = "download", uri = "https://github.com/microsoft/go/releases/download/v1.19.12-1/go.20230802.5.src.tar.gz" }

# Source3 — bootstrap 02.
[[components.ms-golang.source-files]]
filename = "go.20240206.2.src.tar.gz"
hash = "7982e0011aa9ab95fd0530404060410af4ba57326d26818690f334fdcb6451cd"
hash-type = "SHA256"
origin = { type = "download", uri = "https://github.com/microsoft/go/releases/download/v1.20.14-1/go.20240206.2.src.tar.gz" }

# Source4 — bootstrap 03.
[[components.ms-golang.source-files]]
filename = "go1.22.12-20250211.4.src.tar.gz"
hash = "e1cc3bff8fdf1f24843ffc9f0eaddfd344eb40fd9ca0d9ba2965165be519eeb7"
hash-type = "SHA256"
origin = { type = "download", uri = "https://github.com/microsoft/go/releases/download/v1.22.12-2/go1.22.12-20250211.4.src.tar.gz" }

# Source5 — bootstrap 04.
[[components.ms-golang.source-files]]
filename = "go1.24.13-20260204.5.src.tar.gz"
hash = "fdf4ec44d7191e59890e988ffba8ab3fd133ec6bd3757955223712f369e2328b"
hash-type = "SHA256"
origin = { type = "download", uri = "https://github.com/microsoft/go/releases/download/v1.24.13-1/go1.24.13-20260204.5.src.tar.gz" }
Loading
Loading