fix(build): re-run logos-delivery build script when the native lib appears

This commit is contained in:
Mojtaba Chenani
2026-08-04 20:22:43 +02:00
parent 71d3217e64
commit d85b7dae80
2 changed files with 17 additions and 2 deletions
+8
View File
@@ -94,6 +94,11 @@ fn resolve_lib_dir(dir: &str) -> Option<PathBuf> {
let manifest = std::env::var("CARGO_MANIFEST_DIR").ok()?;
Path::new(&find_flake_root(&manifest)?).join(path)
};
// Re-run once the lib appears, so build order (nix build vs. cargo) is free.
println!("cargo:rerun-if-changed={}", anchored.display());
if let Some(parent) = anchored.parent() {
println!("cargo:rerun-if-changed={}", parent.display());
}
anchored.canonicalize().ok()
}
@@ -149,8 +154,11 @@ fn nix_build_logos_delivery() -> Option<String> {
println!("cargo:rerun-if-changed={flake_root}/flake.lock");
// Enable flakes inline so the fallback works without global nix.conf setup.
let output = Command::new("nix")
.args([
"--extra-experimental-features",
"nix-command flakes",
"build",
".#logos-delivery",
"--no-link",