-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Require rlibs for dependent crates when linking static executables #44279
Conversation
r? @eddyb (rust_highfive has picked a reviewer for you, use r? to override) |
@bors: r+ |
📌 Commit 4950756 has been approved by |
@bors: rollup |
Require rlibs for dependent crates when linking static executables This handles the case for `CrateTypeExecutable` and `+crt_static`. I reworked the match block to avoid duplicating the `attempt_static` and error checking code again (this case would have been a copy of the `CrateTypeCdylib`/`CrateTypeStaticlib` case). On `linux-musl` targets where `std` was built with `crt_static = false` in `config.toml`, this change brings the test suite from entirely failing to mostly passing. This change should not affect behavior for other crate types, or for targets which do not respect `+crt_static`.
☔ The latest upstream changes (presumably #44142) made this pull request unmergeable. Please resolve the merge conflicts. |
4950756
to
6b4bdbd
Compare
@bors: r=alexcrichton |
📌 Commit 6b4bdbd has been approved by |
@bors: rollup |
Require rlibs for dependent crates when linking static executables This handles the case for `CrateTypeExecutable` and `+crt_static`. I reworked the match block to avoid duplicating the `attempt_static` and error checking code again (this case would have been a copy of the `CrateTypeCdylib`/`CrateTypeStaticlib` case). On `linux-musl` targets where `std` was built with `crt_static = false` in `config.toml`, this change brings the test suite from entirely failing to mostly passing. This change should not affect behavior for other crate types, or for targets which do not respect `+crt_static`.
It looks like the compile failure is happening in the intended way, but the error message is different because it's being caught earlier. Should I just change the expected error message in the test? Edit: hmm, but the error path and therefore the message will be different based on whether the executable was static. Do I need another special case here? should we make the error messages match? |
If possible yeah let's just get the errors to emit through a common path to ensure that they're the same |
6b4bdbd
to
841b4a2
Compare
tidy error for you @smaeul! |
How do I fix that without making the error message shorter? |
@smaeul You could remove the spaces around
|
This handles the case for `CrateTypeExecutable` and `+crt_static`. I reworked the match block to avoid duplicating the `attempt_static` and error checking code again (this case would have been a copy of the `CrateTypeCdylib`/`CrateTypeStaticlib` case). On `linux-musl` targets where `std` was built with `crt_static = false` in `config.toml`, this change brings the test suite from entirely failing to mostly passing. This change should not affect behavior for other crate types, or for targets which do not respect `+crt_static`.
841b4a2
to
e071e74
Compare
Test failure:
|
e071e74
to
314c2b1
Compare
This looks like it's ready for rereview @alexcrichton ! |
@bors: r+ |
📌 Commit 314c2b1 has been approved by |
Require rlibs for dependent crates when linking static executables This handles the case for `CrateTypeExecutable` and `+crt_static`. I reworked the match block to avoid duplicating the `attempt_static` and error checking code again (this case would have been a copy of the `CrateTypeCdylib`/`CrateTypeStaticlib` case). On `linux-musl` targets where `std` was built with `crt_static = false` in `config.toml`, this change brings the test suite from entirely failing to mostly passing. This change should not affect behavior for other crate types, or for targets which do not respect `+crt_static`.
☀️ Test successful - status-appveyor, status-travis |
This handles the case for
CrateTypeExecutable
and+crt_static
. I reworked the match block to avoid duplicating theattempt_static
and error checking code again (this case would have been a copy of theCrateTypeCdylib
/CrateTypeStaticlib
case).On
linux-musl
targets wherestd
was built withcrt_static = false
inconfig.toml
, this change brings the test suite from entirely failing to mostly passing.This change should not affect behavior for other crate types, or for targets which do not respect
+crt_static
.