diff --git a/Cargo.lock b/Cargo.lock index 690e6a1ce8..3695114ec6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2102,7 +2102,10 @@ name = "rustc_codegen_spirv" version = "0.4.0-alpha.2" dependencies = [ "bimap", + "hashbrown", "indexmap", + "libc", + "num-traits", "pipe", "pretty_assertions", "rspirv", @@ -2111,6 +2114,7 @@ dependencies = [ "serde_json", "smallvec", "spirv-tools", + "syn", "tar", "tempfile", "topological-sort", diff --git a/Cargo.toml b/Cargo.toml index 0707c3631f..941e946f71 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,6 +22,12 @@ members = [ opt-level = 3 codegen-units = 16 +# HACK(eddyb) this is the default but without explicitly specifying it, Cargo +# will treat the identical settings in `[profile.release.build-override]` above +# as different sets of `rustc` flags and will not reuse artifacts between them. +[profile.release] +codegen-units = 16 + [patch.crates-io] spirv-std = { path = "./crates/spirv-std" } spirv-std-macros = { path = "./crates/spirv-std-macros" } diff --git a/crates/rustc_codegen_spirv/Cargo.toml b/crates/rustc_codegen_spirv/Cargo.toml index f19ad7eb6b..21841d4393 100644 --- a/crates/rustc_codegen_spirv/Cargo.toml +++ b/crates/rustc_codegen_spirv/Cargo.toml @@ -27,6 +27,14 @@ use-installed-tools = ["spirv-tools/use-installed-tools"] use-compiled-tools = ["spirv-tools/use-compiled-tools"] [dependencies] +# HACK(eddyb) these only exist to unify features across dependency trees, +# in order to avoid multiple separate instances of `rustc_codegen_spirv`. +hashbrown = { version = "0.9", features = ["default"] } +libc = { version = "0.2", features = ["align", "extra_traits"] } +num-traits = { version = "0.2", features = ["libm"] } +syn = { version = "1", features = ["visit", "visit-mut"] } + +# Normal dependencies. bimap = "0.6" indexmap = "1.6.0" rspirv = { git = "https://github.com/gfx-rs/rspirv.git", rev = "ee1e913" } diff --git a/tests/Cargo.toml b/tests/Cargo.toml index bda109207f..4840b89362 100644 --- a/tests/Cargo.toml +++ b/tests/Cargo.toml @@ -6,7 +6,13 @@ edition = "2018" license = "MIT OR Apache-2.0" publish = false +# See rustc_codegen_spirv/Cargo.toml for details on these features +[features] +default = ["use-compiled-tools"] +use-installed-tools = ["rustc_codegen_spirv/use-installed-tools"] +use-compiled-tools = ["rustc_codegen_spirv/use-compiled-tools"] + [dependencies] compiletest = { version = "0.6.0", package = "compiletest_rs" } -rustc_codegen_spirv = { path = "../crates/rustc_codegen_spirv" } +rustc_codegen_spirv = { path = "../crates/rustc_codegen_spirv", default-features = false } structopt = "0.3.21"