-
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
Build subcommand or option that builds all targets (including tests) #2495
Comments
Could you expand on the motivation for this? I can't really think of a use case for "build everything" unless you want to actually use everything right afterwards... |
Well:
These scenarios happen to me very often in Java projects I work with. And with Rust I'm also now using |
Hm it sounds like |
I mentioned above that it doesn't build the bin targets, but upon trying it again, it seems it does, so I guess I was wrong in my understanding. So yeah, it seems like I'm happy with this, as long as gong forward |
After some user reports of |
Oh interesting! I thought binaries were at least compiled with |
They are not marked with |
I just realized (in case it wasn't clear), it's not just that the |
Hm so to confirm, the only situation I believe where executables are not compiled are when integration ( This choice was done because if integration tests are missing the executables are still compiled with Does that make sense? Can you confirm that the bad behavior you're seeing only happens in projects with no integration tests? |
Yes, that's correct. Apparently even a blank .rs file in |
Ah ok, just wanted to make sure! So given that are the executables themselves that different with and without |
I don't quite understand. What is I can't seem to reproduce the situation were the errors are not even checked (if the bin file has errors), so maybe I misunderstood that, or it was fixed in the meanwhile, or something. But the original problem that the bin executable is not created is still there (with a bin file without source errors). Let me try to summarize the cases. So, on a project with a
|
Ah by I think I may be a bit lost here at this point, can you restate the original problem perhaps again with all the new information? |
Sure, let's look at the recap of what currently happens: For source without errors and a
|
I believe this was fixed by #4400. Please reopen if I'm incorrect! |
I'm not convinced this is working as intended (stable Rust 1.21; proprietary code, hence the redacting):
|
Ok, reopening! Just to check, you did mean Rust 1.12, correct? Not Rust 1.21 by chance? |
Sorry - yes. Rust 1.21. I've edited in the correct version. |
Whew! I was worried for a second there :) |
I believe @BenjaminGill-Metaswitch's issue is fixed by #4592. |
|
Currently
cargo build
will build the lib target and the bin targets, but none of the test targets.cargo test --no-run
will build the tests targets (and the lib target), but not the bin targets.Ideally, there should be a cargo build command or option that would build all the crate's targets. Not just for convenience and (possibly) better performance, but also to be be able to integrate future
cargo build
options and have them apply to the test targets builds too. For example, using "cargo check" or something similar. (#1313)The text was updated successfully, but these errors were encountered: