I'm trying to use Workspace to manage multiple crates in a project. When building production releases, I'm using a build service, that consume the source code of the individual crate.
Because of workspace inherits, the member crate's Cargo.toml file does not have the full contents needed to build. So I'm looking if there is any existing command or 3rd tool already exists to render or normalize the member's Cargo.toml, essentially substitute workspace related references with the actually values.
For example, in project root:
Cargo.toml:
[workspace]
members = [ "crates/foo" ]
[workspace.package]
version = "1.2.3"
In crates/foo/Cargo.toml:
[package]
name = "foo"
version.workspace = true
I'm finding a way to render crates/foo/Cargo.toml to:
cargo package will do this as part of creating the package (foo.crate) file. It sounds like a good idea to make your build service accept .crate files directly.
Apparently cargo package does not support/allow git dependencies because it is aiming for creating package for publishing. So I do need to look at your cargo_toml library!
The limitation is only a crates.io policy. Custom Cargo registries allow git dependencies. Maybe you can trick cargo into thinking it's packaging for another registry. Or maybe you can even make your builder talk the Cargo registry protocol to support publishing to it directly.