fix(butane,ignition): disable systemcrypto on CGO_ENABLED=0 static cross-builds - #18550
Open
Nan Liu (liunan-ms) wants to merge 1 commit into
Open
fix(butane,ignition): disable systemcrypto on CGO_ENABLED=0 static cross-builds#18550Nan Liu (liunan-ms) wants to merge 1 commit into
Nan Liu (liunan-ms) wants to merge 1 commit into
Conversation
…oss-builds Azure Linux 4.0's golang is the Microsoft build of Go, whose systemcrypto (OpenSSL) backend is baseline-enabled for Linux targets. Both packages build their native binary fine, then cross-compile static -redistributable Linux binaries with CGO_ENABLED=0. In that configuration the OpenSSL backend file is excluded (no cgo) while the nobackend fallback is also excluded (systemcrypto stays enabled), so crypto/internal/backend/fips140 references systemFIPSMode/backendEnabled with no file defining them and the build fails. Set MS_GO_NOSYSTEMCRYPTO=1 on those cgo-free static cross-builds so the pure-Go crypto implementation is used, keeping the redistributable binaries self-contained (no runtime OpenSSL). MS_GO_NOSYSTEMCRYPTO=1 is the documented, forward-compatible knob (Go 1.25.2 through 1.27+); GOEXPERIMENT=nosystemcrypto is removed and rejected in Go 1.27. ignition's GOEXPERIMENT= (empty) did not clear the platform baseline; butane supplied no override at all. The darwin/windows cross-builds and ignition's native strictfipsruntime binary are untouched. Overlays are per-file documents under each component's overlays/ directory; both components move from inline entries in components.toml to dedicated comp.toml files so the overlays are discovered.
Contributor
There was a problem hiding this comment.
Pull request overview
Disables Microsoft Go systemcrypto for static, cgo-free Butane and Ignition cross-builds.
Changes:
- Adds targeted component overlays.
- Moves customized components into dedicated definitions.
- Refreshes locks and rendered specs.
Reviewed changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
base/comps/components.toml |
Removes inline component entries. |
base/comps/butane/butane.comp.toml |
Adds dedicated Butane definition. |
base/comps/butane/overlays/0001-disable-systemcrypto-static-cross-builds.overlay.toml |
Defines Butane workaround. |
base/comps/ignition/ignition.comp.toml |
Adds dedicated Ignition definition. |
base/comps/ignition/overlays/0001-disable-systemcrypto-static-cross-builds.overlay.toml |
Defines Ignition workaround. |
locks/butane.lock |
Refreshes Butane fingerprint. |
locks/ignition.lock |
Refreshes Ignition fingerprint. |
specs/b/butane/butane.spec |
Applies workaround and release bump. |
specs/i/ignition/ignition.spec |
Applies workaround and release bump. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Contributor
Author
|
/azp run |
|
Azure Pipelines: 2 pipeline(s) were filtered out due to trigger conditions. |
Nan Liu (liunan-ms)
marked this pull request as ready for review
August 21, 2026 22:33
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.
Summary
Azure Linux 4.0's
golangis the Microsoft build of Go, whose systemcrypto (OpenSSL) backend is baseline-enabled for Linux.butaneandignitionbuild their native binary fine, then cross-compile static-redistributableLinux binaries withCGO_ENABLED=0. In that config the OpenSSL backend file is excluded (no cgo, and thems_nocgo_opensslcryptoexperiment isn't set) and the pure-Gonobackendfallback is excluded (systemcrypto stays enabled), socrypto/internal/backend/fips140referencessystemFIPSMode/backendEnabledwith no file defining them → build fails.Fix: set
MS_GO_NOSYSTEMCRYPTO=1on those cgo-free static cross-builds so the pure-Go crypto implementation is selected, keeping the redistributable binaries self-contained (no runtime OpenSSL dependency).Changes
butane,ignition*.comp.toml+ per-fileoverlays/0001-disable-systemcrypto-static-cross-builds.overlay.toml; removed inline entries fromcomponents.tomlspec-search-replacein%build, prependingMS_GO_NOSYSTEMCRYPTO=1to the fourGOOS=linux CGO_ENABLED=0cross-build lines onlycategory = "azl-compatibility",upstream-status = "inapplicable"Why
MS_GO_NOSYSTEMCRYPTO=1and notGOEXPERIMENT=nosystemcrypto: it is the documented, forward-compatible knob (supported Go 1.25.2 → 1.27+), whereasGOEXPERIMENT=nosystemcryptois removed and rejected with an error in Go 1.27. Ref: MS Go FIPS README — build option to use Go crypto.Untouched on purpose: the
darwin/windowscross-builds (non-Linux, systemcrypto baseline N/A) and ignition's nativeGOEXPERIMENT=strictfipsruntimebinary (the on-system, FIPS-strict initramfs binary). Only the portable redistributable validators become pure-Go/non-FIPS.Validation
Locally built and validated against the Microsoft build of Go 1.26.5 (the toolchain that reproduces the failure; the local repo golang RPM
Provides: msft-golang), viaazldev comp build -p <name> --local-repo <ms-go-repo>:butanebutane-redistributable-0.26.0-*.azl4.noarch.rpmignitionignition-validate-redistributable-2.26.0-*.azl4.noarch.rpmarm64 static binary inspection (extracted from the redistributable RPMs):
butane-aarch64-unknown-linux-gnu-static→ELF 64-bit LSB executable, ARM aarch64, statically linked,go1.26.5ignition-validate-aarch64-unknown-linux-gnu-static→ELF 64-bit LSB executable, ARM aarch64, statically linked,go1.26.5The previously-failing
CGO_ENABLED=0aarch64 static builds now compile and link cleanly as self-contained pure-Go binaries (nolibcrypto.so.3/OpenSSL runtime dependency).Runnable smoke test (mock chroot)
Installed the emitted
-redistributableRPMs inazldev adv mock shell, staged the x86_64 static payloads (chmod 0755, since they ship as0644data files under/usr/share/), and executed them. Binaries built withMS_GO_NOSYSTEMCRYPTO=1.Result: both
x86_64-unknown-linux-gnu-staticbinaries run standalone, are truly static (not a dynamic executable— nolibcrypto.so.3/OpenSSL dependency), and perform their real work — Butane transpiles a config and Ignition-validate both accepts a good config and rejects a bad one. Crucially, startup does not panic, confirming the pure-Go crypto path selected byMS_GO_NOSYSTEMCRYPTO=1initializes correctly with no crypto backend present.