From fa0ac655f642c8ea0a26be414d47aedb7f4b57d3 Mon Sep 17 00:00:00 2001 From: David Abram Date: Sat, 10 Oct 2026 23:08:00 +0200 Subject: [PATCH 1/2] fix(build): avoid tracking generated OUT_DIR inputs --- cli/build.rs | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/cli/build.rs b/cli/build.rs index afe0da848..54ba9e371 100644 --- a/cli/build.rs +++ b/cli/build.rs @@ -187,7 +187,7 @@ fn stage_generated_input( let output_root = out_dir.join(PKL_OUTPUT_DIR); remove_path_if_exists(&output_root)?; - copy_tree(&generated_input_root.join(PKL_OUTPUT_DIR), &output_root)?; + copy_tree(&generated_input_root.join(PKL_OUTPUT_DIR), &output_root, true)?; Ok(()) } @@ -257,7 +257,7 @@ fn stage_packaged_fallback(manifest_dir: &Path, out_dir: &Path) -> io::Result<() let source = fallback_root.join(directory); let destination = out_dir.join(directory); remove_path_if_exists(&destination)?; - copy_tree(&source, &destination)?; + copy_tree(&source, &destination, true)?; } Ok(()) @@ -342,14 +342,17 @@ fn stage_static_inputs( copy_tree( &manifest_dir.join("assets/hooks"), &static_root.join("hooks"), + true, )?; copy_tree( &manifest_dir.join(MIGRATIONS_ROOT), &static_root.join(MIGRATIONS_ROOT), + true, )?; copy_file( &repository_root.join("config/schema/agent-trace.schema.json"), &static_root.join("schema/agent-trace.schema.json"), + true, ) } @@ -366,33 +369,39 @@ fn stage_codex_target(out_dir: &Path) -> io::Result<()> { copy_tree( &pkl_output_root.join(CODEX_AGENTS_SOURCE_DIR), &destination_root.join(".agents"), + false, )?; copy_tree( &pkl_output_root.join(CODEX_HOOKS_SOURCE_DIR), &destination_root.join(".codex"), + false, ) } -fn copy_tree(source_root: &Path, destination_root: &Path) -> io::Result<()> { - println!("cargo:rerun-if-changed={}", source_root.display()); +fn copy_tree(source_root: &Path, destination_root: &Path, track_sources: bool) -> io::Result<()> { + if track_sources { + println!("cargo:rerun-if-changed={}", source_root.display()); + } let mut files = Vec::new(); collect_files(source_root, source_root, &mut files)?; files.sort_unstable_by(|left, right| left.relative_path.cmp(&right.relative_path)); for file in files { - println!("cargo:rerun-if-changed={}", file.absolute_path.display()); copy_file( &file.absolute_path, &destination_root.join(&file.relative_path), + track_sources, )?; } Ok(()) } -fn copy_file(source: &Path, destination: &Path) -> io::Result<()> { - println!("cargo:rerun-if-changed={}", source.display()); +fn copy_file(source: &Path, destination: &Path, track_source: bool) -> io::Result<()> { + if track_source { + println!("cargo:rerun-if-changed={}", source.display()); + } let parent = destination .parent() .ok_or_else(|| invalid_data(&"staged file must have a parent directory"))?; From 3ca25cef32ddbedff35b9e8f4a68d1cb796e0e7c Mon Sep 17 00:00:00 2001 From: David Abram Date: Sat, 10 Oct 2026 23:46:08 +0200 Subject: [PATCH 2/2] style(build): apply rustfmt to generated-input staging --- cli/build.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cli/build.rs b/cli/build.rs index 54ba9e371..1082ed3bc 100644 --- a/cli/build.rs +++ b/cli/build.rs @@ -187,7 +187,11 @@ fn stage_generated_input( let output_root = out_dir.join(PKL_OUTPUT_DIR); remove_path_if_exists(&output_root)?; - copy_tree(&generated_input_root.join(PKL_OUTPUT_DIR), &output_root, true)?; + copy_tree( + &generated_input_root.join(PKL_OUTPUT_DIR), + &output_root, + true, + )?; Ok(()) }