Skip to content

fix(swig,libcap): adapt Go dependents to the Microsoft Go toolchain - #18361

Draft
Nan Liu (liunan-ms) wants to merge 1 commit into
4.0from
liunan/golang-dependent-fixes
Draft

fix(swig,libcap): adapt Go dependents to the Microsoft Go toolchain#18361
Nan Liu (liunan-ms) wants to merge 1 commit into
4.0from
liunan/golang-dependent-fixes

Conversation

@liunan-ms

@liunan-ms Nan Liu (liunan-ms) commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Adapts two golang dependents to the Microsoft build of Go toolchain that Azure Linux 4.0 is moving to (see #18360). Microsoft build of Go is built with %global shared 0 and a baseline systemcrypto (OpenSSL) backend that requires cgo, which breaks swig and libcap.

Changes

Component Fix Why
swig Drop BuildRequires: golang-shared (spec-remove-tag) Microsoft build of Go ships no golang-shared subpackage; SWIG's Go examples build with plain cgo-enabled go build and never link the shared stdlib, so the tag is unsatisfiable and unused.
libcap %check: make testmake test CGO_REQUIRED=1 (spec-search-replace) libcap's go/cgo-required.sh returns 0 on Go ≥ 1.16, running the psx/cap Go tests with CGO_ENABLED=0; Microsoft build of 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.

Both components move from inline stubs in components.toml to dedicated *.comp.toml files and define each overlay as a per-file overlays/*.overlay.toml.

Validation

  • libcap — full build with %check passes; libcap-2.76-5.azl4 produced, and the psx/cap Go self-tests build and run with cgo enabled.
  • swig — full build cleanly with golang-shared removed; the Go example test-suite builds against Microsoft build of Go (validated during toolchain bring-up).
  • Locks and rendered specs are self-consistent (Check Rendered Specs / Update Locks clean).

Related

Draft: opening for early CI/review.

Copilot AI balanced review requested due to automatic review settings August 7, 2026 23:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adapts SWIG and libcap to Azure Linux’s Microsoft Go toolchain.

Changes:

  • Removes SWIG’s unavailable golang-shared dependency.
  • 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.

Comment thread base/comps/swig/swig.comp.toml Outdated
Comment thread base/comps/libcap/libcap.comp.toml Outdated
Comment thread base/comps/swig/swig.comp.toml Outdated
Comment thread base/comps/libcap/libcap.comp.toml Outdated
…olchain

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
  build of 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 build of 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.

Give both components dedicated *.comp.toml files and define each overlay as a
per-file overlays/*.overlay.toml document (carrying [metadata]) that azldev
auto-discovers, rather than inlining the overlays in the comp.toml.
Copilot AI review requested due to automatic review settings August 10, 2026 23:19
@liunan-ms
Nan Liu (liunan-ms) force-pushed the liunan/golang-dependent-fixes branch from e04afdb to 4c0029b Compare August 10, 2026 23:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 9 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants