Skip to content

Commit 7ddc081

Browse files
committed
Reuse staged ACP runtime in dev builds
1 parent cf0df96 commit 7ddc081

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

apps/desktop/src-tauri/build.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,28 @@ fn resolve_runtime_source(
642642
}
643643
}
644644

645+
// In dev we prefer the staged/local runtime so frontend-only edits do not
646+
// trigger a full rebuild of the embedded ACP on every desktop restart.
647+
if cargo_profile() != "release" {
648+
if destination.exists() {
649+
println!(
650+
"cargo:warning=Reusing staged {} runtime at {} for dev build.",
651+
spec.label,
652+
destination.display()
653+
);
654+
return Some(destination.to_path_buf());
655+
}
656+
657+
if let Some(source) = candidates.iter().find(|path| path.exists()) {
658+
println!(
659+
"cargo:warning=Reusing existing {} runtime at {} for dev build.",
660+
spec.label,
661+
source.display()
662+
);
663+
return Some(source.clone());
664+
}
665+
}
666+
645667
if spec.label == "codex" {
646668
match build_vendor_runtime(manifest_dir, spec) {
647669
Ok(Some(source)) => return Some(source),

0 commit comments

Comments
 (0)