-
-
Notifications
You must be signed in to change notification settings - Fork 230
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
fix: maturin develop
can compile on macOS with M1/M2 chip
#1015
Conversation
✅ Deploy Preview for maturin-guide canceled.Built without sensitive environment variables
|
@@ -35,9 +35,9 @@ pub fn develop( | |||
Ok(output) if output.status.success() => { | |||
let platform = String::from_utf8_lossy(&output.stdout); | |||
if platform.contains("macos") { | |||
if platform.contains("x86_64") && target.target_arch() != Arch::X86_64 { | |||
if platform.contains("x86_64") && target.target_arch() == Arch::X86_64 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on the discussion in #1013, can you add a debug print here and paste the output here.
println!("{} {:?}", platform, target.target_arch());
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
macosx-10.14.6-arm64 Aarch64
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then the offending code shouldn't be these two I think? It might be related to the target_triple
variable, can you try #1016 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But if I append --target aarch64-apple-darwin
, it works fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then you have to debug further, based on the macosx-10.14.6-arm64 Aarch64
output it shouldn't reach these two lines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try add println!("{:#?}", build_options);
just above
Line 68 in 86b5dfc
let build_context = build_options.into_build_context(release, strip, true)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BuildOptions {
platform_tag: [
Linux,
],
interpreter: [
"/Users/pvon/Documents/string_sum/.env/bin/python",
],
find_interpreter: false,
bindings: None,
out: Some(
"/var/folders/0r/tkx69nhn6vg6sr0w1c6nnsxr0000gn/T/.tmpAolWXa",
),
skip_auditwheel: false,
zig: false,
universal2: false,
cargo: CargoOptions {
quiet: false,
jobs: None,
profile: None,
features: [],
all_features: false,
no_default_features: false,
target: None,
target_dir: None,
manifest_path: None,
ignore_rust_version: false,
verbose: 0,
color: None,
frozen: false,
locked: false,
offline: false,
config: [],
unstable_flags: [],
timings: None,
future_incompat_report: false,
args: [],
},
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing seems wrong, I can't reproduce this issue, so you have to debug on your own.
Try to track down where did the target triple changed to x86_64.
maturin develop
can compile on MacOS with M1/M2 chipmaturin develop
can compile on macOS with M1/M2 chip
#1013
This fix can make
maturin develop
compile successfully in my local environment.