Skip to content

Commit 8542dfd

Browse files
authored
remove dirty tracking optimization for incremental build (#148)
1 parent 0882238 commit 8542dfd

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;
@@ -283,7 +282,7 @@ impl fmt::Display for IncrementalBuildError {
283282
pub fn incremental_build(
284283
build_state: &mut BuildState,
285284
default_timing: Option<Duration>,
286-
initial_build: bool,
285+
_initial_build: bool,
287286
show_progress: bool,
288287
only_incremental: bool,
289288
create_sourcedirs: bool,
@@ -357,17 +356,7 @@ pub fn incremental_build(
357356
);
358357
}
359358

360-
// track the compile dirty state, we reset it when the compile fails
361-
let mut tracked_dirty_modules = AHashSet::new();
362-
for (module_name, module) in build_state.modules.iter() {
363-
if module.compile_dirty {
364-
tracked_dirty_modules.insert(module_name.to_owned());
365-
}
366-
}
367-
if initial_build {
368-
// repair broken state
369-
mark_modules_with_expired_deps_dirty(build_state);
370-
}
359+
mark_modules_with_expired_deps_dirty(build_state);
371360
mark_modules_with_deleted_deps_dirty(build_state);
372361
current_step += 1;
373362

@@ -428,12 +417,6 @@ pub fn incremental_build(
428417
if helpers::contains_ascii_characters(&compile_errors) {
429418
println!("{}", &compile_errors);
430419
}
431-
// mark the original files as dirty again, because we didn't complete a full build
432-
for (module_name, module) in build_state.modules.iter_mut() {
433-
if tracked_dirty_modules.contains(module_name) {
434-
module.compile_dirty = true;
435-
}
436-
}
437420
Err(IncrementalBuildError::CompileError(None))
438421
} else {
439422
if show_progress {

0 commit comments

Comments
 (0)