-
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
refactor: compiler invocations #12211
refactor: compiler invocations #12211
Conversation
r? @ehuss (rustbot has picked a reviewer for you, use r? to override) |
Apparently it was a bit confusing where `rustflags` is from when reading this piece of code.
d21e8a8
to
5256dec
Compare
5256dec
to
fb92ee5
Compare
@@ -100,7 100,7 @@ fn profile_selection_build() { | |||
[FINISHED] dev [unoptimized debuginfo] [..] | |||
" | |||
) | |||
.with_stdout_does_not_contain("[..] -C debuginfo=0[..]") | |||
.with_stderr_does_not_contain("[..] -C debuginfo=0[..]") |
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.
If these tests were testing the wrong thing, should that be its own commit?
This is also why I don't like testing for something not existing...
@@ -1334,13 1334,13 @@ fn cargo_default_env_metadata_env_var() { | |||
[COMPILING] bar v0.0.1 ([CWD]/bar) | |||
[RUNNING] `rustc --crate-name bar bar/src/lib.rs [..]--crate-type dylib \ | |||
--emit=[..]link \ | |||
-C prefer-dynamic[..]-C debuginfo=2 \ | |||
-C prefer-dynamic[..]-C debuginfo=2 [..]\ |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
It was unnecessary to pass `spilt-debuginfo` if there is no debuginfo. Tests are touched here only for matching rustflags invocation stderr in the original test suite.
This is for linker arguments from build scripts, so should live there.
Make it clear by separating static and dynamic rustflags.
Make it clear by separating static and dynamic rustdocflags.
This was an overlook in rust-lang#12205
fb92ee5
to
d4067e4
Compare
@bors r |
☀️ Test successful - checks-actions |
Update cargo 14 commits in f7b95e31642e09c2b6eabb18ed75007dda6677a0..b0fa79679e717cd077b7fc0fa4166f47107f1ba9 2023-05-30 19:25:02 0000 to 2023-06-03 14:19:48 0000 - Emit error when users try to use a toolchain via the `add` or `install` command (rust-lang/cargo#12226) - Support "default" option for `build.jobs` (rust-lang/cargo#12222) - Fix typo in changelog (rust-lang/cargo#12227) - chore: Sort `-Z` flags match statement (rust-lang/cargo#12223) - Update curl-sys (rust-lang/cargo#12218) - Bump to 0.73.0; update changelog (rust-lang/cargo#12219) - refactor: housekeeping for 1.70.0 (rust-lang/cargo#12217) - nit: fix typo in changelog for 1.70 (rust-lang/cargo#12215) - Remove a noop `.clone` (rust-lang/cargo#12213) - refactor: compiler invocations (rust-lang/cargo#12211) - cargo clean: use `remove_dir_all` (rust-lang/cargo#11442) - Add a small note about indexes ignoring SemVer build metadata. (rust-lang/cargo#12206) - Revert "chore: detect the channel a PR wants to merge into" (rust-lang/cargo#12204) - Don't distinguish `Debuginfo::None` and `Debuginfo::Explicit(None)` (rust-lang/cargo#12205) r? `@ghost`
Update cargo 14 commits in f7b95e31642e09c2b6eabb18ed75007dda6677a0..b0fa79679e717cd077b7fc0fa4166f47107f1ba9 2023-05-30 19:25:02 0000 to 2023-06-03 14:19:48 0000 - Emit error when users try to use a toolchain via the `add` or `install` command (rust-lang/cargo#12226) - Support "default" option for `build.jobs` (rust-lang/cargo#12222) - Fix typo in changelog (rust-lang/cargo#12227) - chore: Sort `-Z` flags match statement (rust-lang/cargo#12223) - Update curl-sys (rust-lang/cargo#12218) - Bump to 0.73.0; update changelog (rust-lang/cargo#12219) - refactor: housekeeping for 1.70.0 (rust-lang/cargo#12217) - nit: fix typo in changelog for 1.70 (rust-lang/cargo#12215) - Remove a noop `.clone` (rust-lang/cargo#12213) - refactor: compiler invocations (rust-lang/cargo#12211) - cargo clean: use `remove_dir_all` (rust-lang/cargo#11442) - Add a small note about indexes ignoring SemVer build metadata. (rust-lang/cargo#12206) - Revert "chore: detect the channel a PR wants to merge into" (rust-lang/cargo#12204) - Don't distinguish `Debuginfo::None` and `Debuginfo::Explicit(None)` (rust-lang/cargo#12205) r? `@ghost`
What does this PR try to resolve?
Found some places needing minor refactors during reviewing #12205
How should we test and review this PR?
Commit by commit. Each has its own explanation.
The first four shouldn't be controversial. However, we need people to scrutinize the last two. All static rustflags additions were moved into a single functions. This shouldn't have any behavior change.
Additional information
After this, I'll do a follow-up to extract flags building process. It is expected to make it clearer and safer for building static and dynamic flags.