Skip to content

Commit c34e883

Browse files
authored
Merge pull request #30 from tombh/panic-less-code
Panic-less code and user prompt for toolchain installation
2 parents 35c2132 + 9dc0c03 commit c34e883

File tree

14 files changed

+601
-260
lines changed

14 files changed

+601
-260
lines changed

Cargo.lock

Lines changed: 158 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ exclude = [
1414
resolver = "2"
1515

1616
[workspace.dependencies]
17+
anyhow = "1.0.94"
1718
clap = { version = "4.4.8", features = ["derive"] }
18-
chrono = { version = "0.4.38", default-features = false }
19+
chrono = { version = "0.4.38", default-features = false, features = ["std"] }
20+
crossterm = "0.28.1"
1921
directories = "5.0.1"
2022
env_home = "0.1.0"
2123
env_logger = "0.10"
@@ -48,12 +50,6 @@ multiple_crate_versions = { level = "allow", priority = 1 }
4850
pub_with_shorthand = { level = "allow", priority = 1 }
4951
partial_pub_fields = { level = "allow", priority = 1 }
5052
pattern_type_mismatch = { level = "allow", priority = 1 }
51-
print_stdout = { level = "allow", priority = 1 }
5253
std_instead_of_alloc = { level = "allow", priority = 1 }
5354

54-
# TODO: Try to not depend on allowing these lints
55-
unwrap_used = { level = "allow", priority = 1 }
56-
get_unwrap = { level = "allow", priority = 1 }
57-
expect_used = { level = "allow", priority = 1 }
58-
panic = { level = "allow", priority = 1 }
5955

README.md

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ Options:
100100
--force-spirv-cli-rebuild
101101
Force `spirv-builder-cli` and `rustc_codegen_spirv` to be rebuilt
102102
103+
--auto-install-rust-toolchain
104+
Assume "yes" to "Install Rust toolchain: [y/n]" prompt
105+
103106
-h, --help
104107
Print help (see a summary with '-h')
105108
@@ -134,6 +137,9 @@ Options:
134137
--force-spirv-cli-rebuild
135138
Force `spirv-builder-cli` and `rustc_codegen_spirv` to be rebuilt
136139
140+
--auto-install-rust-toolchain
141+
Assume "yes" to "Install Rust toolchain: [y/n]" prompt
142+
137143
--shader-target <SHADER_TARGET>
138144
Shader target
139145
@@ -197,13 +203,44 @@ Options:
197203
198204
Show some useful values
199205
200-
Usage: cargo-gpu show [OPTIONS]
206+
Usage: cargo-gpu show <COMMAND>
201207
202-
Options:
203-
--cache-directory
204-
Displays the location of the cache directory
208+
Commands:
209+
cache-directory Displays the location of the cache directory
210+
spirv-source The source location of spirv-std
211+
help Print this message or the help of the given subcommand(s)
205212
213+
Options:
206214
-h, --help
207215
Print help
208216
217+
218+
* Cache-directory
219+
220+
Displays the location of the cache directory
221+
222+
Usage: cargo-gpu show cache-directory
223+
224+
Options:
225+
-h, --help
226+
Print help
227+
228+
229+
* Spirv-source
230+
231+
The source location of spirv-std
232+
233+
Usage: cargo-gpu show spirv-source [OPTIONS]
234+
235+
Options:
236+
--shader-crate <SHADER_CRATE>
237+
The location of the shader-crate to inspect to determine its spirv-std dependency
238+
239+
[default: ./]
240+
241+
-h, --help
242+
Print help
243+
244+
245+
209246
````

clippy.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
allow-unwrap-in-tests = true
2+
allow-panic-in-tests = true

crates/cargo-gpu/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ keywords = ["gpu", "compiler"]
99
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1010

1111
[dependencies]
12+
anyhow.workspace = true
1213
spirv-builder-cli = { path = "../spirv-builder-cli", default-features = false }
1314
clap.workspace = true
1415
directories.workspace = true
@@ -20,6 +21,7 @@ serde_json.workspace = true
2021
toml.workspace = true
2122
chrono.workspace = true
2223
http.workspace = true
24+
crossterm.workspace = true
2325

2426
[dev-dependencies]
2527
test-log.workspace = true

0 commit comments

Comments
 (0)