Skip to content

Feat/linux musl host rid - #43

Open
YOU54F wants to merge 7 commits into
masterfrom
feat/linux-musl-host-rid
Open

YOU54F wants to merge 7 commits into
masterfrom
feat/linux-musl-host-rid

Conversation

@YOU54F

@YOU54F YOU54F commented Nov 12, 2026

Copy link
Copy Markdown
Owner

Summary

Adds support for musl-based Linux distributions (e.g. Alpine) on x64 and arm64.

Changes

  • Native libraries: the musl builds of libpact_ffi.so are downloaded alongside the existing ones and packed under runtimes/linux-musl-x64/native and runtimes/linux-musl-arm64/native. These are the standard .NET RIDs, so the .NET host selects the right library at run time for package consumers, with no detection logic needed in PactNet.
  • In-repo builds: project references don't use runtimes/ assets, so the library matching the build machine is still copied to the output directory. This is now driven by a single PactNetHostRid property taken from the SDK's own portable runtime identifier (NETCoreSdkPortableRuntimeIdentifier), which already distinguishes glibc (linux-x64, linux-arm64) from musl (linux-musl-x64, linux-musl-arm64). It replaces the previous IsWindows / IsLinux / IsOSX / IsArm64 properties.
  • Download script: checksum verification uses plain sha256sum -c, which works with both GNU coreutils and BusyBox.
  • CI: adds a container job that builds and tests on x64 and arm64 runners in the Debian-based dotnet/sdk:8.0 image and Alpine 3.21–3.24 images. macOS runners move to macos-15 / macos-15-intel.
  • README: the support table now lists Linux (musl) as supported.

Testing

Ran locally on arm64 in mcr.microsoft.com/dotnet/sdk:8.0 and mcr.microsoft.com/dotnet/sdk:8.0-alpine:

  • build/download-native-libs.sh verifies and extracts all seven libraries on both.
  • dotnet test passes on both (203 tests), with the musl library in the test output on Alpine and the glibc library on Debian.
  • A console app consuming the packed PactNet nupkg via PackageReference runs a mock-server interaction and loads runtimes/linux-musl-arm64/native/libpact_ffi.so on Alpine and runtimes/linux-arm64/native/libpact_ffi.so on Debian.

Updates the underlying Rust core from libpact_ffi 0.4.27 to 0.5.13, which
moves the mock server to pact_mock_server v2 and brings a suite of
improvements and bug fixes, including repeated custom headers continuing
to match (pact-foundation/pact-reference#602).

- Download pact_ffi from the cargo-dist `pact_ffi-v<version>` release:
  per-target .tar.xz/.zip archives, sha256 verified, with the shared
  library extracted to the same build/<os>/<arch>/ paths.
- Refresh pact metadata to ffi 0.5.13 / models 1.3.18.
…SDK 11

The ubuntu-24.04-arm runner image now ships .NET SDK 11.0.100, which is
picked over the setup-dotnet 8.0.x install. SDK 11 generates hot reload
browser-tools static web assets for Web SDK projects in Debug, and the
build then fails with "scoped css bundles do not have matching endpoints".
- use .NET SDK's own portable runtime
identifier, which already distinguishes glibc (linux-x64/arm64) from
musl (linux-musl-x64/arm64).
- Simplify checksum verification in download-native-libs.sh to plain
  `sha256sum -c`, which works with both GNU coreutils and BusyBox,
  removing the ldd-based branch.
@YOU54F
YOU54F force-pushed the feat/linux-musl-host-rid branch from abd59e7 to 2210498 Compare November 18, 2026 12:28
…SDK 11

The ubuntu-24.04-arm runner image now ships .NET SDK 11.0.100, which is
picked over the setup-dotnet 8.0.x install. SDK 11 generates hot reload
browser-tools static web assets for Web SDK projects in Debug, and the
build then fails with "scoped css bundles do not have matching endpoints".
YOU54F and others added 3 commits November 18, 2026 15:37
MessagingProvider only retried when the HttpListenerException message was exactly
"Address already in use" (glibc wording). musl reports the same errno (98) as
"Address in use", so on Alpine a port race failed instead of retrying. Match on
the EADDRINUSE error code (Linux/macOS/Winsock), keeping the message as a fallback.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
….x' into feat/linux-musl-host-rid

# Conflicts:
#	build/download-native-libs.sh
libpact_ffi 0.5.13 ships .zip and .tar.xz archives. The mcr.microsoft.com/dotnet/sdk:8.0
(Debian bookworm) image has neither unzip nor xz, so the GNU tar fallback failed on
the Windows zip. Install both, and fail with a clear message instead of falling back
to a tar that cannot read zip files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant