-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
--no-dev-deps flag edits real manifest #15
Comments
Perhaps it needs to ban test/bench subcommands and --tests/--all-targets flags when --no-dev-deps is used. (done in #16) Then create an empty crate for testing in the target directory like trybuild is doing. |
Hmm, if doing this, it will not work well except for |
So, for now, I think it should handle the check subcommand specially. (And probably warn when used with other subcommands.) |
16: Ban --no-dev-deps with builds that require dev-dependencies r=taiki-e a=taiki-e cc #15 Co-authored-by: Taiki Endo <[email protected]>
20: Handle ctrl-c r=taiki-e a=taiki-e cc #15 Co-authored-by: Taiki Endo <[email protected]>
Now that cargo-hack can handle ctrl-c properly, I think that some burden caused by this issue has been reduced. |
Workaround for this is using unstable
FWIW: |
We can probably consider using |
With |
BTW, at least when the workspace root is a virtual manifest, resolver = "2" does not seem to properly apply in the workspace, even if all workspace members are 2021 edition. Therefore, in practice, it seems preferable to always specify resolver = "2" (considering the possibility that the project structure may change in the future). |
Using --no-dev-deps flag is recommended to avoid rust-lang/cargo#4866 if
resolver = "2"
doesn't set.However, currently, using --no-dev-deps flag removes dev deps from real manifest while cargo-hack is running and restores it when finished.
If possible, this should be done without editing the manifest.
Workaround
Using unstable
-Z features=dev_dep
(rust-lang/cargo#7916) or-Z avoid-dev-deps
(rust-lang/cargo#5133) instead of--no-dev-deps
.Note:
-Z avoid-dev-deps
works well withcargo check/build/run/install
, but not withcargo publish
.On the other hand,
--no-dev-deps
doesn't work well withcargo install
.The text was updated successfully, but these errors were encountered: