Skip to content

Commit

Permalink
Fix cross compilation for Python 3.10
Browse files Browse the repository at this point in the history
  • Loading branch information
messense committed Oct 12, 2021
1 parent fc7fddb commit a431f7e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -201,19 +201,24 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
platform: [
{ target: "aarch64-unknown-linux-gnu", arch: "aarch64" },
{ target: "armv7-unknown-linux-gnueabihf", arch: "armv7" },
{ target: "s390x-unknown-linux-gnu", arch: "s390x" },
]
platform:
- target: aarch64-unknown-linux-gnu
arch: aarch64
abi: cp36-cp36m
- target: armv7-unknown-linux-gnueabihf
arch: armv7
abi: cp39-cp39
- target: s390x-unknown-linux-gnu
arch: s390x
abi: cp310-cp310
steps:
- uses: actions/checkout@v2
- name: Build Wheels
run: |
echo 'curl -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable --profile minimal
source ~/.cargo/env
rustup target add ${{ matrix.platform.target }}
export PYO3_CROSS_LIB_DIR=/opt/python/cp36-cp36m/lib
export PYO3_CROSS_LIB_DIR=/opt/python/${{ matrix.platform.abi }}/lib
cargo run --target x86_64-unknown-linux-gnu -- build -i python3.9 --release --out dist --no-sdist --target ${{ matrix.platform.target }} -m test-crates/pyo3-mixed/Cargo.toml
' > build-wheel.sh
docker run --rm -v "$PWD":/io -w /io messense/manylinux2014-cross:${{ matrix.platform.arch }} bash build-wheel.sh
2 changes: 1 addition & 1 deletion src/cross_compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pub fn parse_sysconfigdata(
let mut script = fs::read_to_string(config_path)?;
script += r#"
print("version_major", build_time_vars["VERSION"][0]) # 3
print("version_minor", build_time_vars["VERSION"][2]) # E.g., 8
print("version_minor", build_time_vars["VERSION"][2:]) # E.g., 8, 10
KEYS = [
"ABIFLAGS",
"EXT_SUFFIX",
Expand Down

0 comments on commit a431f7e

Please sign in to comment.