From aa9a654ef6ff736377f09afd8e4ffdd4c8c64038 Mon Sep 17 00:00:00 2001 From: Wildan M Date: Tue, 3 Feb 2026 17:42:26 +0700 Subject: [PATCH] Fix build failure due to changing clean target flag --- src/cook/cook_build.rs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/cook/cook_build.rs b/src/cook/cook_build.rs index e6fdf524d..8bc86f6c5 100644 --- a/src/cook/cook_build.rs +++ b/src/cook/cook_build.rs @@ -222,12 +222,19 @@ pub fn build( }; } - if !check_source && stage_pkgars.iter().all(|file| file.is_file()) { - if cli_verbose { - log_to_pty!(logger, "DEBUG: using cached build, not checking source"); + if !check_source { + let stage_present = if cook_config.clean_target { + stage_pkgars.iter().all(|file| file.is_file()) + } else { + stage_dirs.iter().all(|file| file.is_dir()) + }; + if stage_present { + if cli_verbose { + log_to_pty!(logger, "DEBUG: using cached build, not checking source"); + } + let auto_deps = make_auto_deps!()?; + return Ok((stage_dirs, auto_deps)); } - let auto_deps = make_auto_deps!()?; - return Ok((stage_dirs, auto_deps)); } let mut source_modified = modified_dir_ignore_git(source_dir).unwrap_or(SystemTime::UNIX_EPOCH);