-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Labels
enhancementSolving this issue will likely involve adding new logic or components to the codebase.Solving this issue will likely involve adding new logic or components to the codebase.zig build systemstd.Build, the build runner, `zig build` subcommand, package managementstd.Build, the build runner, `zig build` subcommand, package management
Milestone
Description
Extracted from #20580.
When the build system spawns a child process via a Run step, unless opted out, give it an environment variable that communicates a file descriptor which is a pipe. For example, ZIG_BUILD=4. This file descriptor is an open pipe so that the application can speak the zig build system protocol, which will be available in the Zig standard library for convenience.
This will enable the following use cases:
- The application could learn when has been rebuilt, and restart gracefully.
- The application could learn when a hot code swap (hot code swapping #68) is available, and then request it at an opportune moment, such as between game frames or web server requests.
- The application could be notified that certain assets have been freshly built, and reload them. For example, perhaps the application is a web server, and the static html file asset changes. It could send a message to connected clients telling them to reload the page. This makes
--watchextend into arbitrary environments, with a little bit of cooperation from application developers.
Of course, applications are free to simply ignore this open pipe as well, just like they can ignore stdin, stdout, or stderr.
00JCIV00, jecolon, sfiedler0, jayrod246, silver-signal and 14 moreAndrewKraevskii, jayrod246, mnemnion, silver-signal, RanPix and 2 morevytskalt
Metadata
Metadata
Assignees
Labels
enhancementSolving this issue will likely involve adding new logic or components to the codebase.Solving this issue will likely involve adding new logic or components to the codebase.zig build systemstd.Build, the build runner, `zig build` subcommand, package managementstd.Build, the build runner, `zig build` subcommand, package management