diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2024-07-08 23:42:20 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2024-07-12 00:14:07 -0700 |
| commit | bbd90a562efd6e802ed41df2649a05fad763a4de (patch) | |
| tree | c5276879ad6ade65af80393019ac649f9e6c1734 /lib/std/Build/Step/InstallFile.zig | |
| parent | deea36250ffe458d92b32b1ad090b8a958ba8082 (diff) | |
| download | zig-bbd90a562efd6e802ed41df2649a05fad763a4de.tar.gz zig-bbd90a562efd6e802ed41df2649a05fad763a4de.zip | |
build runner: implement --watch (work-in-progress)
I'm still learning how the fanotify API works but I think after playing
with it in this commit, I finally know how to implement it, at least on
Linux. This commit does not accomplish the goal but I want to take the
code in a different direction and still be able to reference this point
in time by viewing a source control diff.
I think the move is going to be saving the file_handle for the parent
directory, which combined with the dirent names is how we can correlate
the events back to the Step instances that have registered file system
inputs. I predict this to be similar to implementations on other
operating systems.
Diffstat (limited to 'lib/std/Build/Step/InstallFile.zig')
| -rw-r--r-- | lib/std/Build/Step/InstallFile.zig | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/std/Build/Step/InstallFile.zig b/lib/std/Build/Step/InstallFile.zig index dd6aa2d1c4..f68e6e8aa0 100644 --- a/lib/std/Build/Step/InstallFile.zig +++ b/lib/std/Build/Step/InstallFile.zig @@ -39,7 +39,10 @@ fn make(step: *Step, prog_node: std.Progress.Node) !void { _ = prog_node; const b = step.owner; const install_file: *InstallFile = @fieldParentPtr("step", step); - step.addWatchInput(install_file.source); + + // Inputs never change when re-running `make`. + if (!step.inputs.populated()) step.addWatchInput(install_file.source); + const full_src_path = install_file.source.getPath2(b, step); const full_dest_path = b.getInstallPath(install_file.dir, install_file.dest_rel_path); const cwd = std.fs.cwd(); |
