Skip to content

Commit

Permalink
Merge pull request #2232 from davidhewitt/cross-compile-panic
Browse files Browse the repository at this point in the history
pyo3-build-config: fix windows "cross-compile" panic
  • Loading branch information
adamreichold committed Mar 16, 2022
2 parents 9ef7987 + 7f117b5 commit c5517ad
Show file tree
Hide file tree
Showing 5 changed files with 169 additions and 110 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/ci.yml
Expand Up @@ -247,6 +247,18 @@ jobs:
manylinux: auto
args: --release -i python3.9 --no-sdist -m examples/maturin-starter/Cargo.toml

- run: sudo rm -rf examples/maturin-starter/target
if: ${{ matrix.platform.os == 'ubuntu-latest' && matrix.python-version == '3.9' }}
- name: Test cross compile to same architecture
if: ${{ matrix.platform.os == 'ubuntu-latest' && matrix.python-version == '3.9' }}
uses: messense/maturin-action@v1
env:
PYO3_CROSS_LIB_DIR: /opt/python/cp39-cp39/lib
with:
target: x86_64-unknown-linux-gnu
manylinux: auto
args: --release -i python3.9 --no-sdist -m examples/maturin-starter/Cargo.toml

- name: Test cross compilation
if: ${{ matrix.platform.os == 'macos-latest' && matrix.python-version == '3.9' }}
uses: messense/maturin-action@v1
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- Panic during compilation when `PYO3_CROSS_LIB_DIR` is set for some host/target combinations. [#2232](https://github.com/PyO3/pyo3/pull/2232)

## [0.16.2] - 2022-03-15

### Packaging
Expand Down
3 changes: 1 addition & 2 deletions pyo3-build-config/src/errors.rs
Expand Up @@ -2,8 +2,7 @@
#[macro_export]
#[doc(hidden)]
macro_rules! bail {
($msg: expr) => { return Err($msg.into()) };
($fmt: literal $($args: tt)+) => { return Err(format!($fmt $($args)+).into()) };
($($args: tt)+) => { return Err(format!($($args)+).into()) };
}

/// A simple macro for checking a condition. Resembles anyhow::ensure.
Expand Down

0 comments on commit c5517ad

Please sign in to comment.