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