Leverage Cargo's workspace inheritance feature
This commit is an attempt to reduce the complexity of the Cargo
manifests in this repository with Cargo's workspace-inheritance feature
becoming stable in Rust 1.64.0. This feature allows specifying fields in
the root workspace Cargo.toml which are then reused throughout the
workspace. For example this PR shares definitions such as:
- All of the Wasmtime-family of crates now use
version.workspace = trueto have a single location which defines the version number. - All crates use
edition.workspace = trueto have one default edition for the entire workspace. - Common dependencies are listed in
[workspace.dependencies]to avoid typing the same version number in a lot of different places (e.g. thewasmparser = "0.89.0"is now in just one spot.
Currently the workspace-inheritance feature doesn't allow having two different versions to inherit, so all of the Cranelift-family of crates still manually specify their version. The inter-crate dependencies, however, are shared amongst the root workspace.
This feature can be seen as a method of "preprocessing" of sorts for Cargo manifests. This will help us develop Wasmtime but shouldn't have any actual impact on the published artifacts -- everything's dependency lists are still the same.
It's worth pointing out that Rust 1.64.0 is not out yet and will be released next week (I think) so this can't merge earlier than that. I've attempted to hack around that on CI by installing beta for all the builders (we'll see how that goes).
Otherwise though I wanted to go ahead and open this up to get others' thoughts on it to see if others are ok with it or feel like this isn't a great change for Wasmtime.
Does publish.rs need to change?
This looks helpful! I'm in favor of merging it eventually. I'd be inclined to wait for some time after the 1.64 release though: at least a week, maybe a month? For something that's only nice-to-have, I think it's worth giving people who are working in git some slack on when to upgrade their toolchain.
If this affected people who are depending on any of these crates through crates.io then I'd wait longer. But if cargo publish rewrites all of this away during the publish process, then that clearly doesn't matter.
@abrown it will yeah, I recalled I should do that right before pushing and then forgot to note it again, thanks for the reminder!
@jameysharp our current policy is that Wasmtime can use up to the latest stable on main, and AFAIK we've never historically delayed landing something due to Rust just recently being released. I would personally like to land this sooner rather than later as it bitrots really quickly.
Subscribe to Label Action
cc @cfallin, @fitzgen, @peterhuene
Thus the following users have been cc'd because of the following labels:
- cfallin: isle
- fitzgen: isle
- peterhuene: wasmtime:c-api
To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file.
Ok I think this should be good for a review now with 1.64.0 released.