diff --git a/.github/workflows/secrets-sdk.yml b/.github/workflows/secrets-sdk.yml index 01881206..1ef7a4d3 100644 --- a/.github/workflows/secrets-sdk.yml +++ b/.github/workflows/secrets-sdk.yml @@ -37,6 +37,7 @@ jobs: sccache: "true" manylinux: auto working-directory: src/secrets/src/keyring + before-script-linux: ../../scripts/configure-cross.sh ${{ matrix.target }} - name: Upload wheels uses: actions/upload-artifact@v3 with: diff --git a/src/secrets/scripts/configure-cross.sh b/src/secrets/scripts/configure-cross.sh new file mode 100644 index 00000000..00c3959c --- /dev/null +++ b/src/secrets/scripts/configure-cross.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +# Set environment variables needed for cross-compilation in current shell +set_env() { + export PKG_CONFIG_SYSROOT_DIR="${CHROOT:-/}" + export RUSTFLAGS="-L $CHROOT$1 $RUSTFLAGS" + export PKG_CONFIG_PATH="$CHROOT$1/pkgconfig" +} + +case "$1" in + "aarch64") + set_env "/usr/lib/aarch64-linux-gnu" + ;; + "armv7") + set_env "/usr/lib/arm-linux-gnueabihf" + ;; + "ppc64le") + set_env "/usr/lib/powerpc64le-unknown-linux-gnu" + ;; + "s390x") + set_env "/usr/lib/s390x-unknown-linux-gnu" + ;; + "x86") + set_env "/usr/lib/i386-linux-gnu" + ;; + "x86_64") + set_env "/usr/lib/x86_64-linux-gnu" + ;; + *) + ;; +esac