Skip to content

Commit dd78d47

Browse files
committed
remove dirty tracking optimization for incremental build
1 parent 1a9e894 commit dd78d47

File tree

1 file changed

+2
-19
lines changed

1 file changed

+2
-19
lines changed

src/build.rs

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ use crate::build::compile::{mark_modules_with_deleted_deps_dirty, mark_modules_w
1212
use crate::helpers::emojis::*;
1313
use crate::helpers::{self, get_workspace_root};
1414
use crate::sourcedirs;
15-
use ahash::AHashSet;
1615
use anyhow::{anyhow, Result};
1716
use build_types::*;
1817
use console::style;
@@ -276,7 +275,7 @@ impl fmt::Display for IncrementalBuildError {
276275
pub fn incremental_build(
277276
build_state: &mut BuildState,
278277
default_timing: Option<Duration>,
279-
initial_build: bool,
278+
_initial_build: bool,
280279
show_progress: bool,
281280
only_incremental: bool,
282281
create_sourcedirs: bool,
@@ -350,17 +349,7 @@ pub fn incremental_build(
350349
);
351350
}
352351

353-
// track the compile dirty state, we reset it when the compile fails
354-
let mut tracked_dirty_modules = AHashSet::new();
355-
for (module_name, module) in build_state.modules.iter() {
356-
if module.compile_dirty {
357-
tracked_dirty_modules.insert(module_name.to_owned());
358-
}
359-
}
360-
if initial_build {
361-
// repair broken state
362-
mark_modules_with_expired_deps_dirty(build_state);
363-
}
352+
mark_modules_with_expired_deps_dirty(build_state);
364353
mark_modules_with_deleted_deps_dirty(build_state);
365354
current_step += 1;
366355

@@ -421,12 +410,6 @@ pub fn incremental_build(
421410
if helpers::contains_ascii_characters(&compile_errors) {
422411
println!("{}", &compile_errors);
423412
}
424-
// mark the original files as dirty again, because we didn't complete a full build
425-
for (module_name, module) in build_state.modules.iter_mut() {
426-
if tracked_dirty_modules.contains(module_name) {
427-
module.compile_dirty = true;
428-
}
429-
}
430413
Err(IncrementalBuildError::CompileError(None))
431414
} else {
432415
if show_progress {

0 commit comments

Comments
 (0)