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

ios builds now fail to link when compiling the test #26

Open
gnzlbg opened this issue Jul 19, 2018 · 11 comments
Open

ios builds now fail to link when compiling the test #26

gnzlbg opened this issue Jul 19, 2018 · 11 comments
Labels

Comments

@gnzlbg
Copy link
Contributor

gnzlbg commented Jul 19, 2018

They used to work (https://travis-ci.org/gnzlbg/packed_simd/builds/405449457) but now they fail; need to investigate more.

@gnzlbg gnzlbg added CI-Travis Travis-CI O-ios labels Jul 19, 2018
@gnzlbg
Copy link
Contributor Author

gnzlbg commented Jul 24, 2018

cc @kali any ideas?

@kali
Copy link

kali commented Jul 24, 2018

Not sure where to look at, link to build does not answer... give me more context, I'll be happy to see if I can help

@gnzlbg
Copy link
Contributor Author

gnzlbg commented Jul 25, 2018

So this basically uses the same ci for testing ios targets as the other std components:

  • four travis ci build bots:
    • arm-apple-ios and aarch64-apple-ios just test that cross-compiling works (we are adding more tests in this regard)
    • i386-apple-ios and x86_64-apple-ios run the full test suite in one of the simulators (these are the build bots that have started to fail)

So for these last two build bots, we have this tiny script from libc that creates a simulator instance and runs the tests and checks whether some test failed: https://github.com/rust-lang-nursery/packed_simd/blob/master/ci/deploy_and_run_on_ios_simulator.rs

and we use it as a cargo test runner: https://github.com/rust-lang-nursery/packed_simd/blob/master/ci/run.sh#L47

If I compile this library for ios with cargo build --target=x86_64-apple-ios then the compilation succeeds, but when I do ..setup test runner.. cargo test --target=x86_64-apple-ios then I get linker errors for some reason since a couple of nightly builds (this used to work before).

I have no idea why this has started happening. Maybe I am using the wrong xcode image in travis? Maybe I am missing something in RUSTFLAGS=-Clink-arg=-mios-simulator-version-min=7.0 ? No idea. The error messages are also weird, -lSystem not being found... I can reproduce this locally as well, so it is not only an issue with travis (I used to be able to run the tests in the simulator locally as well).

@kali
Copy link

kali commented Jul 25, 2018

Is this what we are talking about ?

  = note: ld: warning: text-based stub file /System/Library/Frameworks//Security.framework/Security.tbd and library file /System/Library/Frameworks//Security.framework/Security are out of sync. Falling back to library file for linking.
          ld: warning: text-based stub file /System/Library/Frameworks//Foundation.framework/Foundation.tbd and library file /System/Library/Frameworks//Foundation.framework/Foundation are out of sync. Falling back to library file for linking.
          ld: warning: ignoring file /var/folders/_6/_9b7mq2959gfgtn5kw5r0m8r0000gn/T/response-f90f64.txt, file was built for unsupported file format ( 0x2F 0x41 0x70 0x70 0x6C 0x69 0x63 0x61 0x74 0x69 0x6F 0x6E 0x73 0x2F 0x58 0x63 ) which is not the architecture being linked (arm64): /var/folders/_6/_9b7mq2959gfgtn5kw5r0m8r0000gn/T/response-f90f64.txt
          ld: warning: ignoring file /usr/lib/libSystem.dylib, missing required architecture arm64 in file /usr/lib/libSystem.dylib (2 slices)
          ld: warning: ignoring file /System/Library/Frameworks//Security.framework/Security, missing required architecture arm64 in file /System/Library/Frameworks//Security.framework/Security (2 slices)
          ld: warning: ignoring file /System/Library/Frameworks//Foundation.framework/Foundation, missing required architecture arm64 in file /System/Library/Frameworks//Foundation.framework/Foundation (2 slices)
          ld: warning: ignoring file /usr/lib/libc.dylib, missing required architecture arm64 in file /usr/lib/libc.dylib (2 slices)
          ld: warning: ignoring file /usr/lib/libm.dylib, missing required architecture arm64 in file /usr/lib/libm.dylib (2 slices)
          ld: warning: ignoring file /usr/lib/libresolv.dylib, missing required architecture arm64 in file /usr/lib/libresolv.dylib (2 slices)
          ld: warning: ignoring file /usr/lib/libobjc.dylib, missing required architecture arm64 in file /usr/lib/libobjc.dylib (3 slices)
          Undefined symbols for architecture arm64:
            "_main", referenced from:
               implicit entry/start for main executable
          ld: symbol(s) not found for architecture arm64
          clang: error: linker command failed with exit code 1 (use -v to see invocation)

@gnzlbg
Copy link
Contributor Author

gnzlbg commented Jul 25, 2018

I don't think its the same issue. I am targeting x86_64-apple-ios while that is targeting arm64/aarch64. Also the error there is that _main is not found, which is weird: the packed_simd library has no _main, but when building the tests with cargo test the test crate definitely includes a _main :/

@kali
Copy link

kali commented Jul 25, 2018

any way you can show me the actual failed build output ? :) the link in travis above is a 404

@gnzlbg
Copy link
Contributor Author

gnzlbg commented Jul 25, 2018

Check out the allow_failure jobs for i386/x86_64-apple-ios on travis: https://travis-ci.org/rust-lang-nursery/packed_simd/

For example, for x86_64: https://travis-ci.org/rust-lang-nursery/packed_simd/jobs/407633458

@gnzlbg
Copy link
Contributor Author

gnzlbg commented Jul 25, 2018

Oh crap, it seems that the error line is too long or something, and the error is not fully shown, not even in the logs... let me reproduce it and upload it to a gist.

@kali
Copy link

kali commented Jul 25, 2018

For what it's worth, i'm trying to build on my side, and struggling with the incredibly long line that is send to the linker (~2500 args or so)

@gnzlbg
Copy link
Contributor Author

gnzlbg commented Jul 25, 2018

So to reproduce it:

# Get Rust target:
rustup target add x86_64-apple-ios
# Build cargo runner:
export RUSTFLAGS='-C link-args=-mios-simulator-version-min=7.0'
rustc ./ci/deploy_and_run_on_ios_simulator.rs -o ios_cargo_runner --verbose
export CARGO_TARGET_X86_64_APPLE_IOS_RUNNER=$(pwd)/ios_cargo_runner
# Build library:
cargo build --target=x86_64-apple-ios
# Build and run tests:
cargo test --target=x86_64-apple-ios

Here the output, yes, the linker line is really long: https://gist.github.com/gnzlbg/4ff458a32ebd56e4d8930aaf766178b4

@gnzlbg
Copy link
Contributor Author

gnzlbg commented Aug 12, 2018

It appears that the tests are now compiling properly, but they don't produce any output anymore with xcode9.4 - libc and mach are experiencing the same issues. rust-lang/libc#1054

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

No branches or pull requests

2 participants