From 6af74657548ac71584cf3a43674182eb1727c8b7 Mon Sep 17 00:00:00 2001 From: messense Date: Thu, 9 Apr 2026 19:43:32 +0800 Subject: [PATCH 1/2] Release v1.13.0 --- Cargo.lock | 20 ++++++++++---------- Cargo.toml | 2 +- Changelog.md | 45 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c654d39fa..7117d3fdb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -868,7 +868,7 @@ dependencies = [ "libc", "option-ext", "redox_users", - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] @@ -962,7 +962,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -1439,7 +1439,7 @@ checksum = "3640c1c38b8e4e43584d8df18be5fc6b0aa314ce6ebf51b53313d4306cca8e46" dependencies = [ "hermit-abi", "libc", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -1666,7 +1666,7 @@ dependencies = [ [[package]] name = "maturin" -version = "1.12.6" +version = "1.13.0" dependencies = [ "anyhow", "arwen", @@ -1882,7 +1882,7 @@ version = "0.50.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] @@ -2013,7 +2013,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d8fae84b431384b68627d0f9b3b1245fcf9f46f6c0e3dc902e9dce64edd1967" dependencies = [ "libc", - "windows-sys 0.61.2", + "windows-sys 0.45.0", ] [[package]] @@ -2599,7 +2599,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -2656,7 +2656,7 @@ dependencies = [ "security-framework 3.5.1", "security-framework-sys", "webpki-root-certs", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -3136,7 +3136,7 @@ dependencies = [ "getrandom 0.3.4", "once_cell", "rustix", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -3817,7 +3817,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 9f4a1f046..22d15289e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] authors = ["konstin ", "messense "] name = "maturin" -version = "1.12.6" +version = "1.13.0" description = "Build and publish crates with pyo3, cffi and uniffi bindings as well as rust binaries as python packages" exclude = [ "test-crates/**/*", diff --git a/Changelog.md b/Changelog.md index c2ab8277f..2a70f0255 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,50 @@ # Changelog +## 1.13.0 + +* Refactor: unified interpreter resolution pipeline ([#3032](https://github.com/pyo3/maturin/pull/3032)) +* Refactor: decompose large modules into focused submodules ([#3052](https://github.com/pyo3/maturin/pull/3052)) +* Keep cargo build artifact at original path after staging ([#3054](https://github.com/pyo3/maturin/pull/3054)) +* Fix `--strip` conflicting with `--include-debuginfo` in develop ([#3057](https://github.com/pyo3/maturin/pull/3057)) +* Fix abi3 wheel producing version-specific tags for CPython below minimum ([#3061](https://github.com/pyo3/maturin/pull/3061)) +* Generate-ci: use uv pip for pytest steps to fix local wheel preference ([#3063](https://github.com/pyo3/maturin/pull/3063)) +* Update reflink-copy to 0.1.29 to fix sparc Linux builds +* Add `[tool.maturin.generate-ci.github]` config support ([#3066](https://github.com/pyo3/maturin/pull/3066)) +* Fix(sdist): handle parent workspaces and refactor sdist generation ([#3055](https://github.com/pyo3/maturin/pull/3055)) +* Test: refactor integration suite and switch mixed fixtures to cffi ([#3068](https://github.com/pyo3/maturin/pull/3068)) +* Fix `data` symlink permission handling ([#3069](https://github.com/pyo3/maturin/pull/3069)) +* Fix: correct bugs in audit.rs typo and module_writer ([#3070](https://github.com/pyo3/maturin/pull/3070)) +* Perf: use lazy-initialized regexes instead of per-call compilation ([#3071](https://github.com/pyo3/maturin/pull/3071)) +* Refactor: extract duplicated helpers and reduce code repetition ([#3072](https://github.com/pyo3/maturin/pull/3072)) +* Refactor: split monster functions into focused methods ([#3073](https://github.com/pyo3/maturin/pull/3073)) +* Refactor: improve type safety and API clarity ([#3074](https://github.com/pyo3/maturin/pull/3074)) +* Refactor: cleanup anti-patterns ([#3075](https://github.com/pyo3/maturin/pull/3075)) +* Refactor: decompose `build_context` into focused submodules ([#3076](https://github.com/pyo3/maturin/pull/3076)) +* Fix: skip legacy manylinux aliases not in PyPI allow-list ([#3078](https://github.com/pyo3/maturin/pull/3078)) +* Fix: auto-generate `.def` file for zig + windows-gnu to export `PyInit` symbol ([#3079](https://github.com/pyo3/maturin/pull/3079)) +* Ci: upgrade run-on-arch-action to ubuntu24.04, add deadsnakes PPA for newer Python ([#3081](https://github.com/pyo3/maturin/pull/3081)) +* Fix: pass `-undefined dynamic_lookup` via `CARGO_ENCODED_RUSTFLAGS` on macOS ([#3083](https://github.com/pyo3/maturin/pull/3083)) +* Feat: add Profile-Guided Optimization (PGO) support ([#3085](https://github.com/pyo3/maturin/pull/3085)) +* Respect `metadata_directory` in `build_wheel` per PEP 517 ([#3086](https://github.com/pyo3/maturin/pull/3086)) +* Update lddtree to 0.5.0 +* Fix cargo path with puccinialin for Windows ([#3093](https://github.com/pyo3/maturin/pull/3093)) +* Update and pin cargo-cyclonedx to 0.5.9 +* Ci: improve GitHub Actions generation logic ([#3097](https://github.com/pyo3/maturin/pull/3097)) +* Refactor: split BuildOptions and BuildContext into logical sub-groups ([#3098](https://github.com/pyo3/maturin/pull/3098)) +* Refactor: move subcommands to separate modules ([#3099](https://github.com/pyo3/maturin/pull/3099)) +* Refactor: decouple build orchestration from BuildContext ([#3100](https://github.com/pyo3/maturin/pull/3100)) +* Upgrade pyo3 to 0.28 ([#3101](https://github.com/pyo3/maturin/pull/3101)) +* Fix: only enable include_debuginfo by default on Windows in develop command +* PyO3: Adds `--generate_stubs` build options ([#3105](https://github.com/pyo3/maturin/pull/3105)) +* Fix: prevent panic when no interpreters match abi3 minimum version ([#3108](https://github.com/pyo3/maturin/pull/3108)) +* Refactor to store CPython ABI metadata in a struct combining two enums ([#3110](https://github.com/pyo3/maturin/pull/3110)) +* Refactor: introduce `WheelRepairer` trait ([#3112](https://github.com/pyo3/maturin/pull/3112)) +* Feat: re-implement delocate for repairing macOS wheels ([#3114](https://github.com/pyo3/maturin/pull/3114)) +* PyO3: Adds generate-stubs command ([#3115](https://github.com/pyo3/maturin/pull/3115)) +* Feat: re-implement delvewheel for repairing Windows wheels ([#3116](https://github.com/pyo3/maturin/pull/3116)) +* Add auditwheel Warn mode, default to Warn on macOS/Windows ([#3121](https://github.com/pyo3/maturin/pull/3121)) +* Feat: Support large zip files ([#3118](https://github.com/pyo3/maturin/pull/3118)) + ## 1.12.6 * Sync legacy_py.rs with upstream PyPI warehouse legacy.py ([#3053](https://github.com/PyO3/maturin/pull/3053)) From 63ed379d7e57d3648dbbfdcba82ed1231e26c9bd Mon Sep 17 00:00:00 2001 From: messense Date: Thu, 9 Apr 2026 20:02:17 +0800 Subject: [PATCH 2/2] Detect Android API level via clang target triple on Termux When running natively on Android (e.g. Termux), detect the platform via the uname release string and use clang -dumpmachine to determine the compiler target API level instead of the device SDK. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> --- src/target/platform_tag.rs | 48 ++++++++++++++++++++++++++++++++++---- 1 file changed, 43 insertions(+), 5 deletions(-) diff --git a/src/target/platform_tag.rs b/src/target/platform_tag.rs index b2f0e23f7..b4a7359e2 100644 --- a/src/target/platform_tag.rs +++ b/src/target/platform_tag.rs @@ -358,6 +358,22 @@ fn emcc_version() -> Result { Ok(trimmed.into()) } +fn extract_android_api_level(value: &str) -> Option { + static ANDROID_RE: Lazy = Lazy::new(|| Regex::new(r"android(\d+)").unwrap()); + ANDROID_RE.captures(value).map(|caps| caps[1].to_string()) +} + +fn clang_target_triple() -> Result { + use std::process::Command; + + let output = Command::new(if cfg!(windows) { "clang.exe" } else { "clang" }) + .arg("-dumpmachine") + .output() + .context("Failed to run clang to get the target triple")?; + let target_triple = String::from_utf8(output.stdout)?; + Ok(target_triple.trim().to_string()) +} + fn find_android_api_level(target_triple: &str, manifest_path: &Path) -> Result { if let Ok(val) = env::var("ANDROID_API_LEVEL") { return Ok(val); @@ -381,14 +397,23 @@ fn find_android_api_level(target_triple: &str, manifest_path: &Path) -> Result = Lazy::new(|| Regex::new(r"android(\d+)").unwrap()); for clue in clues { - if let Some(caps) = ANDROID_RE.captures(&clue) { - return Ok(caps[1].to_string()); + if let Some(api_level) = extract_android_api_level(&clue) { + return Ok(api_level); } } + // 3. Check if running on Android (e.g. Termux), then use clang's default target triple + let is_android = PlatformInfo::new() + .map(|info| info.release().to_string_lossy().contains("android")) + .unwrap_or(false); + if is_android + && let Ok(target_triple) = clang_target_triple() + && let Some(api_level) = extract_android_api_level(&target_triple) + { + return Ok(api_level); + } + bail!( "Failed to determine Android API level. Please set the ANDROID_API_LEVEL environment variable." ); @@ -396,7 +421,7 @@ fn find_android_api_level(target_triple: &str, manifest_path: &Path) -> Result