Docs.rs: Cannot cross compile to aarch64-apple-ios

Created on 10 Sep 2020  路  11Comments  路  Source: rust-lang/docs.rs

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. :smile:

C-build-failure

Most helpful comment

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. :smile:

All 11 comments

[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).

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

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? ;)

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.

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.

Oh, that's exciting. haha

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

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.

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.

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

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. :smile:

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

Was this page helpful?
0 / 5 - 0 ratings