Skip to content

Commit

Permalink
When needed, update pyo3 to fix cross-compilation (PyO3/pyo3#1847 (co…
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisburr committed Nov 4, 2021
1 parent 2f0658e commit 4f84d62
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
25 changes: 25 additions & 0 deletions recipe/0001-Use-pyo3-0.15.0-to-fix-cross-compilation.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From c0aac7fbe675d3afcf5c64eed39f369d706f4fa1 Mon Sep 17 00:00:00 2001
From: Chris Burr <[email protected]>
Date: Thu, 4 Nov 2021 08:33:08 +0100
Subject: [PATCH] Use pyo3 0.15.0 to fix cross-compilation

---
src/rust/Cargo.toml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/rust/Cargo.toml b/src/rust/Cargo.toml
index 6d59072..29c7e29 100644
--- a/src/rust/Cargo.toml
+++ b/src/rust/Cargo.toml
@@ -7,7 +7,7 @@ publish = false

[dependencies]
lazy_static = "1"
-pyo3 = { version = "0.14.5" }
+pyo3 = { version = "0.15.0" }
asn1 = { version = "0.6", default-features = false, features = ["derive"] }
pem = "0.8"
chrono = { version = "0.4", default-features = false, features = ["alloc"] }
--
2.30.1 (Apple Git-130)

5 changes: 4 additions & 1 deletion recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@ package:
source:
url: https://pypi.io/packages/source/c/cryptography/cryptography-{{ version }}.tar.gz
sha256: 9933f28f70d0517686bd7de36166dda42094eac49415459d9bdf5e7df3e0086d
patches:
# Update pyo3 to avoid https://github.com/PyO3/pyo3/pull/1847#discussion_r727122252
- 0001-Use-pyo3-0.15.0-to-fix-cross-compilation.patch # [build_platform != target_platform]

build:
number: 2
skip: true # [py<36]
script:
{% if build_platform != target_platform %}
- export PYO3_CROSS_INCLUDE_DIR=$PREFIX/include
- export PYO3_CROSS_LIB_DIR=$PREFIX/lib/python$PY_VER/
- export PYO3_CROSS_LIB_DIR=$SP_DIR/../
- export PYO3_CROSS_PYTHON_VERSION=$PY_VER
{% endif %}
- {{ PYTHON }} -m pip install . -vv
Expand Down

0 comments on commit 4f84d62

Please sign in to comment.