- workflow fix
This commit is contained in:
1 parent
5623bbe4b3
commit
993ea6e7a7
1 file changed
+46
-3
@@ -72,13 +72,14 @@ jobs:
|
|||||||
- name: Install osxcross
|
- name: Install osxcross
|
||||||
run: |
|
run: |
|
||||||
export PATH="$HOME/.osxcross/bin:$PATH"
|
export PATH="$HOME/.osxcross/bin:$PATH"
|
||||||
if ! command -v osxcross >/dev/null 2>&1; then
|
if [ ! -d "$HOME/.osxcross/bin" ]; then
|
||||||
wget ${{ secrets.OSXCROSS_LINK }} -O osxcross.tar.gz
|
wget ${{ secrets.OSXCROSS_LINK }} -O osxcross.tar.gz
|
||||||
tar -xzf osxcross.tar.gz -C ~/
|
tar -xzf osxcross.tar.gz -C ~/
|
||||||
mv ~/osxcross ~/.osxcross
|
mv ~/osxcross ~/.osxcross
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Build wheels
|
- name: Build wheels
|
||||||
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
export PATH="$HOME/.osxcross/bin:$PATH"
|
export PATH="$HOME/.osxcross/bin:$PATH"
|
||||||
echo "HOME=$HOME CARGO_HOME=$CARGO_HOME RUSTUP_HOME=$RUSTUP_HOME"
|
echo "HOME=$HOME CARGO_HOME=$CARGO_HOME RUSTUP_HOME=$RUSTUP_HOME"
|
||||||
@@ -103,10 +104,52 @@ jobs:
|
|||||||
rustup target add aarch64-pc-windows-msvc
|
rustup target add aarch64-pc-windows-msvc
|
||||||
maturin build --release --out dist --target aarch64-pc-windows-msvc --auditwheel repair -m ome-metadata/Cargo.toml
|
maturin build --release --out dist --target aarch64-pc-windows-msvc --auditwheel repair -m ome-metadata/Cargo.toml
|
||||||
|
|
||||||
|
# Use osxcross, not Zig, for macOS SDK linking.
|
||||||
|
shopt -s nullglob
|
||||||
|
sdks=("$HOME"/.osxcross/SDK/MacOSX*.sdk)
|
||||||
|
if [ "${#sdks[@]}" -ne 1 ] || [ ! -d "${sdks[0]}" ]; then
|
||||||
|
echo "Expected exactly one macOS SDK under $HOME/.osxcross/SDK" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
export SDKROOT="$(realpath "${sdks[0]}")"
|
||||||
|
echo "Using SDKROOT=$SDKROOT"
|
||||||
|
|
||||||
|
find_osxcross_tool() {
|
||||||
|
local arch="$1" tool="$2" candidate
|
||||||
|
local matches=()
|
||||||
|
for candidate in "$HOME"/.osxcross/bin/"$arch"-apple-darwin*-"$tool"; do
|
||||||
|
if [ -x "$candidate" ]; then
|
||||||
|
matches+=("$candidate")
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if [ "${#matches[@]}" -ne 1 ]; then
|
||||||
|
echo "Expected exactly one osxcross $tool for $arch; found ${#matches[@]}" >&2
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
printf '%s\n' "${matches[0]}"
|
||||||
|
}
|
||||||
|
|
||||||
|
CARGO_TARGET_X86_64_APPLE_DARWIN_LINKER="$(find_osxcross_tool x86_64 clang)"
|
||||||
|
export CC_x86_64_apple_darwin="$CARGO_TARGET_X86_64_APPLE_DARWIN_LINKER"
|
||||||
|
CXX_x86_64_apple_darwin="$(find_osxcross_tool x86_64 clang++)"
|
||||||
|
# osxcross distributions may call the ARM64 architecture arm64 or aarch64.
|
||||||
|
arm_arch=arm64
|
||||||
|
arm_compilers=("$HOME"/.osxcross/bin/arm64-apple-darwin*-clang)
|
||||||
|
if [ "${#arm_compilers[@]}" -eq 0 ]; then
|
||||||
|
arm_arch=aarch64
|
||||||
|
fi
|
||||||
|
CARGO_TARGET_AARCH64_APPLE_DARWIN_LINKER="$(find_osxcross_tool "$arm_arch" clang)"
|
||||||
|
export CC_aarch64_apple_darwin="$CARGO_TARGET_AARCH64_APPLE_DARWIN_LINKER"
|
||||||
|
CXX_aarch64_apple_darwin="$(find_osxcross_tool "$arm_arch" clang++)"
|
||||||
|
export CARGO_TARGET_X86_64_APPLE_DARWIN_LINKER CXX_x86_64_apple_darwin
|
||||||
|
export CARGO_TARGET_AARCH64_APPLE_DARWIN_LINKER CXX_aarch64_apple_darwin
|
||||||
|
"$CC_x86_64_apple_darwin" --version
|
||||||
|
"$CC_aarch64_apple_darwin" --version
|
||||||
|
|
||||||
rustup target add x86_64-apple-darwin
|
rustup target add x86_64-apple-darwin
|
||||||
maturin build --release --out dist --target x86_64-apple-darwin --zig --auditwheel repair -m ome-metadata/Cargo.toml
|
MACOSX_DEPLOYMENT_TARGET=10.13 maturin build --release --out dist --target x86_64-apple-darwin --auditwheel repair -m ome-metadata/Cargo.toml
|
||||||
rustup target add aarch64-apple-darwin
|
rustup target add aarch64-apple-darwin
|
||||||
maturin build --release --out dist --target aarch64-apple-darwin --zig --auditwheel repair -m ome-metadata/Cargo.toml
|
MACOSX_DEPLOYMENT_TARGET=11.0 maturin build --release --out dist --target aarch64-apple-darwin --auditwheel repair -m ome-metadata/Cargo.toml
|
||||||
|
|
||||||
- name: Store cache
|
- name: Store cache
|
||||||
uses: actions/cache/save@v4
|
uses: actions/cache/save@v4
|
||||||
|
|||||||
Reference in new issue
Block a user