fix: CRITICAL — repo_builder no longer skips publishing in cross-target mode

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/<target>/ 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/<target>/<pkg>.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().
This commit is contained in:
2026-07-12 20:00:39 +03:00
parent ea1ea51c3b
commit 34d9d28d9e
+5 -4
View File
@@ -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.