Skip to content

Commit

Permalink
Merge pull request #413 from pact-foundation/glibc/cross_0_2_5_linux_…
Browse files Browse the repository at this point in the history
…x86_64_2.23

chore: build linux x86_64 ffi against glibc 2.23
  • Loading branch information
rholshausen authored Apr 29, 2024
2 parents 694100f + f795aea commit a9e8da3
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-ffi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
fail-fast: false
matrix:
operating-system: [ ubuntu-latest, windows-latest, macos-latest ]
operating-system: [ ubuntu-latest, windows-latest, macos-12 ]
rust: [ stable ]
env:
pact_do_not_track: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ ubuntu-latest, windows-latest, macos-latest ]
operating-system: [ ubuntu-latest, windows-latest, macos-12 ]
rust: [ stable ]
env:
pact_do_not_track: true
Expand Down
6 changes: 6 additions & 0 deletions rust/Cross.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
[target.x86_64-unknown-linux-gnu]
pre-build=[
"apt-get update && apt-get install --assume-yes wget unzip",
"wget https://github.com/protocolbuffers/protobuf/releases/download/v21.5/protoc-21.5-linux-x86_64.zip",
"unzip protoc-21.5-linux-x86_64.zip -d /usr/local/"
]
[target.aarch64-unknown-linux-gnu]
pre-build=[
"dpkg --add-architecture arm64 && apt-get update && apt-get install --assume-yes wget unzip",
Expand Down
7 changes: 6 additions & 1 deletion rust/pact_ffi/release-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ cargo_flags=( "$@" )

# Build the x86_64 GNU linux release
build_x86_64_gnu() {
cargo build --target x86_64-unknown-linux-gnu "${cargo_flags[@]}"
install_cross
cargo clean
cross build --target x86_64-unknown-linux-gnu "${cargo_flags[@]}"

if [[ "${cargo_flags[*]}" =~ "--release" ]]; then
gzip_and_sum \
Expand All @@ -29,6 +31,7 @@ build_x86_64_gnu() {

build_x86_64_musl() {
sudo apt-get install -y musl-tools
cargo clean
cargo build --target x86_64-unknown-linux-musl "${cargo_flags[@]}"

if [[ "${cargo_flags[*]}" =~ "--release" ]]; then
Expand Down Expand Up @@ -63,6 +66,7 @@ install_cross() {

build_aarch64_gnu() {
install_cross
cargo clean
cross build --target aarch64-unknown-linux-gnu "${cargo_flags[@]}"

if [[ "${cargo_flags[*]}" =~ "--release" ]]; then
Expand All @@ -77,6 +81,7 @@ build_aarch64_gnu() {

build_aarch64_musl() {
install_cross
cargo clean
cross build --target aarch64-unknown-linux-musl "${cargo_flags[@]}"

if [[ "${cargo_flags[*]}" =~ "--release" ]]; then
Expand Down

0 comments on commit a9e8da3

Please sign in to comment.