Reuse valid checkpoints across auxiliary file changes

This commit is contained in:
gloamxun committed 2026-11-20 15:17:28 +08:00
1 parent 3a3913a385
commit e4a265ca6c
5 files changed
+233 -111

No files matched your search

+8 -19
View File
@@ -934,31 +934,20 @@ impl CompileJob {
.filter(|_| checkpoint_guard::can_stage(&request));
let format_cache = &self.compiler.format_cache;
let mut entry_checkpoint_work = EntryCheckpointWork::default();
let mut active_checkpoint =
checkpoints
.and_then(CheckpointCache::current)
.and_then(|available| match available.select(&request) {
Ok(selected) => Some(selected),
Err(error) => {
entry_checkpoint_work.rejection = Some(error);
None
}
});
let prepared = match active_checkpoint.as_ref() {
Some(candidate) => {
match candidate.prepare(&request, format_cache, &cancellation, evidence) {
Ok(prepared) => Some(prepared),
let (active_checkpoint, prepared) =
if let Some(available) = checkpoints.and_then(CheckpointCache::current) {
match available.prepare(&request, format_cache, &cancellation, evidence) {
Ok((selected, prepared)) => (Some(selected), Some(prepared)),
Err(error) => {
check(&cancellation)?;
*evidence = AttemptEvidence::new(revision);
entry_checkpoint_work.rejection = Some(error.to_string());
active_checkpoint = None;
None
(None, None)
}
}
}
None => None,
};
} else {
(None, None)
};
let PreparedJob {
executor,
format_preparation,