From 0c7a13fbe1d2245cae8b92b25e29f65b360a976a Mon Sep 17 00:00:00 2001 From: Adam Reichold Date: Tue, 15 Mar 2022 12:16:20 +0100 Subject: [PATCH 1/2] Make pyo3-ffi a build dependency of pyo3 to ensure that its build script has finished before pyo3's build script starts. --- CHANGELOG.md | 1 + Cargo.toml | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dad97788f08..8cdfa9ae1f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Packaging - Warn when modules are imported on PyPy 3.7 versions older than PyPy 7.3.8, as they are known to have binary compatibility issues. [#2217](https://github.com/PyO3/pyo3/pull/2217) +- Ensure build script of `pyo3-ffi` runs before that of `pyo3` to fix cross compilation. [#2224](https://github.com/PyO3/pyo3/pull/2224) ## [0.16.1] - 2022-03-05 diff --git a/Cargo.toml b/Cargo.toml index 4d239789dec..86e57bc6684 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -51,6 +51,7 @@ serde = { version = "1.0", features = ["derive"] } serde_json = "1.0.61" [build-dependencies] +pyo3-ffi = { path = "pyo3-ffi", version = "=0.16.1" } pyo3-build-config = { path = "pyo3-build-config", version = "0.16.1", features = ["resolve-config"] } [features] From 1e7275c92451df37fd64aadc46b89dbafbb7ce74 Mon Sep 17 00:00:00 2001 From: Adam Reichold Date: Tue, 15 Mar 2022 12:40:11 +0100 Subject: [PATCH 2/2] Move links key from pyo3 to pyo3-ffi Instead of a fake build dependency, move the links key from pyo3 to pyo3-ffi which according to [1] is a prerequisite for build scripts to emit meta-data that can be used by other build scripts which would incidentally ensure the ordering between the build script of pyo3 and pyo3-ffi that we need. [1] https://doc.rust-lang.org/cargo/reference/build-script-examples.html#using-another-sys-crate --- Cargo.toml | 2 -- pyo3-ffi/Cargo.toml | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 86e57bc6684..0316d1b2d27 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,6 @@ categories = ["api-bindings", "development-tools::ffi"] license = "Apache-2.0" exclude = ["/.gitignore", ".cargo/config", "/codecov.yml", "/Makefile", "/pyproject.toml", "/noxfile.py"] edition = "2018" -links = "python" [dependencies] cfg-if = "1.0" @@ -51,7 +50,6 @@ serde = { version = "1.0", features = ["derive"] } serde_json = "1.0.61" [build-dependencies] -pyo3-ffi = { path = "pyo3-ffi", version = "=0.16.1" } pyo3-build-config = { path = "pyo3-build-config", version = "0.16.1", features = ["resolve-config"] } [features] diff --git a/pyo3-ffi/Cargo.toml b/pyo3-ffi/Cargo.toml index df107771019..faa2e1a7d61 100644 --- a/pyo3-ffi/Cargo.toml +++ b/pyo3-ffi/Cargo.toml @@ -9,6 +9,7 @@ repository = "https://github.com/pyo3/pyo3" categories = ["api-bindings", "development-tools::ffi"] license = "Apache-2.0" edition = "2018" +links = "python" [dependencies] libc = "0.2.62"