Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make zig build --watch detect modifications to the build script and rerun itself #20602

Open
andrewrk opened this issue Jul 13, 2024 · 0 comments · May be fixed by #20836
Open

make zig build --watch detect modifications to the build script and rerun itself #20602

andrewrk opened this issue Jul 13, 2024 · 0 comments · May be fixed by #20836
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

Comments

@andrewrk
Copy link
Member

andrewrk commented Jul 13, 2024

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 the build.zig script itself and any files it depends on, the build runner itself recompiled and rerun in response to any edits.

Related:

@andrewrk andrewrk added 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 labels Jul 13, 2024
@andrewrk andrewrk added this to the 0.14.0 milestone Jul 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant