dev-dependencies are annoying and almost useless in publish #46
Description
The inspiring case is that Cargo itself just added custom proc-macro ( rust-lang/cargo#6900 ) to remove testing boilerplate. Now we can't publish to Crates.io, as path dependencies are not allowed, without publishing the small testing library. But noone using Cargo as a library needs to know that we use this dep for testing. We have checked carefully and Cargo only looks at dev-dependencies
for the main project and completely ignores them for all dependencies. @alexcrichton, suggested that we comment that part of our Cargo.toml out before we publish, it works for his other projects. We are discussing ways to generalize that workflow.
Possible next steps:
- leave things as they are. Each project finds its own workaround as needed. Or.
- Cargo just removes
dev-dependencies
part of the Cargo.toml before giving it to Crates.io as part of publish for everyone. (This is not great as Crater uses that Cargo.toml, so it would be nice if testing worked from that file.) Or. - Cargo adds a flag to strip
dev-dependencies
part of the Cargo.toml as part of publish only when asked to. (not great as it is an additional CLI flag to doc and maintain) Or. - Crates.io and Cargo decide that you can publish with arbitrarily bad data in the
dev-dependencies
part of the Cargo.toml. Or. - Some compromise between them.
We wanted to get the Crates.io Teams thoughts about Cargo not telling you things that we historically did or about changing your policy.
Specifically, do you use dev-dependencies
for anything? If so would you mind not using them?
Are you open to allowing path and git dependencies in the dev-dependencies
for crates on the site?
This was brought up at #43
Then followed up Cargo team meeting notes:
2019-06-26
- follow up from crates.io team on not checking dev deps
- Crates.io display them in the sidebar and use them for as it was asked for Display build-dependencies on crate page crates.io#1641
- Crates.io use them for reverse dependency search as well
- build-only deps would show no users
- useful for stats in general
- can we allow path = "subdir" but disallow path="../other-dir”?
- TLDR: It sounds like there's some concerns but possible interest. Let's follow up with an issue on the team repo.
- action: Jacob to make an issue on the shared repo dev-dependencies are annoying and almost useless in publish #46
Both teams want to make this easier but want to think carefully about how to proceed. Let's have a discussion.