From 7cc26907173f880fcce0e40635d1ed364ccb5a5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?m=C3=BCde?= Date: Sun, 31 May 2026 20:53:35 +0200 Subject: [PATCH] hive-c0re: pass build_logs the parent dir, not the broker.sqlite file Every other Coordinator opener takes the broker.sqlite path and derives its parent internally; BuildLogs alone wants a directory. Passing the file path tripped create_dir_all on an existing file (File exists os error 17) and blocked c0re boot. --- hive-c0re/src/build_logs.rs | 8 ++++---- hive-c0re/src/coordinator.rs | 7 ++++++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/hive-c0re/src/build_logs.rs b/hive-c0re/src/build_logs.rs index ed2c7f6f..79d45c88 100644 --- a/hive-c0re/src/build_logs.rs +++ b/hive-c0re/src/build_logs.rs @@ -131,10 +131,10 @@ pub struct BuildLogs { } impl BuildLogs { - pub fn open(db_path: &Path) -> Result { - std::fs::create_dir_all(db_path) - .with_context(|| format!("create build_logs db parent {}", db_path.display()))?; - let path = db_path.join("build_logs.sqlite"); + pub fn open(db_dir: &Path) -> Result { + std::fs::create_dir_all(db_dir) + .with_context(|| format!("create build_logs db parent {}", db_dir.display()))?; + let path = db_dir.join("build_logs.sqlite"); let conn = Connection::open(&path) .with_context(|| format!("open build_logs db {}", path.display()))?; conn.execute_batch(SCHEMA) diff --git a/hive-c0re/src/coordinator.rs b/hive-c0re/src/coordinator.rs index 971cdd85..285edc90 100644 --- a/hive-c0re/src/coordinator.rs +++ b/hive-c0re/src/coordinator.rs @@ -220,8 +220,13 @@ impl Coordinator { let questions = OperatorQuestions::open(db_path).context("open operator_questions")?; let scheduled_prompts = crate::scheduled_prompts::ScheduledPrompts::open(db_path) .context("open scheduled_prompts")?; + // BuildLogs wants a directory (it picks its own `build_logs.sqlite` + // file under it); every other opener here takes the sibling + // sqlite-file path itself. Derive the dir from `db_path`'s + // parent so the two shapes line up. + let build_logs_dir = db_path.parent().unwrap_or_else(|| Path::new(".")); let build_logs = Arc::new( - crate::build_logs::BuildLogs::open(db_path).context("open build_logs")?, + crate::build_logs::BuildLogs::open(build_logs_dir).context("open build_logs")?, ); // Install the process-wide handle so `lifecycle::run` / // `lifecycle::prebuild_toplevel` can write without us having