From e63e88c791d6661f599d3292025bfc152ead0f47 Mon Sep 17 00:00:00 2001 From: David Rubin Date: Fri, 9 Oct 2026 16:55:26 -0500 Subject: [PATCH] Maker: properly add directories to watch list --- lib/compiler/Maker/Step.zig | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/compiler/Maker/Step.zig b/lib/compiler/Maker/Step.zig index 37212902592f2dfd5d2ea0d760b861d1e7fe03e2..58bf7c332447a2600e43284e68a6a642eda3586b 100644 --- a/lib/compiler/Maker/Step.zig +++ b/lib/compiler/Maker/Step.zig @@ -849,10 +849,16 @@ pub fn setWatchInputsFromManifestFiles( for (scf.files.keys()) |file_offset| { // The file path data is freed when the cache manifest is cleaned up at the end of `make`. const sub_path = try arena.dupe(u8, scf.path(file_offset)); - try addWatchInputFromPath(s, maker, .{ - .root_dir = prefixes[file_offset.get(scf.contents.items).flags.prefix], - .sub_path = Dir.path.dirname(sub_path) orelse "", - }, Dir.path.basename(sub_path)); + const file = file_offset.get(scf.contents.items); + const path: Path = .{ + .root_dir = prefixes[file.flags.prefix], + .sub_path = sub_path, + }; + if (file.flags.is_directory) { + try addDirectoryWatchInputFromPath(s, maker, path); + } else { + try addWatchInputPath(s, maker, path); + } } } -- 2.54.0