@@ -200,7 +200,7 @@ package = "rustc_codegen_spirv"
200
200
self . spirv_builder_version . as_deref ( ) ,
201
201
) ?;
202
202
let source_is_path = matches ! ( source, SpirvSource :: Path { .. } ) ;
203
- let checkout = source. install_dir ( ) ?;
203
+ let install_dir = source. install_dir ( ) ?;
204
204
205
205
let dylib_filename = format ! (
206
206
"{}rustc_codegen_spirv{}" ,
@@ -210,16 +210,16 @@ package = "rustc_codegen_spirv"
210
210
211
211
let dest_dylib_path;
212
212
if source_is_path {
213
- dest_dylib_path = checkout
213
+ dest_dylib_path = install_dir
214
214
. join ( "target" )
215
215
. join ( "release" )
216
216
. join ( & dylib_filename) ;
217
217
} else {
218
- dest_dylib_path = checkout . join ( & dylib_filename) ;
218
+ dest_dylib_path = install_dir . join ( & dylib_filename) ;
219
219
if dest_dylib_path. is_file ( ) {
220
220
log:: info!(
221
221
"cargo-gpu artifacts are already installed in '{}'" ,
222
- checkout . display( )
222
+ install_dir . display( )
223
223
) ;
224
224
}
225
225
}
@@ -228,12 +228,12 @@ package = "rustc_codegen_spirv"
228
228
if skip_rebuild {
229
229
log:: info!( "...and so we are aborting the install step." ) ;
230
230
} else {
231
- Self :: write_source_files ( & source, & checkout ) . context ( "writing source files" ) ?;
231
+ Self :: write_source_files ( & source, & install_dir ) . context ( "writing source files" ) ?;
232
232
}
233
233
234
234
// TODO cache toolchain channel in a file?
235
235
log:: debug!( "resolving toolchain version to use" ) ;
236
- let rustc_codegen_spirv = get_package_from_crate ( & checkout , "rustc_codegen_spirv" )
236
+ let rustc_codegen_spirv = get_package_from_crate ( & install_dir , "rustc_codegen_spirv" )
237
237
. context ( "get `rustc_codegen_spirv` metadata" ) ?;
238
238
let toolchain_channel =
239
239
get_channel_from_rustc_codegen_spirv_build_script ( & rustc_codegen_spirv)
@@ -251,13 +251,14 @@ package = "rustc_codegen_spirv"
251
251
// to prevent unsupported version errors when using older toolchains
252
252
if !source_is_path {
253
253
log:: debug!( "remove Cargo.lock" ) ;
254
- std:: fs:: remove_file ( checkout. join ( "Cargo.lock" ) ) . context ( "remove Cargo.lock" ) ?;
254
+ std:: fs:: remove_file ( install_dir. join ( "Cargo.lock" ) )
255
+ . context ( "remove Cargo.lock" ) ?;
255
256
}
256
257
257
258
crate :: user_output!( "Compiling `rustc_codegen_spirv` from source {}\n " , source, ) ;
258
259
let mut build_command = std:: process:: Command :: new ( "cargo" ) ;
259
260
build_command
260
- . current_dir ( & checkout )
261
+ . current_dir ( & install_dir )
261
262
. arg ( format ! ( "+{toolchain_channel}" ) )
262
263
. args ( [ "build" , "--release" ] )
263
264
. env_remove ( "RUSTC" ) ;
@@ -281,7 +282,7 @@ package = "rustc_codegen_spirv"
281
282
} )
282
283
. context ( "running build command" ) ?;
283
284
284
- let target = checkout . join ( "target" ) ;
285
+ let target = install_dir . join ( "target" ) ;
285
286
let dylib_path = target. join ( "release" ) . join ( & dylib_filename) ;
286
287
if dylib_path. is_file ( ) {
287
288
log:: info!( "successfully built {}" , dylib_path. display( ) ) ;
0 commit comments