-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
The missing lib #2710
The missing lib #2710
Conversation
r? @wycats (rust_highfive has picked a reviewer for you, use r? to override) |
e2ce136
to
65b9e10
Compare
@@ -109,6 +109,10 @@ fn build_work<'a, 'cfg>(cx: &mut Context<'a, 'cfg>, unit: &Unit<'a>) | |||
.env("PROFILE", if cx.build_config.release {"release"} else {"debug"}) | |||
.env("HOST", &cx.config.rustc_info().host); | |||
|
|||
if unit.pkg.manifest().links().is_some(){ | |||
p.env("CARGO_LIB", unit.pkg.manifest().links().as_ref().unwrap()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be more naturally written with:
if let Some(links) = unit.pkg.manifest().links() {
p.env("...", links);
}
Thanks @sbeckeriv! The only question I'd have is the name of this env var. |
65b9e10
to
dbc623a
Compare
Thanks! I am still learning to use things like if let! I also updated the name. |
dbc623a
to
388028e
Compare
Dearest Reviewer, This pull request allows the value of project.links to be passed into the build script via an environment variable. This closes rust-lang#1220 . I have added a test that makes sure that the environment variable is set. Also note I am using CARGO_LIB not LIB because it appears to be used for windows in appveyor. I think CARGO_LIB fits better. I have also updated the documentation to reflect the new variable. Thanks! Becker [Updated] Github comments moved to CARGO_MANIFEST_LINKS Fix if statement
The missing lib Dearest Reviewer, This pull request allows the value of project.links to be passed into the build script via an environment variable. This closes #1220 . I have added a test that makes sure that the environment variable is set. Also note I am using CARGO_LIB not LIB because it appears to be used for windows in appveyor. I think CARGO_LIB fits better. I have also updated the documentation to reflect the new variable. Thanks! Becker
☀️ Test successful - cargo-cross-linux, 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 |
Dearest Reviewer,
This pull request allows the value of project.links to be passed into
the build script via an environment variable. This closes #1220 . I have
added a test that makes sure that the environment variable is set. Also
note I am using CARGO_LIB not LIB because it appears to be used for
windows in appveyor. I think CARGO_LIB fits better.
I have also updated the documentation to reflect the new variable.
Thanks!
Becker