-
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
cargo check,build,rustc --all-targets #4157
Conversation
`cargo check` does not check all targets by default, and to check all, you need to call it `cargo check --tests --examples --bins --benches`. `cargo check --all-targets` is a shortcut. `--all-targets` is also added to `build` and to `rustc` command. For consitency `--all-targets` added to other commands like `test` although "all targets" is default behavior.
(rust_highfive has picked a reviewer for you, use r? to override) |
adda1a6
to
42346b9
Compare
For However, just adding a flag as in this PR seems fine to me as well, because the ability to build everything is very useful for development. (But for IntelliJ in particular, we can default our build command to To sum up: adding flag is fine with me (hope that's the last flag in this area), but what about changing the defaults instead? |
I think |
@malbarbo that's good point, however, these things are already called "targets":
Any suggestions of a better name? |
This is awesome! Now that you're on this, maybe it's time to update |
@matklad I'd actually argue that we don't want this on by default. Especially for I agree with @malbarbo though that the usage of "target" here can be confusing when mixed with cross-compilation flags. The only other thing I can think of, however, is |
@alexcrichton sounds reasonable! Not sure how to deal with ambiguity about targets: it's a fundamental problem in Cargo's terminology, that crate is called target :(
I am not sure that adding |
Recently I encountered the same problem with how to call those crate 'targets'. I assume using "crate type" isn't good, since it's mostly used for output type like |
I personally think we should stick with |
Another option is to rename it to |
That also seems plausible to me, I'm fine either way |
☔ The latest upstream changes (presumably #4248) made this pull request unmergeable. Please resolve the merge conflicts. |
My two cents: in most other compiler/build-systems "build target" almost always means the target platform. Here, it's more of a "target package" or "target crate". |
@behnam yeah, I think what Cargo calls a "target" is usually known as an "artifact". But we probably can't replace existing Cargo terminology, especially for this single issue, which just exemplifies the general problem. 👍 to sticking with |
Yeah, At some point, I was thinking that |
@stepancheg would you be willing to rebase this to land? |
`cargo check` does not check all targets by default, and to check all, you need to call it `cargo check --tests --examples --bins --benches`. Here, we implement `--all-targets` For `check`, `build`, and `rustc`. For consitency, `--all-targets` is also added to other commands like `test` although "all targets" is the default behavior. This is a rebase of <rust-lang#4157>
[check|build|rustc] Add --all-targets option `cargo check` does not check all targets by default, and to check all, you need to call it `cargo check --tests --examples --bins --benches`. Here, we implement `--all-targets` For `check`, `build`, and `rustc`. For consitency, `--all-targets` is also added to other commands like `test` although "all targets" is the default behavior. This is a rebase of <#4157>
Closing in favor of #4400 |
cargo check
does not check all targets by default, and to checkall, you need to call it
cargo check --tests --examples --bins --benches
.cargo check --all-targets
is a shortcut.--all-targets
is added tocheck
,build
and torustc
commands.For consitency
--all-targets
added to other commands liketest
although "all targets" is default behavior.