Skip to content

Commit bb5d2e0

Browse files
committed
compile_codegen: rename feature from compile_codegen to rustc_codegen_spirv
1 parent 879338b commit bb5d2e0

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

crates/spirv-builder/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ no-default-features = true
2121
default = ["use-compiled-tools"]
2222
# Compile `rustc_codegen_spirv`, allows constructing SpirvBuilder without
2323
# explicitly passing in a path to a compiled `rustc_codegen_spirv.so` (or dll)
24-
compile_codegen = ["dep:rustc_codegen_spirv"]
24+
rustc_codegen_spirv = ["dep:rustc_codegen_spirv"]
2525
# See `rustc_codegen_spirv/Cargo.toml` for details on these features.
26-
use-installed-tools = ["compile_codegen", "rustc_codegen_spirv?/use-installed-tools"]
27-
use-compiled-tools = ["compile_codegen", "rustc_codegen_spirv?/use-compiled-tools"]
26+
use-installed-tools = ["rustc_codegen_spirv", "rustc_codegen_spirv?/use-installed-tools"]
27+
use-compiled-tools = ["rustc_codegen_spirv", "rustc_codegen_spirv?/use-compiled-tools"]
2828
skip-toolchain-check = ["rustc_codegen_spirv?/skip-toolchain-check"]
2929

3030
watch = ["dep:notify"]

crates/spirv-builder/src/lib.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,14 @@ pub enum SpirvBuilderError {
101101
UnsupportedSpirvTargetEnv { target_env: String },
102102
#[error("`path_to_crate` must be set")]
103103
MissingCratePath,
104-
#[error("crate path {0} does not exist")]
104+
#[error("crate path '{0}' does not exist")]
105105
CratePathDoesntExist(PathBuf),
106106
#[error(
107-
"Without feature `compile_codegen`, you need to set the path of the codegen dylib using `rustc_codegen_spirv_location(...)`"
107+
"Without feature `rustc_codegen_spirv`, you need to set the path of the dylib using `rustc_codegen_spirv_location(...)`"
108108
)]
109-
MissingCodegenBackendDylib,
109+
MissingRustcCodegenSpirvDylib,
110110
#[error("`rustc_codegen_spirv_location` path '{0}' is not a file")]
111-
CodegenBackendDylibDoesNotExist(PathBuf),
111+
RustcCodegenSpirvDylibDoesNotExist(PathBuf),
112112
#[error("build failed")]
113113
BuildFailed,
114114
#[error("multi-module build cannot be used with print_metadata = MetadataPrintout::Full")]
@@ -353,7 +353,7 @@ pub struct SpirvBuilder {
353353
/// Set additional "codegen arg". Note: the `RUSTGPU_CODEGEN_ARGS` environment variable
354354
/// takes precedence over any set arguments using this function.
355355
pub extra_args: Vec<String>,
356-
// Optional location of a known `rustc_codegen_spirv` dylib
356+
// Location of a known `rustc_codegen_spirv` dylib, only required without feature `rustc_codegen_spirv`.
357357
pub rustc_codegen_spirv_location: Option<std::path::PathBuf>,
358358

359359
/// The path of the "target specification" file.
@@ -641,7 +641,7 @@ fn dylib_path() -> Vec<PathBuf> {
641641
}
642642

643643
fn find_rustc_codegen_spirv() -> Result<PathBuf, SpirvBuilderError> {
644-
if cfg!(feature = "compile_codegen") {
644+
if cfg!(feature = "rustc_codegen_spirv") {
645645
let filename = format!(
646646
"{}rustc_codegen_spirv{}",
647647
env::consts::DLL_PREFIX,
@@ -655,7 +655,7 @@ fn find_rustc_codegen_spirv() -> Result<PathBuf, SpirvBuilderError> {
655655
}
656656
panic!("Could not find {filename} in library path");
657657
} else {
658-
Err(SpirvBuilderError::MissingCodegenBackendDylib)
658+
Err(SpirvBuilderError::MissingRustcCodegenSpirvDylib)
659659
}
660660
}
661661

@@ -726,7 +726,7 @@ fn invoke_rustc(builder: &SpirvBuilder) -> Result<PathBuf, SpirvBuilderError> {
726726
.transpose()
727727
.unwrap_or_else(find_rustc_codegen_spirv)?;
728728
if !rustc_codegen_spirv.is_file() {
729-
return Err(SpirvBuilderError::CodegenBackendDylibDoesNotExist(
729+
return Err(SpirvBuilderError::RustcCodegenSpirvDylibDoesNotExist(
730730
rustc_codegen_spirv,
731731
));
732732
}

0 commit comments

Comments
 (0)