-
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 rustc --workspace/--exclude #8651
Comments
You are correct, I would suggest looking at |
Oh cool, so that's available on stable as well? Or does the tracking issue mean it's not yet on stable rust? |
It is not stable, it requires |
So I'm part way through implementing this and I've got this as compiler output:
Is there a way to get the args to appear after
I also tried |
Thinking about it some more, I can see that might be awkward for your use case since you can't pass in arguments via the environment variable, so you would need a dedicated executable for that. I added a note to the tracking issue about that. |
I'm going to close, as I think this seems to be mostly addressed by |
So I'm working on tarpaulin, and I'm trying to solve an issue where linker flags of dependencies can conflict with the linker flags I need to set for code coverage, namely
-C link-dead-code
(conflict issue rust-lang/rust#64685). It should also keep the target directory smaller by not having dead code for all the dependencies included and prevent rebuilds when working with tarpaulin making things faster. So that's the motivation.Now my idea to solve this is using
cargo rustc
to just pass the flags to the crate only. However if the user is using workspaces and has multiple packages in their project all the packages needlink-dead-code
applied not just the one under test. But I get the feeling from the docs that this isn't howcargo rustc
works?Providing
cargo rustc
works as I've grokked it, I was thinking that making the flags compatible with cargo build/test/etc and allowing it to operate on a whole workspace would be a solution.Also, I'll need this to work with
cargo test --bins/--examples/--doc/--lib/--benches/--tests
with the compiled artefacts and anything in the project workspace linked with dead code. But that's just a side note in case I'm wrong and there's a better solution for doing this either withcargo rustc
or a different cargo commandThe text was updated successfully, but these errors were encountered: