@@ -221,25 +221,35 @@ impl Install {
221221 self . spirv_install. shader_crate. display( )
222222 ) ;
223223
224- let mut command = std:: process:: Command :: new ( "cargo" ) ;
225- command
224+ // Run a `cargo update` just in case the cached Cargo.lock we copied over
225+ // is a bit behind what's in rust-gpu
226+ let mut update_command = std:: process:: Command :: new ( "cargo" ) ;
227+ update_command. current_dir ( & checkout) . arg ( "update" ) ;
228+ let update_output = update_command
229+ . stdout ( std:: process:: Stdio :: inherit ( ) )
230+ . stderr ( std:: process:: Stdio :: inherit ( ) )
231+ . output ( ) ?;
232+ anyhow:: ensure!( update_output. status. success( ) , "...cargo update error!" ) ;
233+
234+ let mut build_command = std:: process:: Command :: new ( "cargo" ) ;
235+ build_command
226236 . current_dir ( & checkout)
227237 . arg ( format ! ( "+{}" , spirv_version. channel) )
228238 . args ( [ "build" , "--release" ] )
229239 . args ( [ "--no-default-features" ] ) ;
230240
231- command . args ( [
241+ build_command . args ( [
232242 "--features" ,
233243 & Self :: get_required_spirv_builder_version ( spirv_version. date ) ?,
234244 ] ) ;
235245
236- log:: debug!( "building artifacts with `{:?}`" , command ) ;
246+ log:: debug!( "building artifacts with `{:?}`" , build_command ) ;
237247
238- let output = command
248+ let build_output = build_command
239249 . stdout ( std:: process:: Stdio :: inherit ( ) )
240250 . stderr ( std:: process:: Stdio :: inherit ( ) )
241251 . output ( ) ?;
242- anyhow:: ensure!( output . status. success( ) , "...build error!" ) ;
252+ anyhow:: ensure!( build_output . status. success( ) , "...build error!" ) ;
243253
244254 if dylib_path. is_file ( ) {
245255 log:: info!( "successfully built {}" , dylib_path. display( ) ) ;
0 commit comments