Skip to content

Commit

Permalink
Remove deprecated --universal2 cli option (#1620)
Browse files Browse the repository at this point in the history
  • Loading branch information
messense authored May 22, 2023
1 parent 701e3ae commit c2c9e70
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 27 deletions.
2 changes: 1 addition & 1 deletion guide/src/develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 1 addition & 5 deletions guide/src/distribution.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
16 changes: 4 additions & 12 deletions src/build_options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand All @@ -541,6 +530,9 @@ impl BuildOptions {
_ => {}
}
};
if universal2 {
target_triple = None;
}

let target = Target::from_target_triple(target_triple)?;

Expand Down
1 change: 0 additions & 1 deletion src/develop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ pub fn develop(
skip_auditwheel: false,
#[cfg(feature = "zig")]
zig: false,
universal2: false,
cargo: CargoOptions {
target: target_triple,
..cargo_options
Expand Down
4 changes: 0 additions & 4 deletions tests/cmd/build.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 0 additions & 4 deletions tests/cmd/publish.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit c2c9e70

Please sign in to comment.