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

Nondeterministic compilation. Sometimes fails, sometimes succeeds. #3440

Closed
mmiecz opened this issue Dec 21, 2016 · 1 comment
Closed

Nondeterministic compilation. Sometimes fails, sometimes succeeds. #3440

mmiecz opened this issue Dec 21, 2016 · 1 comment

Comments

@mmiecz
Copy link

mmiecz commented Dec 21, 2016

I am trying to compile some example program from Cursive on macOS 10.12.1 with
cargo 0.16.0-nightly (ddb5c32 2016-12-16) and I am having some problems.
I am using macos branch from Cursive project, and I've declared this in my Cargo.toml file like this:

[dependencies.cursive]
git = "https://github.com/gyscos/Cursive"
branch = "macos"

When I try to build with cargo build sometimes compilation is successful, and sometimes not. Here is my output:

MacBook-Air-Micha:terminal-tests mhl$ cargo clean
MacBook-Air-Micha:terminal-tests mhl$ cargo build
   Compiling unicode-segmentation v0.1.3
   Compiling cursive v0.3.5 (https://github.com/gyscos/Cursive?branch=macos#451d0522)
   Compiling odds v0.2.25
   Compiling libc v0.2.18
   Compiling unicode-width v0.1.3
   Compiling rustc-serialize v0.3.22
   Compiling ncurses v5.84.0
   Compiling toml v0.2.1
   Compiling terminal-tests v0.1.0 (file:///Users/mhl/Sources/terminal-tests)
error: linking with `cc` failed: exit code: 1
  |
  = note: "cc" "-m64" "-L" "/Users/mhl/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "/Users/mhl/Sources/terminal-tests/target/debug/deps/terminal_tests-d163a702128509ba.0.o" "-o" "/Users/mhl/Sources/terminal-tests/target/debug/deps/terminal_tests-d163a702128509ba" "-Wl,-dead_strip" "-nodefaultlibs" "-L" "/Users/mhl/Sources/terminal-tests/target/debug/deps" "-L" "/Users/mhl/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "/Users/mhl/Sources/terminal-tests/target/debug/deps/libcursive-589ffaec46642e7b.rlib" "/Users/mhl/Sources/terminal-tests/target/debug/deps/libunicode_segmentation-1400e9f38485b222.rlib" "/Users/mhl/Sources/terminal-tests/target/debug/deps/libncurses-64b8ed169553261c.rlib" "/Users/mhl/Sources/terminal-tests/target/debug/deps/libtoml-5130c1b472bb88f9.rlib" "/Users/mhl/Sources/terminal-tests/target/debug/deps/libunicode_width-a8b627b65c290dac.rlib" "/Users/mhl/Sources/terminal-tests/target/debug/deps/liblibc-73c6422e7b19c2f3.rlib" "/Users/mhl/Sources/terminal-tests/target/debug/deps/librustc_serialize-03b62901d97343ea.rlib" "/Users/mhl/Sources/terminal-tests/target/debug/deps/libodds-798c90752ba21e6f.rlib" "/Users/mhl/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd-713ad88203512705.rlib" "/Users/mhl/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libpanic_unwind-8db31eff4f3f5d1c.rlib" "/Users/mhl/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libunwind-9d903f075d9d1ed3.rlib" "/Users/mhl/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librand-15da1025aec585ac.rlib" "/Users/mhl/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcollections-eba7f19f0aae5f37.rlib" "/Users/mhl/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc-0fa051c7d0594505.rlib" "/Users/mhl/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-9dddbb08233542f3.rlib" "/Users/mhl/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liblibc-72ccf8e77ba91924.rlib" "/Users/mhl/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd_unicode-d3fcdc16d2a25b3a.rlib" "/Users/mhl/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcore-407db9a296a50c43.rlib" "/Users/mhl/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcompiler_builtins-dfc954c33c85abed.rlib" "-l" "ncursesw" "-l" "System" "-l" "pthread" "-l" "c" "-l" "m"
  = note: ld: library not found for -lncursesw
clang: error: linker command failed with exit code 1 (use -v to see invocation)


error: aborting due to previous error

error: Could not compile `terminal-tests`.

To learn more, run the command again with --verbose.
MacBook-Air-Micha:terminal-tests mhl$ cargo build
   Compiling ncurses v5.84.0
   Compiling cursive v0.3.5 (https://github.com/gyscos/Cursive?branch=macos#451d0522)
   Compiling terminal-tests v0.1.0 (file:///Users/mhl/Sources/terminal-tests)
    Finished debug [unoptimized + debuginfo] target(s) in 6.41 secs

I can type cargo build couple of times, and cursive v0.3.5 would be recompiled every time, sometimes failing like I've shown before, sometimes being successful.
When completion is reported as successful I am able to run resulting binary without any problems.

@alexcrichton
Copy link
Member

I debugged this a bit and found it was related to the feature set of a crate changing. This I suspect is due to target-specific features being used which in turn makes me think that this is a dupe of #2524. I haven't seen the nondeterministic behavior here before, though, so that's good to know!

For now I'm going to close this in favor of #2524, but I'll give that issue another stab at fixing.

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

2 participants