Leverage Cargo's workspace inheritance feature (#4905)

* 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 =
  true` to have a single location which defines the version number.
* All crates use `edition.workspace = true` to 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. the
  `wasmparser = "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.

* Fix wasi-crypto tests
This commit is contained in:
Alex Crichton
2022-09-26 11:30:01 -05:00
committed by GitHub
parent af226d37c2
commit 7b311004b5
63 changed files with 520 additions and 446 deletions

View File

@@ -7,7 +7,7 @@ license = "Apache-2.0 WITH LLVM-exception"
documentation = "https://github.com/bytecodealliance/wasmtime/blob/main/cranelift/docs/index.md"
repository = "https://github.com/bytecodealliance/wasmtime"
publish = false
edition = "2021"
edition.workspace = true
[[bin]]
name = "clif-util"
@@ -20,32 +20,32 @@ harness = false
[dependencies]
cfg-if = "1.0"
cranelift-codegen = { path = "codegen", version = "0.89.0" }
cranelift-entity = { path = "entity", version = "0.89.0" }
cranelift-interpreter = { path = "interpreter", version = "0.89.0" }
cranelift-reader = { path = "reader", version = "0.89.0" }
cranelift-frontend = { path = "frontend", version = "0.89.0" }
cranelift-wasm = { path = "wasm", version = "0.89.0", optional = true }
cranelift-native = { path = "native", version = "0.89.0" }
cranelift-filetests = { path = "filetests", version = "0.73.0" }
cranelift-module = { path = "module", version = "0.89.0" }
cranelift-object = { path = "object", version = "0.89.0" }
cranelift-jit = { path = "jit", version = "0.89.0" }
cranelift-preopt = { path = "preopt", version = "0.89.0" }
cranelift = { path = "umbrella", version = "0.89.0" }
cranelift-codegen = { workspace = true }
cranelift-entity = { workspace = true }
cranelift-interpreter = { workspace = true }
cranelift-reader = { workspace = true }
cranelift-frontend = { workspace = true }
cranelift-wasm = { workspace = true, optional = true }
cranelift-native = { workspace = true }
cranelift-filetests = { workspace = true }
cranelift-module = { workspace = true }
cranelift-object = { workspace = true }
cranelift-jit = { workspace = true }
cranelift-preopt = { workspace = true }
cranelift = { workspace = true }
filecheck = "0.5.0"
log = "0.4.8"
log = { workspace = true }
termcolor = "1.1.2"
capstone = { version = "0.9.0", optional = true }
wat = { version = "1.0.47", optional = true }
target-lexicon = { version = "0.12", features = ["std"] }
wat = { workspace = true, optional = true }
target-lexicon = { workspace = true, features = ["std"] }
pretty_env_logger = "0.4.0"
rayon = { version = "1", optional = true }
indicatif = "0.13.0"
thiserror = "1.0.15"
walkdir = "2.2"
anyhow = "1.0.32"
clap = { version = "3.2.0", features = ["derive"] }
anyhow = { workspace = true }
clap = { workspace = true }
[features]
default = ["disas", "wasm", "cranelift-codegen/all-arch", "cranelift-codegen/trace-log", "souper-harvest"]

View File

@@ -9,7 +9,7 @@ repository = "https://github.com/bytecodealliance/wasmtime"
categories = ["no-std"]
readme = "README.md"
keywords = ["btree", "forest", "set", "map"]
edition = "2021"
edition.workspace = true
[dependencies]
cranelift-entity = { path = "../entity", version = "0.89.0", default-features = false }

View File

@@ -10,21 +10,21 @@ categories = ["no-std"]
readme = "README.md"
keywords = ["compile", "compiler", "jit"]
build = "build.rs"
edition = "2021"
edition.workspace = true
[dependencies]
arrayvec = "0.7"
bumpalo = "3"
cranelift-codegen-shared = { path = "./shared", version = "0.89.0" }
cranelift-entity = { path = "../entity", version = "0.89.0" }
cranelift-bforest = { path = "../bforest", version = "0.89.0" }
hashbrown = { version = "0.12", optional = true }
target-lexicon = "0.12"
log = { version = "0.4.6", default-features = false }
cranelift-entity = { workspace = true }
cranelift-bforest = { workspace = true }
hashbrown = { workspace = true, optional = true }
target-lexicon = { workspace = true }
log = { workspace = true }
serde = { version = "1.0.94", features = ["derive"], optional = true }
bincode = { version = "1.2.1", optional = true }
gimli = { version = "0.26.0", default-features = false, features = ["write"], optional = true }
smallvec = { version = "1.6.1", features = ["union"] }
gimli = { workspace = true, features = ["write"], optional = true }
smallvec = { workspace = true }
regalloc2 = { version = "0.4.1", features = ["checker"] }
souper-ir = { version = "2.1.0", optional = true }
sha2 = { version = "0.9.0", optional = true }

View File

@@ -6,7 +6,7 @@ description = "Metaprogram for cranelift-codegen code generator library"
license = "Apache-2.0 WITH LLVM-exception"
repository = "https://github.com/bytecodealliance/wasmtime"
readme = "README.md"
edition = "2021"
edition.workspace = true
# FIXME(rust-lang/cargo#9300): uncomment once that lands
# [package.metadata.docs.rs]

View File

@@ -6,7 +6,7 @@ description = "For code shared between cranelift-codegen-meta and cranelift-code
license = "Apache-2.0 WITH LLVM-exception"
repository = "https://github.com/bytecodealliance/wasmtime"
readme = "README.md"
edition = "2021"
edition.workspace = true
[dependencies]
# Since this is a shared dependency of several packages, please strive to keep this dependency-free

View File

@@ -9,7 +9,7 @@ repository = "https://github.com/bytecodealliance/wasmtime"
categories = ["no-std"]
readme = "README.md"
keywords = ["entity", "set", "map"]
edition = "2021"
edition.workspace = true
[dependencies]
serde = { version = "1.0.94", features = ["derive"], optional = true }

View File

@@ -1,29 +1,29 @@
[package]
name = "cranelift-filetests"
authors = ["The Cranelift Project Developers"]
version = "0.73.0"
version = "0.0.0"
description = "Test driver and implementations of the filetest commands"
license = "Apache-2.0 WITH LLVM-exception"
documentation = "https://docs.rs/cranelift-filetests"
repository = "https://github.com/bytecodealliance/wasmtime"
publish = false
edition = "2021"
edition.workspace = true
[dependencies]
cranelift-codegen = { path = "../codegen", version = "0.89.0", features = ["testing_hooks"] }
cranelift-frontend = { path = "../frontend", version = "0.89.0" }
cranelift-interpreter = { path = "../interpreter", version = "0.89.0" }
cranelift-native = { path = "../native", version = "0.89.0" }
cranelift-reader = { path = "../reader", version = "0.89.0" }
cranelift-preopt = { path = "../preopt", version = "0.89.0" }
cranelift-jit = { path = "../jit", version = "0.89.0" }
cranelift-module = { path = "../module", version = "0.89.0" }
cranelift-codegen = { workspace = true, features = ["testing_hooks"] }
cranelift-frontend = { workspace = true }
cranelift-interpreter = { workspace = true }
cranelift-native = { workspace = true }
cranelift-reader = { workspace = true }
cranelift-preopt = { workspace = true }
cranelift-jit = { workspace = true }
cranelift-module = { workspace = true }
file-per-thread-logger = "0.1.2"
filecheck = "0.5.0"
gimli = { version = "0.26.0", default-features = false, features = ["read"] }
log = "0.4.6"
gimli = { workspace = true }
log = { workspace = true }
num_cpus = "1.8.0"
target-lexicon = "0.12"
target-lexicon = { workspace = true }
thiserror = "1.0.15"
anyhow = "1.0.32"
anyhow = { workspace = true }
similar = "2.1.0"

View File

@@ -8,14 +8,14 @@ documentation = "https://docs.rs/cranelift-frontend"
categories = ["no-std"]
repository = "https://github.com/bytecodealliance/wasmtime"
readme = "README.md"
edition = "2021"
edition.workspace = true
[dependencies]
cranelift-codegen = { path = "../codegen", version = "0.89.0", default-features = false }
target-lexicon = "0.12"
log = { version = "0.4.6", default-features = false }
hashbrown = { version = "0.12", optional = true }
smallvec = { version = "1.6.1", features = ["union"] }
cranelift-codegen = { workspace = true, default-features = false }
target-lexicon = { workspace = true }
log = { workspace = true }
hashbrown = { workspace = true, optional = true }
smallvec = { workspace = true }
[features]
default = ["std"]

View File

@@ -1,18 +1,18 @@
[package]
name = "cranelift-fuzzgen"
version = "0.75.0"
version = "0.0.0"
authors = ["The Wasmtime Project Developers"]
description = "Cranelift module generator"
license = "Apache-2.0 WITH LLVM-exception"
repository = "https://github.com/bytecodealliance/wasmtime"
readme = "README.md"
edition = "2021"
edition.workspace = true
publish = false
[dependencies]
cranelift = { path = "../umbrella", version = "0.89.0" }
cranelift-native = { path = "../native", version = "0.89.0" }
cranelift = { workspace = true }
cranelift-native = { workspace = true }
anyhow = "1.0.19"
anyhow = { workspace = true }
arbitrary = "1.0.0"

View File

@@ -8,21 +8,21 @@ documentation = "https://docs.rs/cranelift-interpreter"
categories = ["no-std"]
license = "Apache-2.0 WITH LLVM-exception"
readme = "README.md"
edition = "2021"
edition.workspace = true
[dependencies]
cranelift-codegen = { path = "../codegen", version = "0.89.0" }
cranelift-entity = { path = "../entity", version = "0.89.0" }
log = { version = "0.4.8", default-features = false }
smallvec = { version = "1.6.1", features = ["union"] }
cranelift-codegen = { workspace = true }
cranelift-entity = { workspace = true }
log = { workspace = true }
smallvec = { workspace = true }
thiserror = "1.0.15"
[target.x86_64-pc-windows-gnu.dependencies]
libm = "0.2.4"
[dev-dependencies]
cranelift-frontend = { path = "../frontend", version = "0.89.0" }
cranelift-reader = { path = "../reader", version = "0.89.0" }
cranelift-frontend = { workspace = true }
cranelift-reader = { workspace = true }
[badges]
maintenance = { status = "experimental" }

View File

@@ -3,16 +3,16 @@ name = "isle-fuzz"
version = "0.0.0"
authors = ["Automatically generated"]
publish = false
edition = "2021"
edition.workspace = true
[package.metadata]
cargo-fuzz = true
[dependencies]
env_logger = { version = "0.9.0", default-features = false }
env_logger = { workspace = true }
cranelift-isle = { path = "../isle" }
libfuzzer-sys = "0.4"
log = "0.4.14"
log = { workspace = true }
[[bin]]
name = "compile"

View File

@@ -1,7 +1,7 @@
[package]
authors = ["The Cranelift Project Developers"]
description = "ISLE: Instruction Selection and Lowering Expressions. A domain-specific language for instruction selection in Cranelift."
edition = "2021"
edition.workspace = true
license = "Apache-2.0 WITH LLVM-exception"
name = "cranelift-isle"
readme = "../README.md"
@@ -9,7 +9,7 @@ repository = "https://github.com/bytecodealliance/wasmtime/tree/main/cranelift/i
version = "0.89.0"
[dependencies]
log = { version = "0.4", optional = true }
log = { workspace = true, optional = true }
miette = { version = "5.1.0", optional = true }
rayon = "^1.5"

View File

@@ -2,12 +2,12 @@
name = "islec"
version = "0.1.0"
authors = ["The Cranelift Project Developers"]
edition = "2021"
edition.workspace = true
license = "Apache-2.0 WITH LLVM-exception"
publish = false
[dependencies]
cranelift-isle = { version = "*", path = "../isle/", features = ["miette-errors", "logging"] }
env_logger = { version = "0.9", default-features = false }
env_logger = { workspace = true }
miette = { version = "5.1.0", features = ["fancy"] }
clap = { version = "3.2.0", features = ["derive"] }
clap = { workspace = true }

View File

@@ -7,22 +7,22 @@ repository = "https://github.com/bytecodealliance/wasmtime"
documentation = "https://docs.rs/cranelift-jit"
license = "Apache-2.0 WITH LLVM-exception"
readme = "README.md"
edition = "2021"
edition.workspace = true
[dependencies]
cranelift-module = { path = "../module", version = "0.89.0" }
cranelift-native = { path = "../native", version = "0.89.0" }
cranelift-codegen = { path = "../codegen", version = "0.89.0", default-features = false, features = ["std"] }
cranelift-entity = { path = "../entity", version = "0.89.0" }
anyhow = "1.0"
cranelift-module = { workspace = true }
cranelift-native = { workspace = true }
cranelift-codegen = { workspace = true, default-features = false, features = ["std"] }
cranelift-entity = { workspace = true }
anyhow = { workspace = true }
region = "2.2.0"
libc = { version = "0.2.42" }
target-lexicon = "0.12"
target-lexicon = { workspace = true }
memmap2 = { version = "0.2.1", optional = true }
log = { version = "0.4.6", default-features = false }
log = { workspace = true }
[target.'cfg(windows)'.dependencies.windows-sys]
version = "0.36.0"
workspace = true
features = [
"Win32_Foundation",
"Win32_System_LibraryLoader",
@@ -34,9 +34,9 @@ selinux-fix = ['memmap2']
default = []
[dev-dependencies]
cranelift = { path = "../umbrella", version = "0.89.0" }
cranelift-frontend = { path = "../frontend", version = "0.89.0" }
cranelift-entity = { path = "../entity", version = "0.89.0" }
cranelift = { workspace = true }
cranelift-frontend = { workspace = true }
cranelift-entity = { workspace = true }
[badges]
maintenance = { status = "experimental" }

View File

@@ -8,12 +8,12 @@ documentation = "https://docs.rs/cranelift-module"
categories = ["no-std"]
license = "Apache-2.0 WITH LLVM-exception"
readme = "README.md"
edition = "2021"
edition.workspace = true
[dependencies]
cranelift-codegen = { path = "../codegen", version = "0.89.0", default-features = false }
hashbrown = { version = "0.12", optional = true }
anyhow = "1.0"
cranelift-codegen = { workspace = true, default-features = false }
hashbrown = { workspace = true, optional = true }
anyhow = { workspace = true }
[features]
default = ["std"]

View File

@@ -8,11 +8,11 @@ repository = "https://github.com/bytecodealliance/wasmtime"
categories = ["no-std"]
license = "Apache-2.0 WITH LLVM-exception"
readme = "README.md"
edition = "2021"
edition.workspace = true
[dependencies]
cranelift-codegen = { path = "../codegen", version = "0.89.0", default-features = false }
target-lexicon = "0.12"
cranelift-codegen = { workspace = true, default-features = false }
target-lexicon = { workspace = true }
[target.'cfg(target_arch = "s390x")'.dependencies]
libc = "0.2.95"

View File

@@ -7,19 +7,19 @@ repository = "https://github.com/bytecodealliance/wasmtime"
documentation = "https://docs.rs/cranelift-object"
license = "Apache-2.0 WITH LLVM-exception"
readme = "README.md"
edition = "2021"
edition.workspace = true
[dependencies]
cranelift-module = { path = "../module", version = "0.89.0" }
cranelift-codegen = { path = "../codegen", version = "0.89.0", default-features = false, features = ["std"] }
object = { version = "0.29.0", default-features = false, features = ["write"] }
target-lexicon = "0.12"
anyhow = "1.0"
log = { version = "0.4.6", default-features = false }
cranelift-module = { workspace = true }
cranelift-codegen = { workspace = true, default-features = false, features = ["std"] }
object = { workspace = true, features = ["write"] }
target-lexicon = { workspace = true }
anyhow = { workspace = true }
log = { workspace = true }
[dev-dependencies]
cranelift-frontend = { path = "../frontend", version = "0.89.0" }
cranelift-entity = { path = "../entity", version = "0.89.0" }
cranelift-frontend = { workspace = true }
cranelift-entity = { workspace = true }
[badges]
maintenance = { status = "experimental" }

View File

@@ -9,7 +9,7 @@ repository = "https://github.com/bytecodealliance/wasmtime"
categories = ["no-std"]
readme = "README.md"
keywords = ["optimize", "compile", "compiler", "jit"]
edition = "2021"
edition.workspace = true
[dependencies]
cranelift-codegen = { path = "../codegen", version = "0.89.0", default-features = false }

View File

@@ -7,12 +7,12 @@ license = "Apache-2.0 WITH LLVM-exception"
documentation = "https://docs.rs/cranelift-reader"
repository = "https://github.com/bytecodealliance/wasmtime"
readme = "README.md"
edition = "2021"
edition.workspace = true
[dependencies]
cranelift-codegen = { path = "../codegen", version = "0.89.0" }
smallvec = { version = "1.6.1", features = ["union"] }
target-lexicon = "0.12"
cranelift-codegen = { workspace = true }
smallvec = { workspace = true }
target-lexicon = { workspace = true }
[badges]
maintenance = { status = "experimental" }

View File

@@ -7,17 +7,17 @@ repository = "https://github.com/bytecodealliance/wasmtime"
license = "Apache-2.0 WITH LLVM-exception"
readme = "README.md"
keywords = ["webassembly", "serde"]
edition = "2021"
edition.workspace = true
[[bin]]
name = "clif-json"
path = "src/clif-json.rs"
[dependencies]
clap = { version = "3.2.0", features = ["derive"] }
clap = { workspace = true }
serde_json = "1.0.26"
cranelift-codegen = { path = "../codegen", version = "0.89.0", features = ["enable-serde"] }
cranelift-reader = { path = "../reader", version = "0.89.0" }
cranelift-codegen = { workspace = true, features = ["enable-serde"] }
cranelift-reader = { workspace = true }
[badges]
maintenance = { status = "experimental" }

View File

@@ -9,7 +9,7 @@ repository = "https://github.com/bytecodealliance/wasmtime"
categories = ["no-std"]
readme = "README.md"
keywords = ["compile", "compiler", "jit"]
edition = "2021"
edition.workspace = true
[dependencies]
cranelift-codegen = { path = "../codegen", version = "0.89.0", default-features = false }

View File

@@ -9,24 +9,23 @@ license = "Apache-2.0 WITH LLVM-exception"
categories = ["no-std", "wasm"]
readme = "README.md"
keywords = ["webassembly", "wasm"]
edition = "2021"
edition.workspace = true
[dependencies]
wasmparser = { version = "0.89.0", default-features = false }
cranelift-codegen = { path = "../codegen", version = "0.89.0", default-features = false }
cranelift-entity = { path = "../entity", version = "0.89.0" }
cranelift-frontend = { path = "../frontend", version = "0.89.0", default-features = false }
wasmtime-types = { path = "../../crates/types", version = "2.0.0" }
hashbrown = { version = "0.12", optional = true }
wasmparser = { workspace = true }
cranelift-codegen = { workspace = true, default-features = false }
cranelift-entity = { workspace = true }
cranelift-frontend = { workspace = true, default-features = false }
wasmtime-types = { workspace = true }
hashbrown = { workspace = true, optional = true }
itertools = "0.10.0"
log = { version = "0.4.6", default-features = false }
log = { workspace = true }
serde = { version = "1.0.94", features = ["derive"], optional = true }
smallvec = { version = "1.6.1", features = ["union"] }
[dev-dependencies]
wat = "1.0.47"
target-lexicon = "0.12"
cranelift-codegen = { path = "../codegen", version = "0.89.0", default-features = false }
wat = { workspace = true }
target-lexicon = { workspace = true }
[features]
default = ["std"]