diff mbox series

[30/45] python3-setuptools-rust: upgrade 1.12.1 -> 1.13.0

Message ID 20260706171701.70536-30-alex.kanavin@gmail.com
State New
Headers show
Series [01/45] selftest/locales: opt out of ptests in DISTRO_FEATURES | expand

Commit Message

Alexander Kanavin July 6, 2026, 5:16 p.m. UTC
From: Alexander Kanavin <alex@linutronix.de>

Add a patch to avoid build failures due to use of custom rust targets.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
 ...rustc_info.py-do-not-add-unstable-op.patch | 44 +++++++++++++++++++
 ...1.bb => python3-setuptools-rust_1.13.0.bb} |  3 +-
 2 files changed, 46 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-devtools/python/python3-setuptools-rust/0001-setuptools_rust-rustc_info.py-do-not-add-unstable-op.patch
 rename meta/recipes-devtools/python/{python3-setuptools-rust_1.12.1.bb => python3-setuptools-rust_1.13.0.bb} (83%)
diff mbox series

Patch

diff --git a/meta/recipes-devtools/python/python3-setuptools-rust/0001-setuptools_rust-rustc_info.py-do-not-add-unstable-op.patch b/meta/recipes-devtools/python/python3-setuptools-rust/0001-setuptools_rust-rustc_info.py-do-not-add-unstable-op.patch
new file mode 100644
index 0000000000..313e7454c1
--- /dev/null
+++ b/meta/recipes-devtools/python/python3-setuptools-rust/0001-setuptools_rust-rustc_info.py-do-not-add-unstable-op.patch
@@ -0,0 +1,44 @@ 
+From 8e0c0ae45a8e4274482d39ee87775ca6d8de9ccb Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex@linutronix.de>
+Date: Tue, 30 Jun 2026 21:36:12 +0200
+Subject: [PATCH] setuptools_rust/rustc_info.py: do not add 'unstable-options'
+ to rustc invocation
+
+This avoids the error:
+| error: the option `Z` is only accepted on the nightly compiler
+| 
+| help: consider switching to a nightly toolchain: `rustup default nightly`
+| 
+| note: selecting a toolchain with `+toolchain` arguments require a rustup proxy; see <https://rust-lang.github.io/rustup/concepts/index.html>
+| 
+| note: for more information about Rust's stability policy, see <https://doc.rust-lang.org/book/appendix-07-nightly-rust.html#unstable-features>
+| 
+| error: 1 nightly option were parsed
+
+Please see https://github.com/rust-lang/rust/issues/155963
+for report to upstream about why we need custom targets and why
+requiring unstable-options gets in the way, badly.
+
+Rust is meanwhile patched to not require it:
+meta/recipes-devtools/rust/files/0002-Fix-rust-build-failure-with-unstable-options.patch
+
+Upstream-Status: Inappropriate [the issue is in rustc; see above]
+
+Signed-off-by: Alexander Kanavin <alex@linutronix.de>
+---
+ setuptools_rust/rustc_info.py | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/setuptools_rust/rustc_info.py b/setuptools_rust/rustc_info.py
+index ad37249..f470e04 100644
+--- a/setuptools_rust/rustc_info.py
++++ b/setuptools_rust/rustc_info.py
+@@ -68,8 +68,6 @@ def get_rustc_cfgs(target_triple: Optional[str], env: Env) -> RustCfgs:
+ def get_rust_target_info(target_triple: Optional[str], env: Env) -> List[str]:
+     cmd = ["rustc", "--print", "cfg"]
+     if target_triple:
+-        if _is_custom_target(target_triple):
+-            cmd.extend(["-Z", "unstable-options"])
+         cmd.extend(["--target", target_triple.split(".")[0]])
+     output = check_subprocess_output(cmd, env=env, text=True)
+     return output.splitlines()
diff --git a/meta/recipes-devtools/python/python3-setuptools-rust_1.12.1.bb b/meta/recipes-devtools/python/python3-setuptools-rust_1.13.0.bb
similarity index 83%
rename from meta/recipes-devtools/python/python3-setuptools-rust_1.12.1.bb
rename to meta/recipes-devtools/python/python3-setuptools-rust_1.13.0.bb
index a1135794ba..884d6a6771 100644
--- a/meta/recipes-devtools/python/python3-setuptools-rust_1.12.1.bb
+++ b/meta/recipes-devtools/python/python3-setuptools-rust_1.13.0.bb
@@ -9,7 +9,8 @@  BUGTRACKER = "https://github.com/PyO3/setuptools-rust/issues"
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=011cd92e702dd9e6b1a26157b6fd53f5"
 
-SRC_URI[sha256sum] = "85ae70989d96c9cfeb5ef79cf3bac2d5200bc5564f720a06edceedbdf6664640"
+SRC_URI += "file://0001-setuptools_rust-rustc_info.py-do-not-add-unstable-op.patch"
+SRC_URI[sha256sum] = "f2afcf4baeee689910ce49cfa8aad4e08cce72f417449bcc32891b8664fdc726"
 
 PYPI_PACKAGE = "setuptools_rust"