Skip to content

Commit 2c333e7

Browse files
committed
apply suggestions from @tombh
1 parent 82468e4 commit 2c333e7

File tree

4 files changed

+7
-13
lines changed

4 files changed

+7
-13
lines changed

crates/cargo-gpu/src/args.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Args for building and installing. Previously in `spirv-tools-cli` but got moved here.
1+
//! Args for building and installing.
22
33
use spirv_builder::SpirvBuilder;
44

@@ -63,7 +63,7 @@ pub struct InstallArgs {
6363
#[clap(long, verbatim_doc_comment)]
6464
pub spirv_builder_version: Option<String>,
6565

66-
/// Force `spirv-builder-cli` and `rustc_codegen_spirv` to be rebuilt.
66+
/// Force `rustc_codegen_spirv` to be rebuilt.
6767
#[clap(long)]
6868
pub force_spirv_cli_rebuild: bool,
6969

crates/cargo-gpu/src/linkage.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Mainly for the Linkage struct, which is written to a json file. Previously in `spirv-tools-cli` but got moved here.
1+
//! Mainly for the Linkage struct, which is written to a json file.
22
33
/// Shader source and entry point that can be used to create shader linkage.
44
#[derive(serde::Serialize, Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]

crates/cargo-gpu/src/lockfile.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
//! Query the shader crate to find what version of `rust-gpu` it depends on.
2-
//! Then ensure that the relevant Rust toolchain and components are installed.
1+
//! Handles lockfile version conflicts and downgrades. Stable uses lockfile v4, but rust-gpu
2+
//! v0.9.0 uses an old toolchain requiring v3 and will refuse to build with a v4 lockfile being
3+
//! present. This module takes care of warning the user and potentially downgrading the lockfile.
34
45
use anyhow::Context as _;
56
use semver::Version;

crates/cargo-gpu/src/metadata.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ impl Metadata {
3232
&mut metadata,
3333
{
3434
log::debug!("looking for workspace metadata");
35-
let ws_meta = Self::get_workspace_metadata(cargo_json);
35+
let ws_meta = Self::get_rust_gpu_from_metadata(&cargo_json.workspace_metadata);
3636
log::trace!("workspace_metadata: {ws_meta:#?}");
3737
ws_meta
3838
},
@@ -64,19 +64,12 @@ impl Metadata {
6464
}
6565

6666
/// Convert a `Cargo.toml` to JSON
67-
//
68-
// TODO: reuse for getting the default `rust-gpu` source and toolchain.
6967
fn get_cargo_toml_as_json(
7068
path: &std::path::PathBuf,
7169
) -> anyhow::Result<cargo_metadata::Metadata> {
7270
Ok(MetadataCommand::new().current_dir(path).exec()?)
7371
}
7472

75-
/// Get any `rust-gpu` metadata set in the root workspace `Cargo.toml`
76-
fn get_workspace_metadata(metadata: &cargo_metadata::Metadata) -> Value {
77-
Self::get_rust_gpu_from_metadata(&metadata.workspace_metadata)
78-
}
79-
8073
/// Get any `rust-gpu` metadata set in the crate's `Cargo.toml`
8174
fn get_crate_metadata(
8275
json: &cargo_metadata::Metadata,

0 commit comments

Comments
 (0)