From 5e53eecd1fb5677b94232091aa9f2c9624cbccef Mon Sep 17 00:00:00 2001 From: Kyle Barron Date: Mon, 9 Dec 2024 16:20:24 -0500 Subject: [PATCH] Fix wheel build (#911) Workaround for #716 --- .github/workflows/python-core-wheels.yml | 27 ++++++++++++++------- .github/workflows/python-io-wheels.yml | 30 ++++++++++++++++++------ Cargo.toml | 2 ++ 3 files changed, 44 insertions(+), 15 deletions(-) diff --git a/.github/workflows/python-core-wheels.yml b/.github/workflows/python-core-wheels.yml index daf7696df..af89858f3 100644 --- a/.github/workflows/python-core-wheels.yml +++ b/.github/workflows/python-core-wheels.yml @@ -45,9 +45,12 @@ jobs: python-version: 3.x - name: Build wheels uses: PyO3/maturin-action@v1 + env: + RUSTFLAGS: "-Zinline-mir=no" with: + rust-toolchain: nightly target: ${{ matrix.platform.target }} - args: --release --out dist --find-interpreter --manifest-path python/${{ matrix.module }}/Cargo.toml + args: --release --out dist -i 3.9 -i 3.10 -i 3.11 -i 3.12 -i 3.13 --manifest-path python/${{ matrix.module }}/Cargo.toml sccache: "true" manylinux: auto - name: Upload wheels @@ -80,9 +83,11 @@ jobs: # python-version: 3.x # - name: Build wheels # uses: PyO3/maturin-action@v1 + # env: + # RUSTFLAGS: "-Zinline-mir=no" # with: # target: ${{ matrix.platform.target }} - # args: --release --out dist --find-interpreter --manifest-path python/${{ matrix.module }}/Cargo.toml + # args: --release --out dist -i 3.9 -i 3.10 -i 3.11 -i 3.12 -i 3.13 --manifest-path python/${{ matrix.module }}/Cargo.toml # sccache: "true" # manylinux: musllinux_1_2 # - name: Upload wheels @@ -111,9 +116,12 @@ jobs: architecture: ${{ matrix.platform.target }} - name: Build wheels uses: PyO3/maturin-action@v1 + env: + RUSTFLAGS: "-Zinline-mir=no" with: + rust-toolchain: nightly target: ${{ matrix.platform.target }} - args: --release --out dist --find-interpreter --manifest-path python/${{ matrix.module }}/Cargo.toml + args: --release --out dist -i 3.9 -i 3.10 -i 3.11 -i 3.12 --manifest-path python/${{ matrix.module }}/Cargo.toml sccache: "true" - name: Upload wheels uses: actions/upload-artifact@v4 @@ -141,9 +149,12 @@ jobs: python-version: 3.x - name: Build wheels uses: PyO3/maturin-action@v1 + env: + RUSTFLAGS: "-Zinline-mir=no" with: + rust-toolchain: nightly target: ${{ matrix.platform.target }} - args: --release --out dist --find-interpreter --manifest-path python/${{ matrix.module }}/Cargo.toml + args: --release --out dist -i 3.9 -i 3.10 -i 3.11 -i 3.12 -i 3.13 --manifest-path python/${{ matrix.module }}/Cargo.toml sccache: "true" - name: Upload wheels uses: actions/upload-artifact@v4 @@ -177,16 +188,16 @@ jobs: - uses: actions/setup-python@v5 with: python-version: ${{ env.PYTHON_VERSION }} - - run: | - echo RUSTFLAGS="-Zinline-mir=no" >> $GITHUB_ENV - run: pip install pyodide-build - name: Build wheels uses: PyO3/maturin-action@v1 + env: + RUSTFLAGS: "-Zinline-mir=no" with: + rust-toolchain: nightly target: ${{ matrix.platform.target }} - args: --release --out dist --find-interpreter --no-default-features --manifest-path python/${{ matrix.module }}/Cargo.toml + args: --release --out dist -i 3.9 -i 3.10 -i 3.11 -i 3.12 -i 3.13 --no-default-features --manifest-path python/${{ matrix.module }}/Cargo.toml sccache: "true" - rust-toolchain: nightly - name: Upload wheels uses: actions/upload-artifact@v4 with: diff --git a/.github/workflows/python-io-wheels.yml b/.github/workflows/python-io-wheels.yml index 890e3545f..f01009998 100644 --- a/.github/workflows/python-io-wheels.yml +++ b/.github/workflows/python-io-wheels.yml @@ -25,10 +25,13 @@ jobs: - name: Build wheels uses: PyO3/maturin-action@v1 + env: + RUSTFLAGS: "-Zinline-mir=no" with: + rust-toolchain: nightly target: ${{ matrix.target }} manylinux: manylinux_2_28 - args: --release --out dist --find-interpreter -m python/geoarrow-io/Cargo.toml + args: --release --out dist -i 3.9 -i 3.10 -i 3.11 -i 3.12 -i 3.13 -m python/geoarrow-io/Cargo.toml before-script-linux: | yum update -y yum install openssl openssl-devel perl-IPC-Cmd -y @@ -58,10 +61,13 @@ jobs: # - name: Build wheels # uses: PyO3/maturin-action@v1 + # env: + # RUSTFLAGS: "-Zinline-mir=no" # with: + # rust-toolchain: nightly # target: ${{ matrix.target }} # manylinux: auto - # args: --release --out dist --find-interpreter -m python/geoarrow-io/Cargo.toml + # args: --release --out dist -i 3.9 -i 3.10 -i 3.11 -i 3.12 -i 3.13 -m python/geoarrow-io/Cargo.toml # # This is currently failing with # # python: command not found @@ -110,9 +116,12 @@ jobs: - name: Build wheels - ${{ matrix.platform.target }} uses: PyO3/maturin-action@v1 + env: + RUSTFLAGS: "-Zinline-mir=no" with: + rust-toolchain: nightly target: ${{ matrix.platform.target }} - args: --release --out dist --find-interpreter -m python/geoarrow-io/Cargo.toml + args: --release --out dist -i 3.9 -i 3.10 -i 3.11 -i 3.12 -i 3.13 -m python/geoarrow-io/Cargo.toml sccache: "true" - name: Install built wheel - ${{ matrix.platform.target }} @@ -136,16 +145,19 @@ jobs: - uses: actions/setup-python@v4 with: - python-version: 3.x + python-version: 3.11 architecture: ${{ matrix.target }} - uses: dtolnay/rust-toolchain@stable - name: Build wheels uses: PyO3/maturin-action@v1 + env: + RUSTFLAGS: "-Zinline-mir=no" with: + rust-toolchain: nightly target: ${{ matrix.target }} - args: --release --out dist --find-interpreter -m python/geoarrow-io/Cargo.toml + args: --release --out dist -i 3.9 -i 3.10 -i 3.11 -i 3.12 -m python/geoarrow-io/Cargo.toml - name: Install built wheel run: | @@ -178,9 +190,11 @@ jobs: # - name: Build wheels # uses: PyO3/maturin-action@v1 # with: + # rust-toolchain: nightly # target: ${{ matrix.target }} # manylinux: musllinux_1_2 - # args: --release --out dist --find-interpreter -m python/geoarrow-io/Cargo.toml + # TODO: update rustflags env + # args: --release --out dist -i 3.9 -i 3.10 -i 3.11 -i 3.12 -i 3.13 -m python/geoarrow-io/Cargo.toml # - name: Install built wheel # if: matrix.target == 'x86_64-unknown-linux-musl' @@ -220,9 +234,11 @@ jobs: # - name: Build wheels # uses: PyO3/maturin-action@v1 # with: + # rust-toolchain: nightly # target: ${{ matrix.platform.target }} # manylinux: musllinux_1_2 - # args: --release --out dist --find-interpreter -m python/geoarrow-io/Cargo.toml + # TODO: update rustflags env + # args: --release --out dist -i 3.9 -i 3.10 -i 3.11 -i 3.12 -i 3.13 -m python/geoarrow-io/Cargo.toml # - uses: uraimo/run-on-arch-action@v2.5.1 # name: Install built wheel diff --git a/Cargo.toml b/Cargo.toml index 96435e538..e9d56a313 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,3 +2,5 @@ members = ["rust/geoarrow"] exclude = ["js"] resolver = "2" + +[workspace.package]