Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated --universal2 cli option #1620

Merged
merged 1 commit into from
May 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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