-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Pass link search path to doctests even if build script gave no links #2225
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
Conversation
|
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
e477025 to
749af1d
Compare
It is entirely possible for a crate to have a build script that is simply
the equivalent to
```rustc
fn main() {
println!("cargo:rustc-link-search=native=/some/path");
}
```
Without actually giving anything to link (for example, because the code
contains `#[link(name="foo")]`. In this case, we aren't actually passing
`-L` through when running doctests, even though they're passed when
compiling the main crate.
Fixes rust-lang#1592
749af1d to
8c65284
Compare
|
Oh, right! I think in this case the (also, can you add a test for this?) |
|
Yes, Diesel passes with this change at least. The build script doesn't have to link it for something to be linked. I'll see what happens if we just drop the conditional and add a test tomorrow. (STAR WARS TIME!!!!!) |
In this case the dylib check isn't actually doing anything useful, as we're just appending search paths. Also adds a test for 8c65284
|
@alexcrichton Seems like removing the dylib check was fine, tests all passed. Added a test for this change as well |
It is entirely possible for a crate to have a build script that is simply
the equivalent to
```rustc
fn main() {
println!("cargo:rustc-link-search=native=/some/path");
}
```
Without actually giving anything to link (for example, because the code
contains `#[link(name="foo")]`. In this case, we aren't actually passing
`-L` through when running doctests, even though they're passed when
compiling the main crate.
Fixes #1592
|
💔 Test failed - cargo-win-gnu-64 |
|
@bors: retry On Saturday, December 19, 2015, bors notifications@github.com wrote:
|
|
⚡ Previous build results for cargo-linux-32, cargo-linux-64, cargo-mac-32, cargo-mac-64, cargo-win-gnu-32, cargo-win-msvc-32, cargo-win-msvc-64 are reusable. Rebuilding only cargo-win-gnu-64... |
|
☀️ Test successful - cargo-linux-32, cargo-linux-64, cargo-mac-32, cargo-mac-64, cargo-win-gnu-32, cargo-win-gnu-64, cargo-win-msvc-32, cargo-win-msvc-64 |
It is entirely possible for a crate to have a build script that is simply
the equivalent to
Without actually giving anything to link (for example, because the code
contains
#[link(name="foo")]. In this case, we aren't actually passing-Lthrough when running doctests, even though they're passed whencompiling the main crate.
Fixes #1592