@@ -7,7 +7,6 @@ use crate::spirv_source::{
77use crate :: { cache_dir, spirv_source:: SpirvSource } ;
88use anyhow:: Context as _;
99use cargo_metadata:: Metadata ;
10- use log:: { info, trace} ;
1110use spirv_builder:: SpirvBuilder ;
1211use std:: path:: { Path , PathBuf } ;
1312
@@ -162,14 +161,14 @@ impl Install {
162161 ) ;
163162
164163 {
165- trace ! ( "writing dummy lib.rs" ) ;
164+ log :: trace!( "writing dummy lib.rs" ) ;
166165 let src = checkout. join ( "src" ) ;
167166 std:: fs:: create_dir_all ( & src) . context ( "creating 'src' directory" ) ?;
168167 std:: fs:: File :: create ( src. join ( "lib.rs" ) ) . context ( "creating 'src/lib.rs'" ) ?;
169168 } ;
170169
171170 {
172- trace ! ( "writing dummy Cargo.toml" ) ;
171+ log :: trace!( "writing dummy Cargo.toml" ) ;
173172 let version_spec = match & source {
174173 SpirvSource :: CratesIO ( version) => {
175174 format ! ( "version = \" {version}\" " )
@@ -206,11 +205,6 @@ package = "rustc_codegen_spirv"
206205
207206 /// Copy spec files from one dir to another, assuming no subdirectories
208207 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- ) ;
214208 std:: fs:: create_dir_all ( dst) ?;
215209 let dir = std:: fs:: read_dir ( src) ?;
216210 for dir_entry in dir {
@@ -225,7 +219,6 @@ package = "rustc_codegen_spirv"
225219
226220 /// Add the target spec files to the crate.
227221 fn update_spec_files (
228- & self ,
229222 source : & SpirvSource ,
230223 install_dir : & Path ,
231224 dummy_metadata : & Metadata ,
@@ -236,6 +229,11 @@ package = "rustc_codegen_spirv"
236229 if let Ok ( target_specs) =
237230 dummy_metadata. find_package ( "rustc_codegen_spirv-target-specs" )
238231 {
232+ log:: info!(
233+ "target-specs: found crate `rustc_codegen_spirv-target-specs` with manifest at `{}`" ,
234+ target_specs. manifest_path
235+ ) ;
236+
239237 let target_specs_src = target_specs
240238 . manifest_path
241239 . as_std_path ( )
@@ -247,9 +245,17 @@ package = "rustc_codegen_spirv"
247245 . context ( "Could not find `target-specs` directory within `rustc_codegen_spirv-target-specs` dependency" ) ?;
248246 if source. is_path ( ) {
249247 // skip copy
248+ log:: info!(
249+ "target-specs: source is local path, use target-specs from {}" ,
250+ target_specs_src. display( )
251+ ) ;
250252 target_specs_dst = target_specs_src;
251253 } else {
252254 // copy over the target-specs
255+ log:: info!(
256+ "target-specs: Copy target specs from {}" ,
257+ target_specs_src. display( )
258+ ) ;
253259 Self :: copy_spec_files ( & target_specs_src, & target_specs_dst)
254260 . context ( "copying target-specs json files" ) ?;
255261 }
@@ -263,7 +269,11 @@ package = "rustc_codegen_spirv"
263269 // and hope parallel runs don't shred each other
264270 target_specs_dst = cache_dir ( ) ?. join ( "legacy-target-specs-for-local-checkout" ) ;
265271 }
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) ?;
267277 }
268278 }
269279
@@ -335,9 +345,9 @@ package = "rustc_codegen_spirv"
335345 log:: info!( "selected toolchain channel `{toolchain_channel:?}`" ) ;
336346
337347 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" ) ?;
341351
342352 if !skip_rebuild {
343353 log:: debug!( "ensure_toolchain_and_components_exist" ) ;
0 commit comments