forked from rust-lang/cargo
-
Notifications
You must be signed in to change notification settings - Fork 0
Support packaging workspaces
Tor Hovland edited this page May 10, 2024
·
14 revisions
cargo package --workspace
and cargo publish --workspace
won't do what you expect when run on a fresh workspace that hasn't been published before. For any inter-workspace dependencies, Cargo expects to be able to pull down the dependent crate from the registry, ignoring any path dependency. See https://github.com/rust-lang/cargo/issues/10948.
@jneem and @torhovland are trying to fix this issue. It is part of a bigger issue: https://github.com/rust-lang/cargo/issues/1169. If all goes well, we'll proceed with other tasks there.
Our work is in this branch: https://github.com/tweag/cargo/tree/package-workspace.
cargo test package_workspace
Change the packaging procedure to something like this:
- Determine all intra-workspace path dependencies.
- Package each crate using the existing code (without trying to compile/build it).
- Unpack all packaged crates in a temporary directory, giving each one a random dir name.
- Go through all workspace dependencies from step 1 and fix them up in each crate.
- See if this builds.