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 f811739
Show file tree
Hide file tree
Showing 2 changed files with 106 additions and 1 deletion.
102 changes: 102 additions & 0 deletions recipe/6542.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
From 0bbf05b0fa8bb7948803ab0132d71439c567e92d Mon Sep 17 00:00:00 2001
From: Alex Gaynor <[email protected]>
Date: Wed, 3 Nov 2021 19:38:16 -0400
Subject: [PATCH] Bump pyo3 and fix warnings

---
src/rust/Cargo.lock | 16 ++++++++--------
src/rust/Cargo.toml | 2 +-
src/rust/src/x509/certificate.rs | 2 +-
src/rust/src/x509/crl.rs | 2 +-
4 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/src/rust/Cargo.lock b/src/rust/Cargo.lock
index 3c56819090..873bee324a 100644
--- a/src/rust/Cargo.lock
+++ b/src/rust/Cargo.lock
@@ -281,9 +281,9 @@ dependencies = [

[[package]]
name = "pyo3"
-version = "0.14.5"
+version = "0.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "35100f9347670a566a67aa623369293703322bb9db77d99d7df7313b575ae0c8"
+checksum = "64664505ce285a59b8b7e940fbe54ad65b1758a0810eddc5bc26df6f6ec8c557"
dependencies = [
"cfg-if",
"indoc",
@@ -297,18 +297,18 @@ dependencies = [

[[package]]
name = "pyo3-build-config"
-version = "0.14.5"
+version = "0.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d12961738cacbd7f91b7c43bc25cfeeaa2698ad07a04b3be0aa88b950865738f"
+checksum = "5f1e4a72de84cdcd69f62211b62f62753d0c11b7b5715f3467f3754dab22a7ca"
dependencies = [
"once_cell",
]

[[package]]
name = "pyo3-macros"
-version = "0.14.5"
+version = "0.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fc0bc5215d704824dfddddc03f93cb572e1155c68b6761c37005e1c288808ea8"
+checksum = "244f21d0a3887a9c02018b94e3b78d693dc7eca5c56839b7796a499cc364deb4"
dependencies = [
"pyo3-macros-backend",
"quote",
@@ -317,9 +317,9 @@ dependencies = [

[[package]]
name = "pyo3-macros-backend"
-version = "0.14.5"
+version = "0.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "71623fc593224afaab918aa3afcaf86ed2f43d34f6afde7f3922608f253240df"
+checksum = "b3d3d18ac41d05199bb82645d56e39f8c8b4909a0137c6f2640f03685b29f672"
dependencies = [
"proc-macro2",
"pyo3-build-config",
diff --git a/src/rust/Cargo.toml b/src/rust/Cargo.toml
index a2c90b4f96..ef3059e948 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.8.6", default-features = false, features = ["derive"] }
pem = "1.0"
chrono = { version = "0.4", default-features = false, features = ["alloc", "clock"] }
diff --git a/src/rust/src/x509/certificate.rs b/src/rust/src/x509/certificate.rs
index e72b954d13..99bd2d318d 100644
--- a/src/rust/src/x509/certificate.rs
+++ b/src/rust/src/x509/certificate.rs
@@ -6,7 +6,7 @@ use crate::asn1::{big_asn1_uint_to_py, py_uint_to_big_endian_bytes, PyAsn1Error,
use crate::x509;
use crate::x509::{crl, sct};
use chrono::Datelike;
-use pyo3::{PyNativeType, ToPyObject};
+use pyo3::ToPyObject;
use std::collections::hash_map::DefaultHasher;
use std::hash::{Hash, Hasher};
use std::sync::Arc;
diff --git a/src/rust/src/x509/crl.rs b/src/rust/src/x509/crl.rs
index cbcd127b25..551d4052af 100644
--- a/src/rust/src/x509/crl.rs
+++ b/src/rust/src/x509/crl.rs
@@ -5,7 +5,7 @@
use crate::asn1::{big_asn1_uint_to_py, py_uint_to_big_endian_bytes, PyAsn1Error, PyAsn1Result};
use crate::x509;
use crate::x509::certificate;
-use pyo3::{PyNativeType, ToPyObject};
+use pyo3::ToPyObject;
use std::convert::TryInto;
use std::sync::Arc;

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
- 6542.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 f811739

Please sign in to comment.