Skip to content

Compile error when compiling rustc for ios. #26939

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

Closed
SirVer opened this issue Jul 10, 2015 · 7 comments
Closed

Compile error when compiling rustc for ios. #26939

SirVer opened this issue Jul 10, 2015 · 7 comments

Comments

@SirVer
Copy link

SirVer commented Jul 10, 2015

This is d0d3707.

I am trying to follow this tutorial to learn something about iOS. It contains a step about cross compiling rustc for iOS:

$ mkdir build && cd build
$ ../configure --target=armv7-apple-ios,armv7s-apple-ios,i386-apple-ios,aarch64-apple-ios,x86_64-apple-ios --prefix=/opt/rust-ios-toolchains

$ make -j8
...tons of output...

rustc: x86_64-apple-darwin/stage2/lib/rustlib/x86_64-apple-darwin/lib/librustc_bitflags
rustc: x86_64-apple-darwin/stage2/lib/rustlib/armv7-apple-ios/lib/liballoc
rustc: x86_64-apple-darwin/stage2/lib/rustlib/armv7s-apple-ios/lib/liballoc
rustc: x86_64-apple-darwin/stage2/lib/rustlib/aarch64-apple-ios/lib/liballoc
rustc: x86_64-apple-darwin/stage2/lib/rustlib/x86_64-apple-ios/lib/libcollections
rustc: x86_64-apple-darwin/stage2/lib/rustlib/x86_64-apple-darwin/lib/liballoc
rustc: x86_64-apple-darwin/stage2/lib/rustlib/armv7-apple-ios/lib/libcollections
rustc: x86_64-apple-darwin/stage2/lib/rustlib/armv7s-apple-ios/lib/libcollections
rustc: x86_64-apple-darwin/stage2/lib/rustlib/i386-apple-ios/lib/libcollections
rustc: x86_64-apple-darwin/stage2/lib/rustlib/aarch64-apple-ios/lib/libcollections
rustc: x86_64-apple-darwin/stage2/lib/rustlib/x86_64-apple-darwin/lib/libcollections
rustc: x86_64-apple-darwin/stage2/lib/rustlib/x86_64-apple-ios/lib/libstd
rustc: x86_64-apple-darwin/stage2/lib/rustlib/armv7-apple-ios/lib/libstd
warning: dropping unsupported crate type `dylib` for target `x86_64-apple-ios`
warning: dropping unsupported crate type `dylib` for target `armv7-apple-ios`
rustc: x86_64-apple-darwin/stage2/lib/rustlib/armv7s-apple-ios/lib/libstd
rustc: x86_64-apple-darwin/stage2/lib/rustlib/i386-apple-ios/lib/libstd
warning: dropping unsupported crate type `dylib` for target `armv7s-apple-ios`
warning: dropping unsupported crate type `dylib` for target `i386-apple-ios`
rustc: x86_64-apple-darwin/stage2/lib/rustlib/aarch64-apple-ios/lib/libstd
warning: dropping unsupported crate type `dylib` for target `aarch64-apple-ios`
rustc: x86_64-apple-darwin/stage2/lib/rustlib/x86_64-apple-darwin/lib/libstd
../src/libstd/sys/unix/backtrace.rs:133:5: 133:17 error: use of unstable library feature 'result_fold': has not seen enough usage to justify its position in the standard library
../src/libstd/sys/unix/backtrace.rs:133     result::fold(iter, (), |_, _| ())
                                            ^~~~~~~~~~~~
../src/libstd/sys/unix/backtrace.rs:133:5: 133:17 help: add #![feature(result_fold)] to the crate attributes to enable
../src/libstd/sys/unix/backtrace.rs:133:5: 133:17 error: use of deprecated item: has not seen enough usage to justify its position in the standard library, #[deny(deprecated)] on by default
../src/libstd/sys/unix/backtrace.rs:133     result::fold(iter, (), |_, _| ())
                                            ^~~~~~~~~~~~
error: aborting due to 2 previous errors
make: *** [x86_64-apple-darwin/stage2/lib/rustlib/armv7-apple-ios/lib/stamp.std] Error 101
make: *** Waiting for unfinished jobs....
../src/libstd/sys/unix/backtrace.rs:133:5: 133:17 error: use of unstable library feature 'result_fold': has not seen enough usage to justify its position in the standard library
../src/libstd/sys/unix/backtrace.rs:133     result::fold(iter, (), |_, _| ())
                                            ^~~~~~~~~~~~
../src/libstd/sys/unix/backtrace.rs:133:5: 133:17 help: add #![feature(result_fold)] to the crate attributes to enable
../src/libstd/sys/unix/backtrace.rs:133:5: 133:17 error: use of deprecated item: has not seen enough usage to justify its position in the standard library, #[deny(deprecated)] on by default
../src/libstd/sys/unix/backtrace.rs:133     result::fold(iter, (), |_, _| ())
                                            ^~~~~~~~~~~~
error: aborting due to 2 previous errors
make: *** [x86_64-apple-darwin/stage2/lib/rustlib/armv7s-apple-ios/lib/stamp.std] Error 101

Seems like an honest bug - I wonder why I only see this with these config flags? Am I doing it wrong?

@azilber
Copy link

azilber commented Jul 10, 2015

I've literally just went through this same guide a few hours ago, including the 'Makefile'. I've had a successful build and tested on iphone 4-6plus emulators. Not sure what your versions are, and it would be helpful if you posted that, but I'm on OSX 10.10.4 using Xcode 6.4 and Rust 1.1.0-dev.

I didn't follow the instructions completely though, because I woudn't really want to use nightlies for serious dev. Do multirust default stable instead instead of nightly (as nightly is 1.3 as of this writing). Do a make clean, re-run configure, and make again.

@SirVer
Copy link
Author

SirVer commented Jul 10, 2015

As stated, I am using a current checkout, namely d0d3707.

I have no doubts that it works with earlier versions (the blog author could make it work obviously) - but the bug seems to be a real one in rust, so I reported it.

I do not get so far as to selecting a toolchain - already the building of the ios rustc fails. Of course this is a Mac OS X system (10.10.4).

@SirVer
Copy link
Author

SirVer commented Jul 10, 2015

stable works, I checked with this:

$ git checkout stable
$ git submodule update --init --recursive
$ cd build && --target=armv7-apple-ios,armv7s-apple-ios,i386-apple-ios,aarch64-apple-ios,x86_64-apple-ios --prefix=/opt/rust-ios-toolchains && make install

the beta branch fails with the same error as current HEAD.

@steveklabnik
Copy link
Member

/cc @brson , if this is an issue with beta but not stable, we need to figure out what's up

@alexcrichton
Copy link
Member

iOS isn't an officially supported platform right now, so the build will inevitably fail from time to time. Feel free to submit a PR to fix this, however! The fix would either include:

  • Removing the use of result::fold
  • Adding #![cfg_attr(target_os = "ios", feature(result_fold))] to the crate attributes

@tamird
Copy link
Contributor

tamird commented Jul 16, 2015

I'll see about fixing this today or tomorrow

@SirVer
Copy link
Author

SirVer commented Jul 18, 2015

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants