fix: cookbook cache invalidation — use max(recipe, source) timestamps
Bug: src/cook/cook_build.rs:268 only bumps source_modified when recipe.toml is STRICTLY newer than source. In normal workflow: 1. Recipe edited at T1 (adds patch to patches array) 2. Source re-fetched at T2 > T1 (during make r.<recipe>) 3. Build caches stage at T3 4. Next build: recipe(T1) > source(T2) = FALSE → edit ignored Fix: source_modified = source_modified.max(recipe_modified); always considers recipe timestamp regardless of relative ordering. Root cause of kernel rebrand not taking effect was ALSO a missing .git/HEAD in the source tree (cookbook skips patches for release archives). Re-fetch with 'repo --allow-protected fetch kernel' restored the git repo and enabled patch application. Verified: 'RedBear OS starting...' appears in QEMU boot log.
This commit is contained in:
@@ -265,9 +265,7 @@ pub fn build(
|
||||
|
||||
let mut source_modified = modified_dir_ignore_git(source_dir).unwrap_or(SystemTime::UNIX_EPOCH);
|
||||
if let Ok(recipe_modified) = modified(&recipe_dir.join("recipe.toml")) {
|
||||
if recipe_modified > source_modified {
|
||||
source_modified = recipe_modified
|
||||
}
|
||||
source_modified = source_modified.max(recipe_modified);
|
||||
}
|
||||
|
||||
let deps_modified = modified_all_btree(
|
||||
|
||||
Reference in New Issue
Block a user