You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is reopening #1401. Github doesn't give me the option of reopening the same issue, so I'm creating a new one. I reproduced the issue with the latest Cargo nightly. Here's the output of my test command:
$ cargo clean && cargo test --verbose
Compiling bug v0.0.1 (file:///Users/david/src/rust-link-bug)
Running `rustc build.rs --crate-name build_script_build --crate-type bin -C prefer-dynamic -g --out-dir /Users/david/src/rust-link-bug/target/debug/build/bug-7d595e9c49b14df7 --emit=dep-info,link -L dependency=/Users/david/src/rust-link-bug/target/debug -L dependency=/Users/david/src/rust-link-bug/target/debug/deps`
Running `/Users/david/src/rust-link-bug/target/debug/build/bug-7d595e9c49b14df7/build-script-build`
Running `rustc src/lib.rs --crate-name bug --crate-type lib -g -C metadata=7d595e9c49b14df7 -C extra-filename=-7d595e9c49b14df7 --out-dir /Users/david/src/rust-link-bug/target/debug --emit=dep-info,link -L dependency=/Users/david/src/rust-link-bug/target/debug -L dependency=/Users/david/src/rust-link-bug/target/debug/deps -L native=/usr/local/Cellar/libusb/1.0.19/lib -l usb-1.0`
Running `rustc src/lib.rs --crate-name bug --crate-type lib -g --test -C metadata=df6636dbde15889d -C extra-filename=-df6636dbde15889d --out-dir /Users/david/src/rust-link-bug/target/debug --emit=dep-info,link -L dependency=/Users/david/src/rust-link-bug/target/debug -L dependency=/Users/david/src/rust-link-bug/target/debug/deps -L native=/usr/local/Cellar/libusb/1.0.19/lib -l usb-1.0`
Running `/Users/david/src/rust-link-bug/target/debug/bug-df6636dbde15889d`
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
Doc-tests bug
Running `rustdoc --test /Users/david/src/rust-link-bug/src/lib.rs --crate-name bug -L /Users/david/src/rust-link-bug/target/debug -L /Users/david/src/rust-link-bug/target/debug/deps --extern bug=/Users/david/src/rust-link-bug/target/debug/libbug-7d595e9c49b14df7.rlib`
running 1 test
test hello_0 ... FAILED
failures:
---- hello_0 stdout ----
error: linking with `cc` failed: exit code: 1
note: "cc" "-m64" "-L" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib" "-o" "/var/folders/7f/z9y9c0gj52gb38jlrsr2pzkc0000gn/T/rustdoctest.e2lupTv465I8/rust_out" "/var/folders/7f/z9y9c0gj52gb38jlrsr2pzkc0000gn/T/rustdoctest.e2lupTv465I8/rust_out.o" "-Wl,-force_load,/usr/local/lib/rustlib/x86_64-apple-darwin/lib/libmorestack.a" "-Wl,-dead_strip" "-nodefaultlibs" "/Users/david/src/rust-link-bug/target/debug/libbug-7d595e9c49b14df7.rlib" "-L" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib" "-lstd-4e7c5e5c" "-L" "/Users/david/src/rust-link-bug/target/debug" "-L" "/Users/david/src/rust-link-bug/target/debug/deps" "-L" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib" "-L" "/Users/david/src/rust-link-bug/.rust/lib/x86_64-apple-darwin" "-L" "/Users/david/src/rust-link-bug/lib/x86_64-apple-darwin" "-lusb-1.0" "-lSystem" "-lpthread" "-lc" "-lm" "-lcompiler-rt"
note: ld: warning: directory not found for option '-L/Users/david/src/rust-link-bug/.rust/lib/x86_64-apple-darwin'
ld: warning: directory not found for option '-L/Users/david/src/rust-link-bug/lib/x86_64-apple-darwin'
ld: library not found for -lusb-1.0
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: aborting due to previous error
thread 'hello_0' panicked at 'Box<Any>', /Users/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-mac/build/src/libsyntax/diagnostic.rs:152
failures:
hello_0
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured
thread '<unnamed>' panicked at 'Some tests failed', /Users/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-mac/build/src/libtest/lib.rs:261
thread '<main>' panicked at 'child thread None panicked', /Users/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-mac/build/src/libstd/thread/mod.rs:775
I notice that the two rustc commands both receive the link flags (-L native=/usr/local/Cellar/libusb/1.0.19/lib -l usb-1.0), but the rustdoc command does not. Running the rustdoc command manually with the -L flag works:
$ rustdoc --test /Users/david/src/rust-link-bug/src/lib.rs --crate-name bug -L /Users/david/src/rust-link-bug/target/debug -L /Users/david/src/rust-link-bug/target/debug/deps --extern bug=/Users/david/src/rust-link-bug/target/debug/libbug-7d595e9c49b14df7.rlib -L native=/usr/local/Cellar/libusb/1.0.19/lib
running 1 test
test hello_0 ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
I also tried with Cargo built from the latest master branch, just to make sure I had the fixes from #1441.
The text was updated successfully, but these errors were encountered:
This is reopening #1401. Github doesn't give me the option of reopening the same issue, so I'm creating a new one. I reproduced the issue with the latest Cargo nightly. Here's the output of my test command:
I notice that the two
rustc
commands both receive the link flags (-L native=/usr/local/Cellar/libusb/1.0.19/lib -l usb-1.0
), but therustdoc
command does not. Running therustdoc
command manually with the-L
flag works:I also tried with Cargo built from the latest
master
branch, just to make sure I had the fixes from #1441.The text was updated successfully, but these errors were encountered: