@@ -7,7 +7,6 @@ use crate::spirv_source::{
7
7
use crate :: { cache_dir, spirv_source:: SpirvSource } ;
8
8
use anyhow:: Context as _;
9
9
use cargo_metadata:: Metadata ;
10
- use log:: { info, trace} ;
11
10
use spirv_builder:: SpirvBuilder ;
12
11
use std:: path:: { Path , PathBuf } ;
13
12
@@ -162,14 +161,14 @@ impl Install {
162
161
) ;
163
162
164
163
{
165
- trace ! ( "writing dummy lib.rs" ) ;
164
+ log :: trace!( "writing dummy lib.rs" ) ;
166
165
let src = checkout. join ( "src" ) ;
167
166
std:: fs:: create_dir_all ( & src) . context ( "creating 'src' directory" ) ?;
168
167
std:: fs:: File :: create ( src. join ( "lib.rs" ) ) . context ( "creating 'src/lib.rs'" ) ?;
169
168
} ;
170
169
171
170
{
172
- trace ! ( "writing dummy Cargo.toml" ) ;
171
+ log :: trace!( "writing dummy Cargo.toml" ) ;
173
172
let version_spec = match & source {
174
173
SpirvSource :: CratesIO ( version) => {
175
174
format ! ( "version = \" {version}\" " )
@@ -206,11 +205,6 @@ package = "rustc_codegen_spirv"
206
205
207
206
/// Copy spec files from one dir to another, assuming no subdirectories
208
207
fn copy_spec_files ( src : & Path , dst : & Path ) -> anyhow:: Result < ( ) > {
209
- info ! (
210
- "Copy target specs from {:?} to {:?}" ,
211
- src. display( ) ,
212
- dst. display( )
213
- ) ;
214
208
std:: fs:: create_dir_all ( dst) ?;
215
209
let dir = std:: fs:: read_dir ( src) ?;
216
210
for dir_entry in dir {
@@ -225,7 +219,6 @@ package = "rustc_codegen_spirv"
225
219
226
220
/// Add the target spec files to the crate.
227
221
fn update_spec_files (
228
- & self ,
229
222
source : & SpirvSource ,
230
223
install_dir : & Path ,
231
224
dummy_metadata : & Metadata ,
@@ -236,6 +229,11 @@ package = "rustc_codegen_spirv"
236
229
if let Ok ( target_specs) =
237
230
dummy_metadata. find_package ( "rustc_codegen_spirv-target-specs" )
238
231
{
232
+ log:: info!(
233
+ "target-specs: found crate `rustc_codegen_spirv-target-specs` with manifest at `{}`" ,
234
+ target_specs. manifest_path
235
+ ) ;
236
+
239
237
let target_specs_src = target_specs
240
238
. manifest_path
241
239
. as_std_path ( )
@@ -247,9 +245,17 @@ package = "rustc_codegen_spirv"
247
245
. context ( "Could not find `target-specs` directory within `rustc_codegen_spirv-target-specs` dependency" ) ?;
248
246
if source. is_path ( ) {
249
247
// skip copy
248
+ log:: info!(
249
+ "target-specs: source is local path, use target-specs from {}" ,
250
+ target_specs_src. display( )
251
+ ) ;
250
252
target_specs_dst = target_specs_src;
251
253
} else {
252
254
// copy over the target-specs
255
+ log:: info!(
256
+ "target-specs: Copy target specs from {}" ,
257
+ target_specs_src. display( )
258
+ ) ;
253
259
Self :: copy_spec_files ( & target_specs_src, & target_specs_dst)
254
260
. context ( "copying target-specs json files" ) ?;
255
261
}
@@ -263,7 +269,11 @@ package = "rustc_codegen_spirv"
263
269
// and hope parallel runs don't shred each other
264
270
target_specs_dst = cache_dir ( ) ?. join ( "legacy-target-specs-for-local-checkout" ) ;
265
271
}
266
- write_legacy_target_specs ( & target_specs_dst, self . rebuild_codegen ) ?;
272
+ log:: info!(
273
+ "target-specs: Writing legacy target specs to {}" ,
274
+ target_specs_dst. display( )
275
+ ) ;
276
+ write_legacy_target_specs ( & target_specs_dst) ?;
267
277
}
268
278
}
269
279
@@ -335,9 +345,9 @@ package = "rustc_codegen_spirv"
335
345
log:: info!( "selected toolchain channel `{toolchain_channel:?}`" ) ;
336
346
337
347
log:: debug!( "update_spec_files" ) ;
338
- let target_spec_dir = self
339
- . update_spec_files ( & source, & install_dir, & dummy_metadata, skip_rebuild)
340
- . context ( "writing target spec files" ) ?;
348
+ let target_spec_dir =
349
+ Self :: update_spec_files ( & source, & install_dir, & dummy_metadata, skip_rebuild)
350
+ . context ( "writing target spec files" ) ?;
341
351
342
352
if !skip_rebuild {
343
353
log:: debug!( "ensure_toolchain_and_components_exist" ) ;
0 commit comments