make zig build --watch
detect modifications to the build script and rerun itself
#20602
Labels
enhancement
Solving this issue will likely involve adding new logic or components to the codebase.
zig build system
std.Build, the build runner, `zig build` subcommand, package management
Milestone
Extracted from #20580.
The build runner already communicates with its parent process, for example when encountering an unfulfilled lazy dependency, it writes that information to a special file, and then exits, relying on the
zig build
process to rerun the build runner after fetching those needed dependencies.Side note: that special file is currently communicated as a temp file, but that could be better done with a pipe instead, similar to how the new
std.Progress
implementation works.This issue is to further enhance this relationship to also have the build runner request its own file system inputs from the parent process, so that it can incorporate those when polling on file system changes. When it encounters those files being changed, it would signal to the parent process that it wants to be rerun, and then exit.
As a result, it means that
zig build --watch
becomes enhanced to also watch thebuild.zig
script itself and any files it depends on, the build runner itself recompiled and rerun in response to any edits.Related:
The text was updated successfully, but these errors were encountered: