You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error: all dependencies must have a version specified when publishing.
dependency `iron` does not specify a version
Note: The published dependency will use the version from crates.io,
the `path` specification will be removed from the dependency declaration.
Such a feature is basically entirely incompatible with all of Cargo right now
and, maybe in 2017 it was. but in 2024 this is either (a) a staggering indictment of cargo as a whole or (b) an abject lie. This is trivially provable by running cargo build, or indeed cargo install --git on the same source.
These work and correctly resolve the dependency. Conversely, when publishing, cargo pretends this will not happen if it, uh... downloads the tarball itself and then runs cargo build there?
These are not fundamentally different, but this, once more (cf. #14001), contributes to anything-that-isn't-cargo-build being simply worse than downloading-the-tarball-yourself-and-running-cargo-build, by what appears to be an explicit decision.
Notes
Sure, validate all the paths point into the distribution tarball you're making, this seems reasonable, maybe even useful!
rust-lang/rfcs#3452 is the most recent attempt to design support for "nested" packages. The Cargo team recently reviewed this and it seems unlikely to go forward at this time, see rust-lang/rfcs#3452 (comment)
and, maybe in 2017 it was. but in 2024 this is either (a) a staggering indictment of cargo as a whole or (b) an abject lie. This is trivially provable by running cargo build, or indeed cargo install --git on the same source.
These work and correctly resolve the dependency.
It works locally and with git because those are pulling in concrete versions that are known how to resolve. When using the registry, users don't want to download every version of a package and wait for all of those Cargo.toml files to be parsed just to resolve their dependency tree. We operate off of Summarys of packages that are tracked in an Index. Putting nested packages in Summarys in the Index is one of the big complex problems to be solved, enough so that it makes it questionable whether this feature is worth it.
Problem
cargo publish says
Steps
cargo publish
Possible Solution(s)
Well. Don't? This has previously been #1565 and https://users.rust-lang.org/t/is-it-possible-to-publish-crates-with-path-specified/91497 however the forum bikesheds something unrelated while on the issue Crichton says
and, maybe in 2017 it was. but in 2024 this is either (a) a staggering indictment of cargo as a whole or (b) an abject lie. This is trivially provable by running
cargo build
, or indeedcargo install --git
on the same source.These work and correctly resolve the dependency. Conversely, when publishing, cargo pretends this will not happen if it, uh... downloads the tarball itself and then runs cargo build there?
These are not fundamentally different, but this, once more (cf. #14001), contributes to anything-that-isn't-cargo-build being simply worse than downloading-the-tarball-yourself-and-running-cargo-build, by what appears to be an explicit decision.
Notes
Sure, validate all the paths point into the distribution tarball you're making, this seems reasonable, maybe even useful!
Version
The text was updated successfully, but these errors were encountered: