Skip to content

Commit

Permalink
feat: support linux-arm64 runtime (libc)
Browse files Browse the repository at this point in the history
  • Loading branch information
YOU54F authored and adamrodger committed Oct 6, 2024
1 parent 8f98cb5 commit afd05c5
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 13 deletions.
6 changes: 4 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,18 @@ version by executing the script in Bash (or Git Bash on Windows):
build/download-native-libs.sh
```

Alternatively you can download a particular FFI version from the [pact-referece] releases or build your own version
Alternatively you can download a particular FFI version from the [pact-reference] releases or build your own version
locally, and then copy the artifacts into the folders:

```
build/
linux/
x86_64/
libpact_ffi.so
aarch64/
libpact_ffi.so
osx/
aarch64-apple-darwin/
aarch64/
libpact_ffi.dylib
x86_64/
libpact_ffi.dylib
Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,16 +232,16 @@ For writing messaging pacts instead of requests/response pacts, see the [messagi

Due to using a shared native library instead of C# for the main Pact logic only certain OSs are supported:

| OS | Arch | Support |
| ------------ | ----------- | -------------------------------------------------------------------|
| Windows | x86 | ❌ No |
| Windows | x64 | ✔️ Yes |
| Linux (libc) | ARM | ❌ No |
| Linux (libc) | x86 | ❌ No |
| Linux (libc) | x64 | ✔️ Yes |
| Linux (musl) | Any |[No](https://github.com/pact-foundation/pact-net/issues/374) |
| OSX | x64 | ✔️ Yes |
| OSX | ARM (M1/M2) | ✔️ Yes |
| OS | Arch | Support |
| ------------ | ------------ | -------------------------------------------------------------------|
| Windows | x86 | ❌ No |
| Windows | x64 | ✔️ Yes |
| Linux (libc) | ARM64 | ✔️ Yes |
| Linux (libc) | x64 | ✔️ Yes |
| Linux (libc) | x86 | ❌ No |
| Linux (musl) | Any |[No](https://github.com/pact-foundation/pact-net/issues/374) |
| OSX | x64 | ✔️ Yes |
| OSX | ARM64 (M1/M2)| ✔️ Yes |

### Pact Specification

Expand Down
1 change: 1 addition & 0 deletions build/download-native-libs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ download_native() {

download_native "pact_ffi" "windows" "x86_64" "dll"
download_native "libpact_ffi" "linux" "x86_64" "so"
download_native "libpact_ffi" "linux" "aarch64" "so"
download_native "libpact_ffi" "macos" "x86_64" "dylib"
download_native "libpact_ffi" "macos" "aarch64" "dylib"

Expand Down
9 changes: 8 additions & 1 deletion src/PactNet/PactNet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,14 @@
<Link>libpact_ffi.so</Link>
<PackagePath>runtimes/linux-x64/native</PackagePath>
<Pack>true</Pack>
<CopyToOutputDirectory Condition="'$(IsLinux)'">PreserveNewest</CopyToOutputDirectory>
<CopyToOutputDirectory Condition="'$(IsLinux)' And '$(IsArm64)' == 'False'">PreserveNewest</CopyToOutputDirectory>
<Visible>false</Visible>
</Content>
<Content Include="$(MSBuildProjectDirectory)\..\..\build\linux\aarch64\libpact_ffi.so">
<Link>libpact_ffi.so</Link>
<PackagePath>runtimes/linux-arm64/native</PackagePath>
<Pack>true</Pack>
<CopyToOutputDirectory Condition="'$(IsLinux)' And '$(IsArm64)' == 'True'">PreserveNewest</CopyToOutputDirectory>
<Visible>false</Visible>
</Content>
<Content Include="$(MSBuildProjectDirectory)\..\..\build\macos\x86_64\libpact_ffi.dylib">
Expand Down

0 comments on commit afd05c5

Please sign in to comment.