@@ -839,7 +839,7 @@ impl LocalFingerprint {
839839 mtime_cache : & mut HashMap < PathBuf , FileTime > ,
840840 checksum_cache : & mut HashMap < PathBuf , Checksum > ,
841841 pkg : & Package ,
842- target_root : & Path ,
842+ build_root : & Path ,
843843 cargo_exe : & Path ,
844844 gctx : & GlobalContext ,
845845 ) -> CargoResult < Option < StaleItem > > {
@@ -852,8 +852,8 @@ impl LocalFingerprint {
852852 // the `dep_info` file itself whose mtime represents the start of
853853 // rustc.
854854 LocalFingerprint :: CheckDepInfo { dep_info, checksum } => {
855- let dep_info = target_root . join ( dep_info) ;
856- let Some ( info) = parse_dep_info ( pkg_root, target_root , & dep_info) ? else {
855+ let dep_info = build_root . join ( dep_info) ;
856+ let Some ( info) = parse_dep_info ( pkg_root, build_root , & dep_info) ? else {
857857 return Ok ( Some ( StaleItem :: MissingFile ( dep_info) ) ) ;
858858 } ;
859859 for ( key, previous) in info. env . iter ( ) {
@@ -910,7 +910,7 @@ impl LocalFingerprint {
910910 LocalFingerprint :: RerunIfChanged { output, paths } => Ok ( find_stale_file (
911911 mtime_cache,
912912 checksum_cache,
913- & target_root . join ( output) ,
913+ & build_root . join ( output) ,
914914 paths. iter ( ) . map ( |p| ( pkg_root. join ( p) , None ) ) ,
915915 false ,
916916 ) ) ,
@@ -1153,7 +1153,7 @@ impl Fingerprint {
11531153 mtime_cache : & mut HashMap < PathBuf , FileTime > ,
11541154 checksum_cache : & mut HashMap < PathBuf , Checksum > ,
11551155 pkg : & Package ,
1156- target_root : & Path ,
1156+ build_root : & Path ,
11571157 cargo_exe : & Path ,
11581158 gctx : & GlobalContext ,
11591159 ) -> CargoResult < ( ) > {
@@ -1261,7 +1261,7 @@ impl Fingerprint {
12611261 mtime_cache,
12621262 checksum_cache,
12631263 pkg,
1264- target_root ,
1264+ build_root ,
12651265 cargo_exe,
12661266 gctx,
12671267 ) ? {
@@ -1449,13 +1449,13 @@ fn calculate(build_runner: &mut BuildRunner<'_, '_>, unit: &Unit) -> CargoResult
14491449
14501450 // After we built the initial `Fingerprint` be sure to update the
14511451 // `fs_status` field of it.
1452- let target_root = target_root ( build_runner) ;
1452+ let build_root = build_root ( build_runner) ;
14531453 let cargo_exe = build_runner. bcx . gctx . cargo_exe ( ) ?;
14541454 fingerprint. check_filesystem (
14551455 & mut build_runner. mtime_cache ,
14561456 & mut build_runner. checksum_cache ,
14571457 & unit. pkg ,
1458- & target_root ,
1458+ & build_root ,
14591459 cargo_exe,
14601460 build_runner. bcx . gctx ,
14611461 ) ?;
@@ -1493,7 +1493,7 @@ fn calculate_normal(
14931493 } ;
14941494
14951495 // Afterwards calculate our own fingerprint information.
1496- let target_root = target_root ( build_runner) ;
1496+ let build_root = build_root ( build_runner) ;
14971497 let local = if unit. mode . is_doc ( ) || unit. mode . is_doc_scrape ( ) {
14981498 // rustdoc does not have dep-info files.
14991499 let fingerprint = pkg_fingerprint ( build_runner. bcx , & unit. pkg ) . with_context ( || {
@@ -1505,7 +1505,7 @@ fn calculate_normal(
15051505 vec ! [ LocalFingerprint :: Precalculated ( fingerprint) ]
15061506 } else {
15071507 let dep_info = dep_info_loc ( build_runner, unit) ;
1508- let dep_info = dep_info. strip_prefix ( & target_root ) . unwrap ( ) . to_path_buf ( ) ;
1508+ let dep_info = dep_info. strip_prefix ( & build_root ) . unwrap ( ) . to_path_buf ( ) ;
15091509 vec ! [ LocalFingerprint :: CheckDepInfo {
15101510 dep_info,
15111511 checksum: build_runner. bcx. gctx. cli_unstable( ) . checksum_freshness,
@@ -1714,7 +1714,7 @@ fn build_script_local_fingerprints(
17141714 // longstanding bug, in Cargo. Recent refactorings just made it painfully
17151715 // obvious.
17161716 let pkg_root = unit. pkg . root ( ) . to_path_buf ( ) ;
1717- let target_dir = target_root ( build_runner) ;
1717+ let build_dir = build_root ( build_runner) ;
17181718 let env_config = Arc :: clone ( build_runner. bcx . gctx . env_config ( ) ?) ;
17191719 let calculate =
17201720 move |deps : & BuildDeps , pkg_fingerprint : Option < & dyn Fn ( ) -> CargoResult < String > > | {
@@ -1747,7 +1747,7 @@ fn build_script_local_fingerprints(
17471747 // them all here.
17481748 Ok ( Some ( local_fingerprints_deps (
17491749 deps,
1750- & target_dir ,
1750+ & build_dir ,
17511751 & pkg_root,
17521752 & env_config,
17531753 ) ) )
@@ -1783,7 +1783,7 @@ fn build_script_override_fingerprint(
17831783/// [`RunCustomBuild`]: crate::core::compiler::CompileMode::RunCustomBuild
17841784fn local_fingerprints_deps (
17851785 deps : & BuildDeps ,
1786- target_root : & Path ,
1786+ build_root : & Path ,
17871787 pkg_root : & Path ,
17881788 env_config : & Arc < HashMap < String , OsString > > ,
17891789) -> Vec < LocalFingerprint > {
@@ -1796,7 +1796,7 @@ fn local_fingerprints_deps(
17961796 // absolute prefixes from them.
17971797 let output = deps
17981798 . build_script_output
1799- . strip_prefix ( target_root )
1799+ . strip_prefix ( build_root )
18001800 . unwrap ( )
18011801 . to_path_buf ( ) ;
18021802 let paths = deps
@@ -1854,10 +1854,10 @@ pub fn dep_info_loc(build_runner: &mut BuildRunner<'_, '_>, unit: &Unit) -> Path
18541854 build_runner. files ( ) . fingerprint_file_path ( unit, "dep-" )
18551855}
18561856
1857- /// Returns an absolute path that target directory.
1857+ /// Returns an absolute path that build directory.
18581858/// All paths are rewritten to be relative to this.
1859- fn target_root ( build_runner : & BuildRunner < ' _ , ' _ > ) -> PathBuf {
1860- build_runner. bcx . ws . target_dir ( ) . into_path_unlocked ( )
1859+ fn build_root ( build_runner : & BuildRunner < ' _ , ' _ > ) -> PathBuf {
1860+ build_runner. bcx . ws . build_dir ( ) . into_path_unlocked ( )
18611861}
18621862
18631863/// Reads the value from the old fingerprint hash file and compare.
0 commit comments