Skip to content

Commit

Permalink
Try to use Ubuntu for cross-compilation
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 6de5e87 commit 1e2f591
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/secrets-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
target: ${{ matrix.target }}
args: --release --out dist --find-interpreter
sccache: "true"
manylinux: auto
container: ghcr.io/rust-cross/manylinux2014-cross:${{ matrix.target }}
working-directory: src/secrets/src/keyring
before-script-linux: ../../scripts/configure-cross.sh ${{ matrix.target }}
- name: Upload wheels
Expand Down
15 changes: 11 additions & 4 deletions src/secrets/scripts/configure-cross.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/bin/bash

# Install libsecret for the architecture we are compiling for
install_libs() {
dpkg --add-architecture $1
apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y libsecret-1-dev:$1
}

# Set environment variables needed for cross-compilation in current shell
set_env() {
export PKG_CONFIG_SYSROOT_DIR="${CHROOT:-/}"
Expand All @@ -8,17 +14,17 @@ set_env() {
}

CROSS_DEB_ARCH=$1
dpkg --add-architecture $CROSS_DEB_ARCH
apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y libsecret-1-dev:$CROSS_DEB_ARCH

case "$CROSS_DEB_ARCH" in
case "$1" in
"aarch64")
CROSS_DEB_ARCH=arm64
set_env "/usr/lib/aarch64-linux-gnu"
;;
"armv7")
CROSS_DEB_ARCH=armhf
set_env "/usr/lib/arm-linux-gnueabihf"
;;
"ppc64le")
CROSS_DEB_ARCH=ppc64el
set_env "/usr/lib/powerpc64le-unknown-linux-gnu"
;;
"s390x")
Expand All @@ -33,3 +39,4 @@ case "$CROSS_DEB_ARCH" in
*)
;;
esac
install_libs $CROSS_DEB_ARCH

0 comments on commit 1e2f591

Please sign in to comment.