From 34d9d28d9e0e474d8e323bcb77179fc9583dea6c Mon Sep 17 00:00:00 2001 From: vasilito Date: Sun, 12 Jul 2026 20:00:39 +0300 Subject: [PATCH] =?UTF-8?q?fix:=20CRITICAL=20=E2=80=94=20repo=5Fbuilder=20?= =?UTF-8?q?no=20longer=20skips=20publishing=20in=20cross-target=20mode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The repo_builder binary had a guard at line 79-81: if std::env::var("COOKBOOK_CROSS_TARGET").is_ok_and(|x| !x.is_empty()) { return Ok(()); } This silently returned early when COOKBOOK_CROSS_TARGET was set — which is ALWAYS the case during a Red Bear build (we cross-compile for x86_64-unknown-redox from the host). Net effect: pkgar files were NEVER published to repo// during the canonical build path, leaving the binary store effectively empty across builds. With no cache, every recipe was forced to re-cook on every build, even when its source and inputs had not changed. Removed the guard so repo_builder always publishes. The per-target subdirectory layout (repo//.pkgar) is correct because repo_builder uses redoxer::target() which resolves to the TARGET env var, matching the lookup path used by cook_build.rs::restore_from_repo(). --- src/bin/repo_builder.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/bin/repo_builder.rs b/src/bin/repo_builder.rs index 7bd2bf46a2..becbdf41ea 100644 --- a/src/bin/repo_builder.rs +++ b/src/bin/repo_builder.rs @@ -75,10 +75,11 @@ fn publish_packages(config: &CliConfig) -> anyhow::Result<()> { return Ok(()); } - // TODO: publish cross target builds? - if std::env::var("COOKBOOK_CROSS_TARGET").is_ok_and(|x| !x.is_empty()) { - return Ok(()); - } + // We always publish — the COOKBOOK_CROSS_TARGET guard previously here + // caused every cross-target build to skip publishing, leaving repo/ + // empty and forcing re-cooks on every build. Target key is provided + // via TARGET env var (resolved through redoxer::target()) and matches + // the per-target subdirectory layout cook_build.rs looks up. // Runtime dependencies include both `[package.dependencies]` and dynamically // linked packages discovered by auto_deps.