feat(ms-golang): add Microsoft build of Go as a golang-providing package - #18256
Draft
liunan-ms wants to merge 1 commit into
Draft
feat(ms-golang): add Microsoft build of Go as a golang-providing package#18256liunan-ms wants to merge 1 commit into
liunan-ms wants to merge 1 commit into
Conversation
Introduce ms-golang for Azure Linux 4.0 using a local spec ported from the
3.0-dev golang.spec (the Microsoft build of Go). It Provides golang and
Conflicts with the Fedora upstream golang package so the two cannot be
co-installed.
Spec adjustments for AzL 4.0:
- Reference bootstrap trees via %{_builddir} (RPM >= 4.20 per-package build subdir).
- Build the go1.4 C bootstrap with -std=gnu17 (C23 'bool' keyword breaks -Werror).
- Stage the rolling bootstrap under %{_builddir} (unprivileged mock cannot write /usr/lib64).
- Add BuildRequires: gcc, glibc-devel (minimal buildroot).
- Disable auto find-provides to drop spurious test-data SONAMEs (e.g. libtiffxx.so.6).
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Microsoft’s Go build as an alternative golang provider for Azure Linux 4.0.
Changes:
- Adds the local
ms-golangcomponent and six source archives. - Builds a rolling bootstrap toolchain for x86_64 and AArch64.
- Provides
golangwhile conflicting with Fedora’s package.
Reviewed changes
Copilot reviewed 6 out of 9 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
base/comps/ms-golang/ms-golang.comp.toml |
Defines the component and sources. |
base/comps/ms-golang/ms-golang.spec |
Packages and builds Microsoft Go. |
base/comps/ms-golang/go14_bootstrap_aarch64.patch |
Enables AArch64 bootstrap detection. |
locks/ms-golang.lock |
Records the component fingerprint. |
specs/m/ms-golang/ms-golang.spec |
Contains the rendered RPM spec. |
specs/m/ms-golang/go14_bootstrap_aarch64.patch |
Contains the rendered bootstrap patch. |
specs/m/ms-golang/sources |
Records rendered source checksums. |
| # and a hand-written %changelog, so release.calculation is "manual". | ||
| [components.ms-golang] | ||
| spec = { type = "local", path = "ms-golang.spec" } | ||
| release = { calculation = "manual" } |
Comment on lines
+177
to
+183
| %postun | ||
| /sbin/ldconfig | ||
| if [ $1 -eq 0 ]; then | ||
| # This is uninstall | ||
| rm -rf /opt/go | ||
| exit 0 | ||
| fi |
|
|
||
| export GOROOT="`pwd`" | ||
| export GOPATH=%{gopath} | ||
| export GOROOT_FINAL=%{_bindir}/go |
| rm -f %{gopath}/src/runtime/*.c | ||
| ( | ||
| cd src | ||
| ./make.bash --no-clean |
Comment on lines
+53
to
+54
| BuildRequires: gcc | ||
| BuildRequires: glibc-devel |
| Name: ms-golang | ||
| Version: 1.26.5 | ||
| Release: 3%{?dist} | ||
| License: BSD-3-Clause |
reubeno
reviewed
Jul 30, 2026
| # - 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 |
Member
There was a problem hiding this comment.
@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?)
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Adds
ms-golangto the Azure Linux 4.0 branch: the Microsoft build of Go, packaged from a local spec ported from the 3.0-devgolang.spec.Azure Linux 4.0 already ships Fedora's upstream
golang. This introduces the Microsoft build alongside it as a distinct package that:ms-golang(rather thangolang),Provides: golangso it can satisfygolangdependencies, andConflicts: golangso it cannot be co-installed with the Fedoragolangpackage.It is maintained as a local spec (not available in Fedora) with
release.calculation = "manual"(staticRelease:+ hand-written%changelog). The six Go source tarballs are referenced directly from the publicgithub.com/microsoft/goreleases.Spec adjustments for AzL 4.0
The 3.0-dev spec assumed an older RPM and a root build environment; the following changes make it build under AzL 4.0's RPM 4.20 + unprivileged mock:
%{_builddir}instead of%{_topdir}/BUILD, since RPM ≥ 4.20 builds inside a per-package subdirectory.-std=gnu17; modern gcc defaults to-std=gnu23whereboolis a keyword, which breaks go1.4'stypedef int bool;under-Werror.%{_builddir}instead of%{_libdir}/golang; unprivileged mock builds cannot write to/usr/lib64.gccandglibc-devel, which the minimal AzL 4.0 buildroot does not provide implicitly.libtiffxx.so.6) are not exposed as package SONAME Provides; the real interfaces are declared explicitly.Validation
Build succeeds and produces
ms-golang-1.26.5-3.azl4.x86_64.rpm.Package metadata:
Functional smoke test in a mock chroot: