-
Notifications
You must be signed in to change notification settings - Fork 689
feat(ms-golang): add Microsoft build of Go as a golang-providing package #18256
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
Draft
liunan-ms
wants to merge
1
commit into
4.0
Choose a base branch
from
liunan/ms-golang
base: 4.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| # 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" } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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?)
There was a problem hiding this comment.
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.24would pull Fedora's golang into the buildroot instead. It built successfully and has the same crypto behavior.