-
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" or similar to run all phases prior to trans #1313
Comments
👍 This would be super great. |
I compile mostly to check program correctness. I only run the tests when I am about to push my changes. Now, my stuff is toy programs, but if it ever got to the point that I wrote a larger example that took longer to compile this would be great. |
cc #595, this may just be |
@alexcrichton |
|
It's So it's not quite the same thing. :P |
I've taken a pass at creating a |
Would an integrated |
$ cargo rustc -- -Z no-trans (cargo-check has the same problem) In my Cargo.toml I have: [lib] I'd like them both to be compiled with -Zno-trans (remove the restriction of a single target). Reason: I do not want to manually type different commands to compile everything with -Zno-trans; it's just too much work. In vim I'd just like to ":mak" - which works fine until I add -Zno-trans :-( Thanks! |
This now exists! It should also be quite easy to install via |
Why does the user have to install it separately? It's neither easily discoverable nor friendly to newbies. |
@Valloric I share the opinion. Even when incremental compilation lands llvm will probably always take a big chunk of compilation time, so I see no reason not to incorporate this feature in cargo itself. |
@arthurprs Exactly! This is a trivial command to add and cargo should have it by default so that it shows up in It would lead to a massive quality-of-life improvement for everyday Rust development. It's such an easy, low-cost win that I can't fathom why the core devs aren't falling over themselves to implement it. |
@Valloric I've opened #2187 on the discovery aspect of subcommands, but I agree that there's a general sentiment that a subcommand such as this should be in Unfortunately there's no stabilization route for Cargo itself like there is for Rust, so all new additions are instantly stable. This means that we need to be extra careful before adding new features, and it's intended that subcommands can serve as both a breeding and testing ground for movement into Cargo itself. |
Excellent point. I agree that the subcommands should first exist as separate binaries like Though I'd argue that a built-in
This way there's room for future extension and the subcommand is not bound by the (sub) set of checks currently performed. |
Yeah that was basically our thinking as well. I suspect that it will be one of the first subcommands to be moved into Cargo. Also yes, it won't be documented as using |
Sounds great. Thanks for being open about this! |
To provide some data on the need for a built-in |
Having |
The check command as in https://github.com/rsolomo/cargo-check has severe limitations: you have to build a specific Cargo target each time (rsolomo/cargo-check#4), which is very problematic, especially with regards to the tests targets. I want a Cargo command that checks everything in my crate, this is what you'd expect to be the default behavior. (see also: #2495) |
I agree. I want to add this functionality to https://github.com/RustDT/RustDT, and it's the same story, more convenient if it's bundled with Rust. Also https://github.com/rsolomo/cargo-check has the limitations I mentioned above, which means changes to Cargo itself might be required if those limitations are to be addressed.
Shouldn't there be a stabilization route for Cargo then, if it's causing so much trouble? In terms of making suggestions to improve IDE interaction, I've barely got started doing Cargo feedback, but already the stabilization issue of the Cargo interface is making progress very difficult (the deterministic filenames for test targets is another example of that - a change that otherwise would be trivial). |
@alexcrichton If you agree with that, can a new issue be created so that we track it? (Or re-open this one if you prefer) |
Ok |
Another vote for built-in cargo check support from me - would greatly improve the RLS/IDE experience. A problem we currently have (and I'm not sure if the external check solves this or not) is that if a dependent crate is a macro crate, then |
Closed by #3296 |
Yay! |
During the edit-compile cycle it's often annoying to have to wait for trans to finish before moving on to the next edits. I propose a new subcommand,
cargo check
, that runs only the parsing, expansion, and checking/analysis phases where possible when building the project.The implementation would be just like
cargo build
, but passing--no-trans
torustc
when building the leaves of the crate dependency graph. A--lib
option, like oncargo build
, would only build the project's lib target if it has one.The text was updated successfully, but these errors were encountered: