@@ -1121,28 +1121,28 @@ pub fn run_cargo(builder: &Builder, cargo: &mut Command, stamp: &Path, is_check:
1121
1121
CargoMessage :: CompilerArtifact { filenames, .. } => filenames,
1122
1122
_ => return ,
1123
1123
} ;
1124
- for filename in filenames {
1124
+ for filename in filenames. iter ( ) {
1125
1125
// Skip files like executables
1126
1126
if !filename. ends_with ( ".rlib" ) &&
1127
1127
!filename. ends_with ( ".lib" ) &&
1128
1128
!is_dylib ( & filename) &&
1129
1129
!( is_check && filename. ends_with ( ".rmeta" ) ) {
1130
- return ;
1130
+ break ;
1131
1131
}
1132
1132
1133
- let filename = Path :: new ( & * filename) ;
1133
+ let filename = Path :: new ( & * * filename) ;
1134
1134
1135
1135
// If this was an output file in the "host dir" we don't actually
1136
1136
// worry about it, it's not relevant for us.
1137
1137
if filename. starts_with ( & host_root_dir) {
1138
- return ;
1138
+ break ;
1139
1139
}
1140
1140
1141
1141
// If this was output in the `deps` dir then this is a precise file
1142
1142
// name (hash included) so we start tracking it.
1143
1143
if filename. starts_with ( & target_deps_dir) {
1144
1144
deps. push ( filename. to_path_buf ( ) ) ;
1145
- return ;
1145
+ break ;
1146
1146
}
1147
1147
1148
1148
// Otherwise this was a "top level artifact" which right now doesn't
@@ -1163,6 +1163,33 @@ pub fn run_cargo(builder: &Builder, cargo: &mut Command, stamp: &Path, is_check:
1163
1163
1164
1164
toplevel. push ( ( file_stem, extension, expected_len) ) ;
1165
1165
}
1166
+ for filename in filenames {
1167
+ // Skip files like executables
1168
+ if !filename. ends_with ( ".rlib" ) &&
1169
+ !filename. ends_with ( ".lib" ) &&
1170
+ !is_dylib ( & filename) &&
1171
+ !( is_check && filename. ends_with ( ".rmeta" ) ) {
1172
+ break ;
1173
+ }
1174
+
1175
+ let filename = Path :: new ( & * filename) ;
1176
+
1177
+ // If this was an output file in the "host dir" we don't actually
1178
+ // worry about it, it's not relevant for us.
1179
+ if filename. starts_with ( & host_root_dir) {
1180
+ let f = filename. file_name ( ) ;
1181
+ if deps. iter ( ) . find ( |v| v. file_name ( ) == f) . is_none ( ) {
1182
+ deps. push ( filename. to_path_buf ( ) ) ;
1183
+ }
1184
+ continue ;
1185
+ }
1186
+
1187
+ // If this was output in the `deps` dir then this is a precise file
1188
+ // name (hash included) so we start tracking it.
1189
+ if filename. starts_with ( & target_deps_dir) {
1190
+ break ;
1191
+ }
1192
+ }
1166
1193
} ) ;
1167
1194
1168
1195
if !ok {
0 commit comments