fix(swig,libcap): adapt Go dependents to the Microsoft Go toolchain - #18361
Draft
Nan Liu (liunan-ms) wants to merge 1 commit into
Draft
fix(swig,libcap): adapt Go dependents to the Microsoft Go toolchain#18361Nan Liu (liunan-ms) wants to merge 1 commit into
Nan Liu (liunan-ms) wants to merge 1 commit into
Conversation
Azure Linux's golang is now the Microsoft build of Go, built with `%global shared 0` and a baseline systemcrypto (OpenSSL) backend that requires cgo. That breaks two golang dependents: - swig: drop the unsatisfiable `BuildRequires: golang-shared`. Microsoft Go ships no golang-shared subpackage, and SWIG's Go examples build with plain cgo-enabled `go build` and never link the shared stdlib, so the tag is both unsatisfiable and unnecessary. - libcap: force `CGO_REQUIRED=1` in %check. libcap's go/cgo-required.sh returns 0 on Go >= 1.16, making `make test` run the psx/cap Go tests with CGO_ENABLED=0; Microsoft Go's systemcrypto backend requires cgo, so those compiles fail. A command-line make variable overrides the makefile's ':=' value and propagates to the go/ sub-make. Move both components from inline stubs in components.toml to dedicated *.comp.toml files that carry the overlays.
Contributor
There was a problem hiding this comment.
Pull request overview
Adapts SWIG and libcap to Azure Linux’s Microsoft Go toolchain.
Changes:
- Removes SWIG’s unavailable
golang-shareddependency. - Forces cgo for libcap’s Go tests.
- Refreshes component definitions, locks, and rendered specs.
Reviewed changes
Copilot reviewed 5 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
base/comps/swig/swig.comp.toml |
Adds the SWIG dependency overlay. |
base/comps/libcap/libcap.comp.toml |
Adds the libcap cgo test overlay. |
base/comps/components.toml |
Removes obsolete inline entries. |
specs/s/swig/swig.spec |
Renders the SWIG dependency removal. |
specs/l/libcap/libcap.spec |
Renders cgo-enabled tests. |
locks/swig.lock |
Refreshes SWIG’s fingerprint. |
locks/libcap.lock |
Refreshes libcap’s fingerprint. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| # unsatisfiable and unnecessary. | ||
| [components.swig] | ||
| overlays = [ | ||
| { description = "Drop the golang-shared BuildRequires: Microsoft Go provides no golang-shared subpackage and SWIG's Go examples don't use the shared stdlib", type = "spec-remove-tag", tag = "BuildRequires", value = "golang-shared" }, |
| # propagates to the go/ sub-make). | ||
| [components.libcap] | ||
| overlays = [ | ||
| { description = "Run libcap's Go self-tests with cgo enabled (CGO_REQUIRED=1): Microsoft Go's systemcrypto backend requires cgo, so the default CGO_ENABLED=0 psx/cap tests fail to compile crypto", type = "spec-search-replace", section = "%check", regex = '^make test$', replacement = "make test CGO_REQUIRED=1" }, |
| # cgo-enabled `go build` and never link the shared stdlib, so this BuildRequires is | ||
| # unsatisfiable and unnecessary. | ||
| [components.swig] | ||
| overlays = [ |
| # enabled (a command-line make variable overrides the makefile's ':=' value and | ||
| # propagates to the go/ sub-make). | ||
| [components.libcap] | ||
| overlays = [ |
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
Adapts two golang dependents to the Microsoft Go toolchain that Azure Linux 4.0 is moving to (see #18360). Microsoft Go is built with
%global shared 0and a baselinesystemcrypto(OpenSSL) backend that requires cgo, which breaksswigandlibcap.Changes
swigBuildRequires: golang-shared(spec-remove-tag)golang-sharedsubpackage; SWIG's Go examples build with plain cgo-enabledgo buildand never link the shared stdlib, so the tag is unsatisfiable and unused.libcap%check:make test→make test CGO_REQUIRED=1(spec-search-replace)go/cgo-required.shreturns0on Go ≥ 1.16, running the psx/cap Go tests withCGO_ENABLED=0; Microsoft Go's systemcrypto backend requires cgo, so those compiles fail. A command-line make variable overrides the makefile's:=value and propagates to thego/sub-make.Both components move from inline stubs in
components.tomlto dedicated*.comp.tomlfiles carrying the overlays.Validation
%checkpasses;libcap-2.76-5.azl4produced, and the psx/cap Go self-tests build and run with cgo enabled.golang-sharedremoved; the Go example test-suite builds against Microsoft Go (validated during toolchain bring-up).Check Rendered Specs/Update Locksclean).Related
swigdrops an unusedBuildRequires, andlibcapforces cgo tests that already pass — so this PR is safe to merge in either order.