Avoid ever building rustc_codegen_spirv more than once in release mode.

This commit is contained in:
Eduard-Mihai Burtescu 2021-03-29 04:29:49 +03:00 committed by XAMPPRocky
parent e9dc4580a0
commit db208e7190
4 changed files with 25 additions and 1 deletions

4
Cargo.lock generated
View File

@ -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",

View File

@ -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" }

View File

@ -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" }

View File

@ -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"