Skip to content

Commit

Permalink
Try adding script that configures cross
Browse files Browse the repository at this point in the history
Signed-off-by: Timothy Johnson <[email protected]>
  • Loading branch information
t1m0thyj committed Oct 31, 2023
1 parent 52a465e commit dcf52a4
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/secrets-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
31 changes: 31 additions & 0 deletions src/secrets/scripts/configure-cross.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit dcf52a4

Please sign in to comment.