Skip to content

Commit 4ec33b1

Browse files
committed
remove unused dry-run arg
1 parent 12010db commit 4ec33b1

3 files changed

Lines changed: 28 additions & 33 deletions

File tree

crates/cargo-gpu/src/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,6 @@ pub mod spirv_builder_cli {
5454

5555
/// Path to the output directory for the compiled shaders.
5656
pub output_dir: std::path::PathBuf,
57-
58-
/// Dry run or not
59-
pub dry_run: bool,
6057
}
6158

6259
/// A built shader entry-point, used in `spirv-builder-cli` to generate

crates/cargo-gpu/src/main.rs

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -408,10 +408,6 @@ struct Build {
408408
/// Path to the output directory for the compiled shaders.
409409
#[clap(long, short, default_value = "./")]
410410
output_dir: std::path::PathBuf,
411-
412-
/// If set the shaders will be compiled but not put into place.
413-
#[clap(long, short)]
414-
dry_run: bool,
415411
}
416412

417413
impl Build {
@@ -440,7 +436,6 @@ impl Build {
440436
no_default_features: self.no_default_features,
441437
features: self.features.clone(),
442438
output_dir: self.output_dir.clone(),
443-
dry_run: self.dry_run,
444439
};
445440

446441
// UNWRAP: safe because we know this always serializes
@@ -478,37 +473,41 @@ impl Build {
478473
path: filepath,
479474
}| {
480475
let path = self.output_dir.join(filepath.file_name().unwrap());
481-
if !self.dry_run {
482-
std::fs::copy(filepath, &path).unwrap();
483-
}
476+
std::fs::copy(filepath, &path).unwrap();
484477
Linkage::new(entry, path)
485478
},
486479
)
487480
.collect();
488481

489482
// Write the shader manifest json file
490-
if !self.dry_run {
491-
let manifest_path = self.output_dir.join("manifest.json");
492-
// Sort the contents so the output is deterministic
493-
linkage.sort();
494-
// UNWRAP: safe because we know this always serializes
495-
let json = serde_json::to_string_pretty(&linkage).unwrap();
496-
let mut file = std::fs::File::create(&manifest_path).unwrap_or_else(|e| {
497-
log::error!(
498-
"could not create shader manifest file '{}': {e}",
499-
manifest_path.display(),
500-
);
501-
panic!("{e}")
502-
});
503-
file.write_all(json.as_bytes()).unwrap_or_else(|e| {
504-
log::error!(
505-
"could not write shader manifest file '{}': {e}",
506-
manifest_path.display(),
507-
);
508-
panic!("{e}")
509-
});
483+
let manifest_path = self.output_dir.join("manifest.json");
484+
// Sort the contents so the output is deterministic
485+
linkage.sort();
486+
// UNWRAP: safe because we know this always serializes
487+
let json = serde_json::to_string_pretty(&linkage).unwrap();
488+
let mut file = std::fs::File::create(&manifest_path).unwrap_or_else(|e| {
489+
log::error!(
490+
"could not create shader manifest file '{}': {e}",
491+
manifest_path.display(),
492+
);
493+
panic!("{e}")
494+
});
495+
file.write_all(json.as_bytes()).unwrap_or_else(|e| {
496+
log::error!(
497+
"could not write shader manifest file '{}': {e}",
498+
manifest_path.display(),
499+
);
500+
panic!("{e}")
501+
});
510502

511-
log::info!("wrote manifest to '{}'", manifest_path.display());
503+
log::info!("wrote manifest to '{}'", manifest_path.display());
504+
505+
if spirv_manifest.is_file() {
506+
log::debug!(
507+
"removing spirv-manifest.json file '{}'",
508+
spirv_manifest.display()
509+
);
510+
std::fs::remove_file(spirv_manifest).unwrap();
512511
}
513512
}
514513
}

crates/spirv-builder-cli/src/main.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ fn main() {
3434
no_default_features,
3535
features,
3636
output_dir,
37-
dry_run: _,
3837
} = args;
3938

4039
let CompileResult {

0 commit comments

Comments
 (0)