@@ -1254,20 +1254,24 @@ fn calculate(cx: &mut Context<'_, '_>, unit: &Unit) -> CargoResult<Arc<Fingerpri
12541254/// Calculate a fingerprint for a "normal" unit, or anything that's not a build
12551255/// script. This is an internal helper of `calculate`, don't call directly.
12561256fn calculate_normal ( cx : & mut Context < ' _ , ' _ > , unit : & Unit ) -> CargoResult < Fingerprint > {
1257- // Recursively calculate the fingerprint for all of our dependencies.
1258- //
1259- // Skip fingerprints of binaries because they don't actually induce a
1260- // recompile, they're just dependencies in the sense that they need to be
1261- // built.
1262- //
1263- // Create Vec since mutable cx is needed in closure.
1264- let deps = Vec :: from ( cx. unit_deps ( unit) ) ;
1265- let mut deps = deps
1266- . into_iter ( )
1267- . filter ( |dep| !dep. unit . target . is_bin ( ) )
1268- . map ( |dep| DepFingerprint :: new ( cx, unit, & dep) )
1269- . collect :: < CargoResult < Vec < _ > > > ( ) ?;
1270- deps. sort_by ( |a, b| a. pkg_id . cmp ( & b. pkg_id ) ) ;
1257+ let deps = {
1258+ // Recursively calculate the fingerprint for all of our dependencies.
1259+ //
1260+ // Skip fingerprints of binaries because they don't actually induce a
1261+ // recompile, they're just dependencies in the sense that they need to be
1262+ // built. The only exception here are artifact dependencies,
1263+ // which is an actual dependency that needs a recompile.
1264+ //
1265+ // Create Vec since mutable cx is needed in closure.
1266+ let deps = Vec :: from ( cx. unit_deps ( unit) ) ;
1267+ let mut deps = deps
1268+ . into_iter ( )
1269+ . filter ( |dep| !dep. unit . target . is_bin ( ) || dep. unit . artifact . is_true ( ) )
1270+ . map ( |dep| DepFingerprint :: new ( cx, unit, & dep) )
1271+ . collect :: < CargoResult < Vec < _ > > > ( ) ?;
1272+ deps. sort_by ( |a, b| a. pkg_id . cmp ( & b. pkg_id ) ) ;
1273+ deps
1274+ } ;
12711275
12721276 // Afterwards calculate our own fingerprint information.
12731277 let target_root = target_root ( cx) ;
0 commit comments