Skip to content

Commit 27df006

Browse files
committed
chore(ffi): Update to FFI 0.4.23
This involves a breaking change in the FFI packaging for MacOS which was introduced in version 0.4.21: https://github.com/pact-foundation/pact-reference/releases/tag/libpact_ffi-v0.4.21
1 parent 4318a4a commit 27df006

12 files changed

+47
-47
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ PactNet/Files/pact/
5555
tools/
5656
build/tools/
5757
build/linux/
58-
build/osx/
58+
build/macos/
5959
build/windows/
6060
dist/
6161

build/download-native-libs.sh

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22
set -euo pipefail
33

4-
FFI_VERSION="0.4.16"
4+
FFI_VERSION="0.4.23"
55
FFI_BASE_URL="https://github.com/pact-foundation/pact-reference/releases/download/libpact_ffi-v$FFI_VERSION"
66

77
GREEN="\e[32m"
@@ -20,45 +20,51 @@ download_native() {
2020
# e.g.
2121
# pact_ffi-windows-x86_64.dll.gz
2222
# libpact_ffi-linux-x86_64.so.gz
23-
# libpact_ffi-osx-x86_64.dylib.gz
24-
src_file="$file-$os-$platform.$extension.gz"
25-
url="$FFI_BASE_URL/$src_file"
23+
# libpact_ffi-macos-x86_64.dylib.gz
24+
src_file="$file-$os-$platform.$extension"
25+
src_archive="$src_file.gz"
26+
src_sha="$src_archive.sha256"
27+
dest_file="$file.$extension"
28+
url="$FFI_BASE_URL/$src_archive"
2629
sha="$url.sha256"
2730

2831
path="$base_path/$os/$platform"
29-
dest_file="$file.$extension.gz"
3032
mkdir -p "$path"
33+
pushd $path > /dev/null
3134

3235
echo -e "Downloading FFI library for ${YELLOW}$os/$platform${CLEAR}"
33-
echo -e " Destination: ${BLUE}$path/$dest_file${CLEAR}"
36+
echo -e " Destination: ${BLUE}$path/$src_archive${CLEAR}"
3437
echo -e " URL: ${BLUE}$url${CLEAR}"
3538

3639
echo -n " Downloading... "
37-
curl --silent -L "$url" -o "$path/$dest_file"
38-
curl --silent -L "$sha" -o "$path/$dest_file.sha256"
40+
curl --silent -L "$url" -o "$src_archive"
41+
curl --silent -L "$sha" -o "$src_archive.sha256"
3942
echo -e "${GREEN}OK${CLEAR}"
4043

4144
echo -n " Verifying... "
4245

4346
if [[ "$OSTYPE" == "darwin"* ]]; then
44-
# OSX requires an empty arg passed to -i, but this doesn't work on Lin/Win
45-
sed -Ei '' "s|../release_artifacts/.+$|$path/$dest_file|" "$path/$dest_file.sha256"
46-
shasum -a 256 --check --quiet "$path/$dest_file.sha256"
47+
shasum -a 256 --check --quiet "$src_sha"
4748
else
48-
sed -Ei "s|../release_artifacts/.+$|$path/$dest_file|" "$path/$dest_file.sha256"
49-
sha256sum --check --quiet "$path/$dest_file.sha256"
49+
sha256sum --check --quiet "$src_sha"
5050
fi
5151

52-
rm "$path/$dest_file.sha256"
5352
echo -e "${GREEN}OK${CLEAR}"
5453

5554
echo -n " Extracting... "
56-
gunzip -f "$path/$dest_file"
55+
gunzip -f "$src_archive"
5756
echo -e "${GREEN}OK${CLEAR}"
5857
echo ""
58+
59+
mv "$src_file" "$dest_file"
60+
rm "$src_sha"
61+
62+
popd > /dev/null
5963
}
6064

6165
download_native "pact_ffi" "windows" "x86_64" "dll"
6266
download_native "libpact_ffi" "linux" "x86_64" "so"
63-
download_native "libpact_ffi" "osx" "x86_64" "dylib"
64-
download_native "libpact_ffi" "osx" "aarch64-apple-darwin" "dylib"
67+
download_native "libpact_ffi" "macos" "x86_64" "dylib"
68+
download_native "libpact_ffi" "macos" "aarch64" "dylib"
69+
70+
echo "Successfully downloaded FFI libraries"

samples/OrdersApi/Consumer.Tests/pacts/Fulfilment API-Orders API.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@
158158
],
159159
"metadata": {
160160
"pactRust": {
161-
"ffi": "0.4.16",
162-
"models": "1.1.19"
161+
"ffi": "0.4.23",
162+
"models": "1.2.5"
163163
},
164164
"pactSpecification": {
165165
"version": "4.0"

src/PactNet/PactNet.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@
3636
<CopyToOutputDirectory Condition="'$(IsLinux)'">PreserveNewest</CopyToOutputDirectory>
3737
<Visible>false</Visible>
3838
</Content>
39-
<Content Include="$(MSBuildProjectDirectory)\..\..\build\osx\x86_64\libpact_ffi.dylib">
39+
<Content Include="$(MSBuildProjectDirectory)\..\..\build\macos\x86_64\libpact_ffi.dylib">
4040
<Link>libpact_ffi.dylib</Link>
4141
<PackagePath>runtimes/osx-x64/native</PackagePath>
4242
<Pack>true</Pack>
4343
<CopyToOutputDirectory Condition="'$(IsOSX)' == 'True' And '$(IsArm64)' == 'False'">PreserveNewest</CopyToOutputDirectory>
4444
<Visible>false</Visible>
4545
</Content>
46-
<Content Include="$(MSBuildProjectDirectory)\..\..\build\osx\aarch64-apple-darwin\libpact_ffi.dylib">
46+
<Content Include="$(MSBuildProjectDirectory)\..\..\build\macos\aarch64\libpact_ffi.dylib">
4747
<Link>libpact_ffi.dylib</Link>
4848
<PackagePath>runtimes/osx-arm64/native</PackagePath>
4949
<Pack>true</Pack>

tests/PactNet.Tests/data/v2-consumer-integration.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@
7474
],
7575
"metadata": {
7676
"pactRust": {
77-
"ffi": "0.4.16",
78-
"models": "1.1.19"
77+
"ffi": "0.4.23",
78+
"models": "1.2.5"
7979
},
8080
"pactSpecification": {
8181
"version": "2.0.0"

tests/PactNet.Tests/data/v3-consumer-integration.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,7 @@
9696
}
9797
]
9898
}
99-
},
100-
"header": {},
101-
"query": {}
99+
}
102100
},
103101
"method": "POST",
104102
"path": "/things",
@@ -132,8 +130,8 @@
132130
],
133131
"metadata": {
134132
"pactRust": {
135-
"ffi": "0.4.16",
136-
"models": "1.1.19"
133+
"ffi": "0.4.23",
134+
"models": "1.2.5"
137135
},
138136
"pactSpecification": {
139137
"version": "3.0.0"

tests/PactNet.Tests/data/v3-message-consumer-integration.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
"language": "C#"
3737
},
3838
"pactRust": {
39-
"ffi": "0.4.16",
40-
"models": "1.1.19"
39+
"ffi": "0.4.23",
40+
"models": "1.2.5"
4141
},
4242
"pactSpecification": {
4343
"version": "3.0.0"

tests/PactNet.Tests/data/v3-message-integration.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
],
1717
"metadata": {
1818
"pactRust": {
19-
"ffi": "0.4.16",
20-
"models": "1.1.19"
19+
"ffi": "0.4.23",
20+
"models": "1.2.5"
2121
},
2222
"pactSpecification": {
2323
"version": "3.0.0"

tests/PactNet.Tests/data/v3-server-integration.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@
4646
],
4747
"metadata": {
4848
"pactRust": {
49-
"ffi": "0.4.16",
50-
"models": "1.1.19"
49+
"ffi": "0.4.23",
50+
"models": "1.2.5"
5151
},
5252
"pactSpecification": {
5353
"version": "3.0.0"

tests/PactNet.Tests/data/v4-combined-integration.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,7 @@
106106
}
107107
]
108108
}
109-
},
110-
"header": {},
111-
"query": {}
109+
}
112110
},
113111
"method": "POST",
114112
"path": "/things",
@@ -187,8 +185,8 @@
187185
"language": "C#"
188186
},
189187
"pactRust": {
190-
"ffi": "0.4.16",
191-
"models": "1.1.19"
188+
"ffi": "0.4.23",
189+
"models": "1.2.5"
192190
},
193191
"pactSpecification": {
194192
"version": "4.0"

tests/PactNet.Tests/data/v4-consumer-integration.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,7 @@
106106
}
107107
]
108108
}
109-
},
110-
"header": {},
111-
"query": {}
109+
}
112110
},
113111
"method": "POST",
114112
"path": "/things",
@@ -152,8 +150,8 @@
152150
],
153151
"metadata": {
154152
"pactRust": {
155-
"ffi": "0.4.16",
156-
"models": "1.1.19"
153+
"ffi": "0.4.23",
154+
"models": "1.2.5"
157155
},
158156
"pactSpecification": {
159157
"version": "4.0"

tests/PactNet.Tests/data/v4-message-consumer-integration.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
"language": "C#"
4242
},
4343
"pactRust": {
44-
"ffi": "0.4.16",
45-
"models": "1.1.19"
44+
"ffi": "0.4.23",
45+
"models": "1.2.5"
4646
},
4747
"pactSpecification": {
4848
"version": "4.0"

0 commit comments

Comments
 (0)