* [PR PATCH] Refactor PYO3_CROSS_* in rust build-helper
@ 2023-09-16 15:04 tornaria
2023-09-26 18:49 ` ahesford
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: tornaria @ 2023-09-16 15:04 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1266 bytes --]
There is a new pull request by tornaria against master on the void-packages repository
https://github.com/tornaria/void-packages pyo3-refactor
https://github.com/void-linux/void-packages/pull/46086
Refactor PYO3_CROSS_* in rust build-helper
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR: **briefly**
<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->
<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- aarch64-musl
- armv7l
- armv6l-musl
-->
A patch file from https://github.com/void-linux/void-packages/pull/46086.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-pyo3-refactor-46086.patch --]
[-- Type: text/x-diff, Size: 6207 bytes --]
From 02690f80580dade1c9057636ea455317d22c90cb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sat, 16 Sep 2023 11:49:40 -0300
Subject: [PATCH 1/5] common/build-helper/rust.sh: fix cross for pyo3
---
common/build-helper/rust.sh | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/common/build-helper/rust.sh b/common/build-helper/rust.sh
index f689f7c7f9d96..96ec351d545d9 100644
--- a/common/build-helper/rust.sh
+++ b/common/build-helper/rust.sh
@@ -33,6 +33,10 @@ fi
# For cross-compiling rust -sys crates
export PKG_CONFIG_ALLOW_CROSS=1
+# For cross-compiling pyo3 bindings
+export PYO3_CROSS_LIB_DIR="${XBPS_CROSS_BASE}/usr/lib"
+export PYO3_CROSS_INCLUDE_DIR="${XBPS_CROSS_BASE}/usr/include"
+
# gettext-rs
export GETTEXT_BIN_DIR=/usr/bin
export GETTEXT_LIB_DIR="${XBPS_CROSS_BASE}/usr/lib/gettext"
From eaf7f8aa01fd9af3ca31b30c60578ca6cc2f309d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sat, 16 Sep 2023 11:56:15 -0300
Subject: [PATCH 2/5] python3-adblock: refactor PYO3_CROSS_*
---
srcpkgs/python3-adblock/template | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/srcpkgs/python3-adblock/template b/srcpkgs/python3-adblock/template
index 52736e7cbf819..de50cfe87bdc1 100644
--- a/srcpkgs/python3-adblock/template
+++ b/srcpkgs/python3-adblock/template
@@ -6,7 +6,7 @@ build_style=python3-pep517
build_helper="rust"
#XXX: Does statically link against openssl
hostmakedepends="maturin pkg-config cargo openssl-devel"
-makedepends="openssl-devel python3-devel"
+makedepends="openssl-devel python3-devel rust-std"
depends="python3"
checkdepends="python3-pytest python3-toml"
short_desc="Brave's adblock library in Python"
@@ -17,12 +17,6 @@ changelog="https://raw.githubusercontent.com/ArniDagur/python-adblock/master/CHA
distfiles="${PYPI_SITE}/a/adblock/adblock-${version}.tar.gz"
checksum=11651e956c69b3ee571404754df665854717255b80f437e9dc323ee82b564e72
-if [ "$CROSS_BUILD" ]; then
- makedepends+=" rust-std"
- export PYO3_CROSS_LIB_DIR="${XBPS_CROSS_BASE}/usr/lib"
- export PYO3_CROSS_INCLUDE_DIR="${XBPS_CROSS_BASE}/usr/include"
-fi
-
do_build() {
maturin build -o . --release --target "${RUST_TARGET}" --manylinux off
From dd8bf1468267e9b661968c5bd6ee94538822b848 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sat, 16 Sep 2023 11:56:23 -0300
Subject: [PATCH 3/5] python3-bcrypt: refactor PYO3_CROSS_*
---
srcpkgs/python3-bcrypt/template | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/srcpkgs/python3-bcrypt/template b/srcpkgs/python3-bcrypt/template
index f70c39db3e288..90e727aeac53f 100644
--- a/srcpkgs/python3-bcrypt/template
+++ b/srcpkgs/python3-bcrypt/template
@@ -5,7 +5,7 @@ revision=1
build_style=python3-pep517
build_helper="rust"
hostmakedepends="python3-setuptools-rust python3-wheel python3-cffi cargo"
-makedepends="python3-devel"
+makedepends="python3-devel rust-std"
depends="python3-cffi"
checkdepends="python3-pytest $depends"
short_desc="Modern password hashing for software and servers"
@@ -15,9 +15,3 @@ homepage="https://github.com/pyca/bcrypt"
changelog="https://github.com/pyca/bcrypt/blob/main/README.rst#changelog"
distfiles="${PYPI_SITE}/b/bcrypt/bcrypt-${version}.tar.gz"
checksum=27d375903ac8261cfe4047f6709d16f7d18d39b1ec92aaf72af989552a650ebd
-
-if [ "$CROSS_BUILD" ]; then
- makedepends+=" rust-std"
- export PYO3_CROSS_LIB_DIR="${XBPS_CROSS_BASE}/usr/lib"
- export PYO3_CROSS_INCLUDE_DIR="${XBPS_CROSS_BASE}/usr/include"
-fi
From dca4eb13745f88a87758addc2b7a7318a30ea602 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sat, 16 Sep 2023 11:56:34 -0300
Subject: [PATCH 4/5] python3-cryptography: refactor PYO3_CROSS_*
---
srcpkgs/python3-cryptography/template | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/srcpkgs/python3-cryptography/template b/srcpkgs/python3-cryptography/template
index b183104aa66e8..672c194423c3f 100644
--- a/srcpkgs/python3-cryptography/template
+++ b/srcpkgs/python3-cryptography/template
@@ -6,7 +6,7 @@ build_style=python3-module
build_helper="rust"
make_check_args="--ignore tests/bench/test_x509.py --ignore tests/bench/test_aead.py"
hostmakedepends="python3-setuptools-rust python3-cffi cargo pkg-config"
-makedepends="python3-devel openssl-devel"
+makedepends="python3-devel rust-std openssl-devel"
depends="python3-cffi"
checkdepends="python3-pytest-subtests python3-pytest-xdist
python3-iso8601 python3-pytz python3-cryptography_vectors
@@ -19,12 +19,6 @@ changelog="https://raw.githubusercontent.com/pyca/cryptography/master/CHANGELOG.
distfiles="${PYPI_SITE}/c/cryptography/cryptography-${version}.tar.gz"
checksum=6d192741113ef5e30d89dcb5b956ef4e1578f304708701b8b73d38e3e1461f34
-if [ "$CROSS_BUILD" ]; then
- makedepends+=" rust-std"
- export PYO3_CROSS_LIB_DIR="${XBPS_CROSS_BASE}/usr/lib"
- export PYO3_CROSS_INCLUDE_DIR="${XBPS_CROSS_BASE}/usr/include"
-fi
-
pre_check() {
vsed -i '/addopts/d' pyproject.toml
}
From 7cb25e94eec0a7eebead29f52b6ad8ae5bbab528 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sat, 16 Sep 2023 11:56:49 -0300
Subject: [PATCH 5/5] python3-mitmproxy_wireguard: refactor PYO3_CROSS_*
---
srcpkgs/python3-mitmproxy_wireguard/template | 4 ----
1 file changed, 4 deletions(-)
diff --git a/srcpkgs/python3-mitmproxy_wireguard/template b/srcpkgs/python3-mitmproxy_wireguard/template
index bfa34a389a294..13c515928839a 100644
--- a/srcpkgs/python3-mitmproxy_wireguard/template
+++ b/srcpkgs/python3-mitmproxy_wireguard/template
@@ -16,10 +16,6 @@ distfiles="https://github.com/decathorpe/mitmproxy_wireguard/archive/${version}.
checksum=749b5b45222b629f4cced154cc4bf70ba7ae3061db02e2ea0ae45a4ae6246463
do_build() {
- if [ "$CROSS_BUILD" ]; then
- export PYO3_CROSS_LIB_DIR="${XBPS_CROSS_BASE}/usr/lib"
- export PYO3_CROSS_INCLUDE_DIR="${XBPS_CROSS_BASE}/usr/include"
- fi
# Taken from ../python3-adblock/template
maturin build -o . --release --target "${RUST_TARGET}" --manylinux off
mkdir -p dist
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Refactor PYO3_CROSS_* in rust build-helper
2023-09-16 15:04 [PR PATCH] Refactor PYO3_CROSS_* in rust build-helper tornaria
@ 2023-09-26 18:49 ` ahesford
2023-09-26 18:50 ` ahesford
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: ahesford @ 2023-09-26 18:49 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 282 bytes --]
New comment by ahesford on void-packages repository
https://github.com/void-linux/void-packages/pull/46086#issuecomment-1736097609
Comment:
Can you rebase this and make the commit messages to something a bit more descriptive, like "inherit PYO3_CROSS variables from rust helper"?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Refactor PYO3_CROSS_* in rust build-helper
2023-09-16 15:04 [PR PATCH] Refactor PYO3_CROSS_* in rust build-helper tornaria
2023-09-26 18:49 ` ahesford
@ 2023-09-26 18:50 ` ahesford
2023-09-26 19:12 ` [PR PATCH] [Updated] " tornaria
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: ahesford @ 2023-09-26 18:50 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 269 bytes --]
New comment by ahesford on void-packages repository
https://github.com/void-linux/void-packages/pull/46086#issuecomment-1736097609
Comment:
Can you rebase this and make the commit messages a bit more descriptive, like "inherit PYO3_CROSS variables from rust helper"?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PR PATCH] [Updated] Refactor PYO3_CROSS_* in rust build-helper
2023-09-16 15:04 [PR PATCH] Refactor PYO3_CROSS_* in rust build-helper tornaria
2023-09-26 18:49 ` ahesford
2023-09-26 18:50 ` ahesford
@ 2023-09-26 19:12 ` tornaria
2023-09-26 19:12 ` tornaria
2023-09-26 19:34 ` [PR PATCH] [Merged]: " ahesford
4 siblings, 0 replies; 6+ messages in thread
From: tornaria @ 2023-09-26 19:12 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1271 bytes --]
There is an updated pull request by tornaria against master on the void-packages repository
https://github.com/tornaria/void-packages pyo3-refactor
https://github.com/void-linux/void-packages/pull/46086
Refactor PYO3_CROSS_* in rust build-helper
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR: **briefly**
<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->
<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- aarch64-musl
- armv7l
- armv6l-musl
-->
A patch file from https://github.com/void-linux/void-packages/pull/46086.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-pyo3-refactor-46086.patch --]
[-- Type: text/x-diff, Size: 5441 bytes --]
From c11a2ce804f70dcfb7f37db9c01685aae1f70348 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sat, 16 Sep 2023 11:56:15 -0300
Subject: [PATCH 1/4] python3-adblock: inherit PYO3_CROSS variables from rust
helper
---
srcpkgs/python3-adblock/template | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/srcpkgs/python3-adblock/template b/srcpkgs/python3-adblock/template
index 52736e7cbf819..de50cfe87bdc1 100644
--- a/srcpkgs/python3-adblock/template
+++ b/srcpkgs/python3-adblock/template
@@ -6,7 +6,7 @@ build_style=python3-pep517
build_helper="rust"
#XXX: Does statically link against openssl
hostmakedepends="maturin pkg-config cargo openssl-devel"
-makedepends="openssl-devel python3-devel"
+makedepends="openssl-devel python3-devel rust-std"
depends="python3"
checkdepends="python3-pytest python3-toml"
short_desc="Brave's adblock library in Python"
@@ -17,12 +17,6 @@ changelog="https://raw.githubusercontent.com/ArniDagur/python-adblock/master/CHA
distfiles="${PYPI_SITE}/a/adblock/adblock-${version}.tar.gz"
checksum=11651e956c69b3ee571404754df665854717255b80f437e9dc323ee82b564e72
-if [ "$CROSS_BUILD" ]; then
- makedepends+=" rust-std"
- export PYO3_CROSS_LIB_DIR="${XBPS_CROSS_BASE}/usr/lib"
- export PYO3_CROSS_INCLUDE_DIR="${XBPS_CROSS_BASE}/usr/include"
-fi
-
do_build() {
maturin build -o . --release --target "${RUST_TARGET}" --manylinux off
From 0c89dced5336feb958966f7e0acb6fe445951477 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sat, 16 Sep 2023 11:56:23 -0300
Subject: [PATCH 2/4] python3-bcrypt: inherit PYO3_CROSS variables from rust
helper
---
srcpkgs/python3-bcrypt/template | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/srcpkgs/python3-bcrypt/template b/srcpkgs/python3-bcrypt/template
index f70c39db3e288..90e727aeac53f 100644
--- a/srcpkgs/python3-bcrypt/template
+++ b/srcpkgs/python3-bcrypt/template
@@ -5,7 +5,7 @@ revision=1
build_style=python3-pep517
build_helper="rust"
hostmakedepends="python3-setuptools-rust python3-wheel python3-cffi cargo"
-makedepends="python3-devel"
+makedepends="python3-devel rust-std"
depends="python3-cffi"
checkdepends="python3-pytest $depends"
short_desc="Modern password hashing for software and servers"
@@ -15,9 +15,3 @@ homepage="https://github.com/pyca/bcrypt"
changelog="https://github.com/pyca/bcrypt/blob/main/README.rst#changelog"
distfiles="${PYPI_SITE}/b/bcrypt/bcrypt-${version}.tar.gz"
checksum=27d375903ac8261cfe4047f6709d16f7d18d39b1ec92aaf72af989552a650ebd
-
-if [ "$CROSS_BUILD" ]; then
- makedepends+=" rust-std"
- export PYO3_CROSS_LIB_DIR="${XBPS_CROSS_BASE}/usr/lib"
- export PYO3_CROSS_INCLUDE_DIR="${XBPS_CROSS_BASE}/usr/include"
-fi
From 0b48c2288cf5a9d1421b41020e47d4e3427c1640 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sat, 16 Sep 2023 11:56:34 -0300
Subject: [PATCH 3/4] python3-cryptography: inherit PYO3_CROSS variables from
rust helper
---
srcpkgs/python3-cryptography/template | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/srcpkgs/python3-cryptography/template b/srcpkgs/python3-cryptography/template
index b183104aa66e8..672c194423c3f 100644
--- a/srcpkgs/python3-cryptography/template
+++ b/srcpkgs/python3-cryptography/template
@@ -6,7 +6,7 @@ build_style=python3-module
build_helper="rust"
make_check_args="--ignore tests/bench/test_x509.py --ignore tests/bench/test_aead.py"
hostmakedepends="python3-setuptools-rust python3-cffi cargo pkg-config"
-makedepends="python3-devel openssl-devel"
+makedepends="python3-devel rust-std openssl-devel"
depends="python3-cffi"
checkdepends="python3-pytest-subtests python3-pytest-xdist
python3-iso8601 python3-pytz python3-cryptography_vectors
@@ -19,12 +19,6 @@ changelog="https://raw.githubusercontent.com/pyca/cryptography/master/CHANGELOG.
distfiles="${PYPI_SITE}/c/cryptography/cryptography-${version}.tar.gz"
checksum=6d192741113ef5e30d89dcb5b956ef4e1578f304708701b8b73d38e3e1461f34
-if [ "$CROSS_BUILD" ]; then
- makedepends+=" rust-std"
- export PYO3_CROSS_LIB_DIR="${XBPS_CROSS_BASE}/usr/lib"
- export PYO3_CROSS_INCLUDE_DIR="${XBPS_CROSS_BASE}/usr/include"
-fi
-
pre_check() {
vsed -i '/addopts/d' pyproject.toml
}
From 493f69587f6362efaa7eea822e159a9be974327a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sat, 16 Sep 2023 11:56:49 -0300
Subject: [PATCH 4/4] python3-mitmproxy_wireguard: inherit PYO3_CROSS variables
from rust helper
---
srcpkgs/python3-mitmproxy_wireguard/template | 4 ----
1 file changed, 4 deletions(-)
diff --git a/srcpkgs/python3-mitmproxy_wireguard/template b/srcpkgs/python3-mitmproxy_wireguard/template
index bfa34a389a294..13c515928839a 100644
--- a/srcpkgs/python3-mitmproxy_wireguard/template
+++ b/srcpkgs/python3-mitmproxy_wireguard/template
@@ -16,10 +16,6 @@ distfiles="https://github.com/decathorpe/mitmproxy_wireguard/archive/${version}.
checksum=749b5b45222b629f4cced154cc4bf70ba7ae3061db02e2ea0ae45a4ae6246463
do_build() {
- if [ "$CROSS_BUILD" ]; then
- export PYO3_CROSS_LIB_DIR="${XBPS_CROSS_BASE}/usr/lib"
- export PYO3_CROSS_INCLUDE_DIR="${XBPS_CROSS_BASE}/usr/include"
- fi
# Taken from ../python3-adblock/template
maturin build -o . --release --target "${RUST_TARGET}" --manylinux off
mkdir -p dist
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Refactor PYO3_CROSS_* in rust build-helper
2023-09-16 15:04 [PR PATCH] Refactor PYO3_CROSS_* in rust build-helper tornaria
` (2 preceding siblings ...)
2023-09-26 19:12 ` [PR PATCH] [Updated] " tornaria
@ 2023-09-26 19:12 ` tornaria
2023-09-26 19:34 ` [PR PATCH] [Merged]: " ahesford
4 siblings, 0 replies; 6+ messages in thread
From: tornaria @ 2023-09-26 19:12 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 279 bytes --]
New comment by tornaria on void-packages repository
https://github.com/void-linux/void-packages/pull/46086#issuecomment-1736141788
Comment:
> Can you rebase this and make the commit messages a bit more descriptive, like "inherit PYO3_CROSS variables from rust helper"?
done
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PR PATCH] [Merged]: Refactor PYO3_CROSS_* in rust build-helper
2023-09-16 15:04 [PR PATCH] Refactor PYO3_CROSS_* in rust build-helper tornaria
` (3 preceding siblings ...)
2023-09-26 19:12 ` tornaria
@ 2023-09-26 19:34 ` ahesford
4 siblings, 0 replies; 6+ messages in thread
From: ahesford @ 2023-09-26 19:34 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1107 bytes --]
There's a merged pull request on the void-packages repository
Refactor PYO3_CROSS_* in rust build-helper
https://github.com/void-linux/void-packages/pull/46086
Description:
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR: **briefly**
<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->
<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- aarch64-musl
- armv7l
- armv6l-musl
-->
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-09-26 19:34 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-16 15:04 [PR PATCH] Refactor PYO3_CROSS_* in rust build-helper tornaria
2023-09-26 18:49 ` ahesford
2023-09-26 18:50 ` ahesford
2023-09-26 19:12 ` [PR PATCH] [Updated] " tornaria
2023-09-26 19:12 ` tornaria
2023-09-26 19:34 ` [PR PATCH] [Merged]: " ahesford
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).