From c2c9e705a9d651593da18212a2d9d5cf716d46e7 Mon Sep 17 00:00:00 2001 From: messense Date: Mon, 22 May 2023 12:43:17 +0800 Subject: [PATCH] Remove deprecated `--universal2` cli option (#1620) --- guide/src/develop.md | 2 +- guide/src/distribution.md | 6 +----- src/build_options.rs | 16 ++++------------ src/develop.rs | 1 - tests/cmd/build.stdout | 4 ---- tests/cmd/publish.stdout | 4 ---- 6 files changed, 6 insertions(+), 27 deletions(-) diff --git a/guide/src/develop.md b/guide/src/develop.md index 0915619a4..8e056d5da 100644 --- a/guide/src/develop.md +++ b/guide/src/develop.md @@ -89,7 +89,7 @@ Options: Outputs a future incompatibility report at the end of the build (unstable) -h, --help - Print help information (use `-h` for a summary) + Print help (see a summary with '-h') ``` ## PEP 660 Editable Installs diff --git a/guide/src/distribution.md b/guide/src/distribution.md index 99f52a2b9..b821e285d 100644 --- a/guide/src/distribution.md +++ b/guide/src/distribution.md @@ -126,10 +126,6 @@ Options: Make sure you installed zig with `pip install maturin[zig]` - --universal2 - Control whether to build universal2 wheel for macOS or not. Only applies to macOS targets, - do nothing otherwise - -q, --quiet Do not print cargo log messages @@ -190,7 +186,7 @@ Options: Outputs a future incompatibility report at the end of the build (unstable) -h, --help - Print help information (use `-h` for a summary) + Print help (see a summary with '-h') ``` ### Cross Compiling diff --git a/src/build_options.rs b/src/build_options.rs index c00feb7c2..7680c3869 100644 --- a/src/build_options.rs +++ b/src/build_options.rs @@ -185,11 +185,6 @@ pub struct BuildOptions { #[arg(long)] pub zig: bool, - /// Control whether to build universal2 wheel for macOS or not. - /// Only applies to macOS targets, do nothing otherwise. - #[arg(long)] - pub universal2: bool, - /// Cargo build options #[command(flatten)] pub cargo: CargoOptions, @@ -510,13 +505,7 @@ impl BuildOptions { let mut target_triple = self.target.clone(); - let mut universal2 = self.universal2; - if universal2 { - eprintln!("⚠️ Warning: `--universal2` is deprecated, use `--target universal2-apple-darwin` instead"); - } else if target_triple.as_deref() == Some("universal2-apple-darwin") { - universal2 = true; - target_triple = None; - } + let mut universal2 = target_triple.as_deref() == Some("universal2-apple-darwin"); // Also try to determine universal2 from ARCHFLAGS environment variable if let Ok(arch_flags) = env::var("ARCHFLAGS") { let arches: HashSet<&str> = arch_flags @@ -541,6 +530,9 @@ impl BuildOptions { _ => {} } }; + if universal2 { + target_triple = None; + } let target = Target::from_target_triple(target_triple)?; diff --git a/src/develop.rs b/src/develop.rs index ba452eadb..bdc0190ff 100644 --- a/src/develop.rs +++ b/src/develop.rs @@ -60,7 +60,6 @@ pub fn develop( skip_auditwheel: false, #[cfg(feature = "zig")] zig: false, - universal2: false, cargo: CargoOptions { target: target_triple, ..cargo_options diff --git a/tests/cmd/build.stdout b/tests/cmd/build.stdout index 64f8b9398..883fcbeba 100644 --- a/tests/cmd/build.stdout +++ b/tests/cmd/build.stdout @@ -56,10 +56,6 @@ Options: Make sure you installed zig with `pip install maturin[zig]` - --universal2 - Control whether to build universal2 wheel for macOS or not. Only applies to macOS targets, - do nothing otherwise - -q, --quiet Do not print cargo log messages diff --git a/tests/cmd/publish.stdout b/tests/cmd/publish.stdout index cb38ae3ac..6bb2b1ba7 100644 --- a/tests/cmd/publish.stdout +++ b/tests/cmd/publish.stdout @@ -90,10 +90,6 @@ Options: Make sure you installed zig with `pip install maturin[zig]` - --universal2 - Control whether to build universal2 wheel for macOS or not. Only applies to macOS targets, - do nothing otherwise - -q, --quiet Do not print cargo log messages