authorgravatar for david@vortan.devDavid Rubin <david@vortan.dev> 2026-10-09 16:55:26-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-10-10 19:04:45+02:00
log712055f32444d8ba74650591d82524130be7dfd1
tree5c98c1c65f93fb60bc7d73768073e9cb7649cbeb
parent3626a240e43d4e40cda191a4e780a94c4ec601bc

Maker: properly add directories to watch list


1 files changed, 10 insertions(+), 4 deletions(-)

lib/compiler/Maker/Step.zig+10-4
......@@ -849,10 +849,16 @@ pub fn setWatchInputsFromManifestFiles(
849849 for (scf.files.keys()) |file_offset| {
850850 // The file path data is freed when the cache manifest is cleaned up at the end of `make`.
851851 const sub_path = try arena.dupe(u8, scf.path(file_offset));
852 try addWatchInputFromPath(s, maker, .{
853 .root_dir = prefixes[file_offset.get(scf.contents.items).flags.prefix],
854 .sub_path = Dir.path.dirname(sub_path) orelse "",
855 }, Dir.path.basename(sub_path));
852 const file = file_offset.get(scf.contents.items);
853 const path: Path = .{
854 .root_dir = prefixes[file.flags.prefix],
855 .sub_path = sub_path,
856 };
857 if (file.flags.is_directory) {
858 try addDirectoryWatchInputFromPath(s, maker, path);
859 } else {
860 try addWatchInputPath(s, maker, path);
861 }
856862 }
857863}
858864