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

Cannot cross compile to aarch64-apple-ios #1040

Closed
bbqsrc opened this issue Sep 9, 2020 · 11 comments
Closed

Cannot cross compile to aarch64-apple-ios #1040

bbqsrc opened this issue Sep 9, 2020 · 11 comments
Labels
C-build-failure Category: This is a crate that failed to build

Comments

@bbqsrc
Copy link

bbqsrc commented Sep 9, 2020

Crate name: pathos
Build failure link: https://docs.rs/crate/pathos/0.2.0-pre.2/builds/291394

Additional details:

I added aarch64-apple-ios and aarch64-linux-android to have docs generated. My guess was this would work because macOS docs can generate and both need the same installation of Xcode to work. Well, it seems I was wrong. 😄

@jyn514
Copy link
Member

jyn514 commented Sep 10, 2020

[INFO] [stderr] error: Error loading target specification: failed to get iphoneos SDK path: No such file or directory (os error 2). Use --print target-list for a list of built-in targets

I don't know how we can fix this on our end - presumably the iphone SDK is only available on MacOS? If so, you won't be able to build for iOS targets, since the builds run on a Linux host.

You can still have some docs by removing the ios target, or by setting some other target to the default (https://docs.rs/about/metadata).

@jyn514 jyn514 added the C-build-failure Category: This is a crate that failed to build label Sep 10, 2020
@bbqsrc
Copy link
Author

bbqsrc commented Sep 10, 2020

So macOS builds also run on Linux for docs.rs? I'm curious how that works. 🙂

@jyn514
Copy link
Member

jyn514 commented Sep 10, 2020

Builds for all targets run on a Linux host; if they're not being built for Linux, they're cross-compiled. This has caused issues in the past because not all projects work when cross compiled, but the alternative is to have many different builders which isn't currently feasible.

This should probably be documented on /about/builds ... Maybe you're interested in a PR? ;)

@jyn514 jyn514 changed the title aarch64-apple-ios target causes build failure Cannot cross compile to aarch64-apple-ios Sep 10, 2020
@bbqsrc
Copy link
Author

bbqsrc commented Sep 10, 2020

We shall see if that is possible after I understand it 😛

The reason I ask how macOS is cross-compiled is that iOS should work exactly the same way, as it's effectively impossible to separate the macOS and iOS SDKs, so I'm curious where the machinery is that handles the macOS cross-compilation step.

@jyn514
Copy link
Member

jyn514 commented Sep 10, 2020

The MacOS SDK isn't installed either.

Hmmm, maybe this is a bug in the compiler - it shouldn't require an sdk unless it's doing codegen.

@bbqsrc
Copy link
Author

bbqsrc commented Sep 10, 2020

Oh, that's exciting. haha

Time for me to go poke that bear then, I'll get back to you.

@bbqsrc
Copy link
Author

bbqsrc commented Sep 10, 2020

It's definitely a compiler bug. It checks for the existence of an SDKROOT value and if that fails, called xcrun to work it out, which of course only exists on macOS.

if you create a directory named iPhoneOS.platform and then export SDKROOT=/path/to/iPhoneOS.platform to include that, you can successful build documentation on Linux.

I will now report this as a rustc bug.

@pietroalbini
Copy link
Member

I think creating a iPhoneOS.platform in our build environment and setting the environment variable in it couldn't hurt, while we wait for the bug to be fixed in rustc.

@jyn514
Copy link
Member

jyn514 commented Oct 1, 2020

This bug has been fixed upstream; once the nightly is published in a day I can queue rebuild for your crate :)

@bbqsrc
Copy link
Author

bbqsrc commented Oct 1, 2020

Oh neat! I'm glad someone got to this, because my weekends keep getting destroyed with other priorities (COVID work-life balance is a unique challenge, haha)

Thanks for caring about this issue. 😄

@jyn514
Copy link
Member

jyn514 commented Oct 22, 2020

I queued a rebuild, it should finish building by tomorrow (it has to wait a while because of #1088).

@jyn514 jyn514 closed this as completed Oct 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-build-failure Category: This is a crate that failed to build
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants