-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
iOS binaries crash with latest nightly #138212
Comments
Probably unrelated, but looking for "Snapshot generation request for bundleID: com.appidentifier rejected due to the app being denylisted." one finds fyne-io/fyne#2270 and golang/go#47952 where there was a similar crash in golang. Could be unrelated as the error message is of course very unspecific. |
Yeah, indeed it is non-trivial to reproduce in terms of setup. I can try but I have never used a custom rustc version and I'm not sure how easy it is to set up for iOS builds. If you have any pointers let me know. |
Looks like I can use https://github.com/kennytm/rustup-toolchain-install-master to install specific commits. |
You may be able to use cargo-bisect-rustc which has all the necessary logic |
Unfortunately I won't have the disk space/setup to build custom rustc versions, but would be happy to test if they can be built elsewhere. I have no experience with rustc, but from the commit list the LLVM 20 update stands out. |
Thanks for the pointer to cargo-bisect-rustc. I'll give that a go. |
Tagging with LLVM but it might not be the direct cause |
@rustbot ping apple |
Hey Apple notification group! This issue or PR could use some Apple-specific (In case it's useful, here are some instructions for tackling these sorts of cc @BlackHoleFox @hkratz @inflation @madsmtm @nvzqz @shepmaster @thomcc |
To be clear, does the error come before the application even starts? As-in, it occurs as part of the installation process/before the process is launched? Or does it happen before In any case, I think this could be caused by one of:
I don't have a real iOS device to test with at the moment (would take me a while to test this with a borrowed device), could I get you try the following to help narrow down the problem:
|
A quick look at the difference in mach-o headers between a binary generated by |
I can reproduce this:
The output I get from
|
Current steps to reproduce: echo "fn main() {}" >> unstripped.rs
# Rust version doesn't matter for this
rustc +stable --target=aarch64-apple-ios unstripped.rs
$(rustc +nightly --print=sysroot)/lib/rustlib/aarch64-apple-darwin/bin/rust-objcopy unstripped stripped
# This is fine
dyld_info unstripped
# This fails
dyld_info stripped |
Right. The LLVM fix I meant as being "possibly related" not that it fixes this (it obviously is broken 😆). |
This regressed in llvm/llvm-project@1a830aa, I'll open an upstream bug |
Upstream: llvm/llvm-project#130472 |
@jieyouxu : yeah absolutely. Unfortunately, I run into: |
@tdomhan: Could you confirm whether setting [profile.release]
strip = false in your |
Yes, setting |
For <rust-lang#138212>. Looks like LLVM 20's initial `llvm-objcopy` version that we ship as `rust-objcopy` may be producing stripped iOS binaries with invalid offsets that fail iOS platform consistency checks. For the time being, use macOS system strip at `/usr/bin/strip` which should be available (unlike Linux -> macOS cross where this is not guaranteed to be available, partially why we are shipping `llvm-objcopy` in the first place) that shouldn't have this offset problem.
For <rust-lang#138212>. Looks like LLVM 20's initial `llvm-objcopy` version that we ship as `rust-objcopy` may be producing stripped iOS binaries with invalid offsets that fail iOS platform consistency checks. For the time being, use macOS system strip at `/usr/bin/strip` which should be available (unlike Linux -> macOS cross where this is not guaranteed to be available, partially why we are shipping `llvm-objcopy` in the first place) that shouldn't have this offset problem.
Ah... I'm not sure what toolchain the try-job actually produced 🤔 EDIT: I think it's because I forgot to specify a |
Use `/usr/bin/strip` on macOS -> iOS cross as a temporary workaround Crude workaround for <rust-lang#138212> to unblock nightly macOS-to-iOS cross builds. This reintroduces the "hard-coded strip" workaround (but only for iOS) that was initially introduced in rust-lang#130781. Looks like LLVM 20's initial `llvm-objcopy` version that we ship as `rust-objcopy` may be producing stripped iOS binaries with invalid offsets that fail iOS platform consistency checks. For the time being, use macOS system strip when cross-compiling from macOS -> iOS at `/usr/bin/strip` which should be available (unlike Linux -> macOS cross where this is not guaranteed to be available, partially why we are shipping `llvm-objcopy` in the first place[^linux-darwin-cross]) that shouldn't have this offset problem. ### Alternatives - We *could* also try to use a `strip` from PATH. *However*, that can regress iOS users if they have broken homebrew binutils strip in their PATH that take precedence over a "good" strip. - We could also wait for upstream `llvm-objcopy` fixes. ### Review and testing advice I don't have access to either macOS or iOS platforms, and I can't really write a test for this. This will need to be tested manually. r? `@davidtwco` (or reroll) cc *-apple-ios target maintainers `@badboy` `@deg4uss3r` `@madsmtm` try-job: dist-apple-various try-job: dist-x86_64-apple try-job: dist-aarch64-apple [^linux-darwin-cross]: rust-lang#131206
@tdomhan does this work for you? I ran another try-job but this time with actually
|
A fix has been proposed upstream (not merged yet): llvm/llvm-project#130517 |
does it also include aarch64-apple-ios? I'm able to run |
Ugh, maybe that dist toolchain doesn't include iOS. I'll wait for the apple target maintainers to double-check, or we can just wait for upstream fix. |
Yeah, you probably need |
The fix for this has been backported into LLVM's edit: According to https://discourse.llvm.org/t/llvm-20-1-0-released/85122, LLVM 20.1.1 will be releases in ~a week. |
Is the AFAICT, LLVM 20 isn't included in the current beta. (So we have a bit more time to wait for the LLVM patch to make it into Rust's LLVM version). |
Update to LLVM 20.1.1 Fixes rust-lang/rust#138212. Fixes rust-lang/rust#137909.
iOS builds (
aarch64-apple-ios
) of Dioxus apps crash on nightly-2025-02-18 (ce36a96). The latest working version is nightly-2025-02-17 (5bc6231).This problem only occurs when running on a real device, not when running the simulator.
To reproduce the error do the following:
Next sign the application, i.e. via iOS App Signer and install on a real device.
The log console shows the following errors:
The problem must have been introduced somewhere between commits ce36a96 and 5bc6231. I'd be happy to also test any other rustc binaries or try provide any other information.
The text was updated successfully, but these errors were encountered: