Skip to content

Commit 2bf3138

Browse files
committed
Fix CI when codegen .so is clobbered
The workspace builds rustc_codegen_nvvm as a normal Cargo member. During every CUDA build script, cuda_builder re-builds that same crate through -Zcodegen-backend=. Cargo produces two identical librustc_codegen_nvvm.so. Add a feature to differentiate the two cases, cribbing from rust-gpu as it has the same structure but no overlapping .so issue
1 parent 1d94a20 commit 2bf3138

File tree

11 files changed

+327
-29
lines changed

11 files changed

+327
-29
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ opt-level = 3
3131

3232
[workspace.dependencies]
3333
cuda_std = { path = "crates/cuda_std" }
34-
cuda_builder = { path = "crates/cuda_builder" }
34+
cuda_builder = { path = "crates/cuda_builder", version = "=0.3.0", default-features = false }

crates/cuda_builder/Cargo.toml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,17 @@ description = "Builder for easily building rustc_codegen_nvvm crates"
88
repository = "https://github.com/Rust-GPU/rust-cuda"
99
readme = "../../README.md"
1010

11+
[package.metadata.docs.rs]
12+
no-default-features = true
13+
14+
[features]
15+
default = []
16+
# HACK(see rust-gpu/spirv-builder): use `dep:` to avoid Cargo auto-creating a feature
17+
# with the dependency name. Consumers must explicitly opt-in to compiling the backend.
18+
rustc_codegen_nvvm = ["dep:rustc_codegen_nvvm"]
19+
1120
[dependencies]
12-
rustc_codegen_nvvm = { version = "0.3", path = "../rustc_codegen_nvvm" }
21+
rustc_codegen_nvvm = { version = "0.3", path = "../rustc_codegen_nvvm", optional = true }
1322
nvvm = { path = "../nvvm", version = "0.1" }
1423
serde = { version = "1.0.217", features = ["derive"] }
1524
serde_json = "1.0.138"

0 commit comments

Comments
 (0)