This repository was archived by the owner on Apr 15, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11[package ]
22name = " cargo-gpu-cache"
33description = " Builder of `rust-gpu` shader crates"
4- readme = " ../../README.md"
54version.workspace = true
65edition.workspace = true
76repository.workspace = true
Original file line number Diff line number Diff line change @@ -251,7 +251,7 @@ impl LockfileMismatchHandler {
251251 \n \
252252 One way to resolve this is to force the workspace to use the same version\n \
253253 of Rust as required by the shader. However that is not often ideal or even\n \
254- possible. Another way is to exlude the shader from the workspace. This is\n \
254+ possible. Another way is to exclude the shader from the workspace. This is\n \
255255 also not ideal if you have many shaders sharing config from the workspace.\n \
256256 \n \
257257 Therefore `cargo gpu build/install` offers a workaround with the argument:\n \
Original file line number Diff line number Diff line change @@ -172,14 +172,16 @@ mod test {
172172
173173 #[ test_log:: test]
174174 fn can_override_config_from_crate_toml ( ) {
175+ const PACKAGE_NAME : & str = env ! ( "CARGO_PKG_NAME" ) ;
176+
175177 let mut metadata = MetadataCommand :: new ( )
176178 . current_dir ( env ! ( "CARGO_MANIFEST_DIR" ) )
177179 . exec ( )
178180 . unwrap ( ) ;
179181 let cargo_gpu = metadata
180182 . packages
181183 . iter_mut ( )
182- . find ( |package| package. name . contains ( "cargo-gpu-cache" ) ) // should be the name of this very crate
184+ . find ( |package| package. name . contains ( PACKAGE_NAME ) )
183185 . unwrap ( ) ;
184186 cargo_gpu. metadata = serde_json:: json!( {
185187 "rust-gpu" : {
Original file line number Diff line number Diff line change 11[package ]
22name = " cargo-gpu"
33description = " Command line tool for building Rust shaders using `rust-gpu`"
4+ readme = " ../../README.md"
45version.workspace = true
56edition.workspace = true
67repository.workspace = true
Original file line number Diff line number Diff line change 55//!
66//! For additional information see the [`cargo-gpu-cache`](cargo_gpu_cache) crate documentation.
77
8+ use std:: process:: ExitCode ;
9+
810use cargo_gpu_cache:: Cli ;
911use clap:: Parser as _;
1012
11- fn main ( ) {
13+ fn main ( ) -> ExitCode {
1214 #[ cfg( debug_assertions) ]
1315 std:: env:: set_var ( "RUST_BACKTRACE" , "1" ) ;
1416
@@ -23,13 +25,10 @@ fn main() {
2325 ) ]
2426 {
2527 eprintln ! ( "Error: {error}" ) ;
26-
27- // `clippy::exit` seems to be a false positive in `main()`.
28- // See: https://github.com/rust-lang/rust-clippy/issues/13518
29- #[ expect( clippy:: restriction, reason = "Our central place for safely exiting" ) ]
30- std:: process:: exit ( 1 ) ;
28+ return ExitCode :: FAILURE ;
3129 } ;
3230 }
31+ ExitCode :: SUCCESS
3332}
3433
3534/// Wrappable "main" to catch errors.
@@ -42,6 +41,7 @@ fn run() -> anyhow::Result<()> {
4241 } )
4342 . collect :: < Vec < _ > > ( ) ;
4443 log:: trace!( "CLI args: {env_args:#?}" ) ;
44+
4545 let cli = Cli :: parse_from ( & env_args) ;
4646 cli. command . run ( env_args)
4747}
You can’t perform that action at this time.
0 commit comments