Skip to content

remove dirty tracking optimization for incremental build #148

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 2 additions & 19 deletions src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ use crate::build::compile::{mark_modules_with_deleted_deps_dirty, mark_modules_w
use crate::helpers::emojis::*;
use crate::helpers::{self, get_workspace_root};
use crate::sourcedirs;
use ahash::AHashSet;
use anyhow::{anyhow, Result};
use build_types::*;
use console::style;
Expand Down Expand Up @@ -275,7 +274,7 @@ impl fmt::Display for IncrementalBuildError {
pub fn incremental_build(
build_state: &mut BuildState,
default_timing: Option<Duration>,
initial_build: bool,
_initial_build: bool,
show_progress: bool,
only_incremental: bool,
create_sourcedirs: bool,
Expand Down Expand Up @@ -349,17 +348,7 @@ pub fn incremental_build(
);
}

// track the compile dirty state, we reset it when the compile fails
let mut tracked_dirty_modules = AHashSet::new();
for (module_name, module) in build_state.modules.iter() {
if module.compile_dirty {
tracked_dirty_modules.insert(module_name.to_owned());
}
}
if initial_build {
// repair broken state
mark_modules_with_expired_deps_dirty(build_state);
}
mark_modules_with_expired_deps_dirty(build_state);
mark_modules_with_deleted_deps_dirty(build_state);
current_step += 1;

Expand Down Expand Up @@ -418,12 +407,6 @@ pub fn incremental_build(
);
}
log::error!("{}", &compile_errors);
// mark the original files as dirty again, because we didn't complete a full build
for (module_name, module) in build_state.modules.iter_mut() {
if tracked_dirty_modules.contains(module_name) {
module.compile_dirty = true;
}
}
Err(IncrementalBuildError::CompileError(None))
} else {
if show_progress {
Expand Down
Loading