Here is the docs op wants to contribute, yoinked from the pr, that mentioned the issue, that they linked.
The Build Graph
We previously mentioned that the Zig build system models the build process as a DAG.
We will now discuss how this graph is constructed.
The core of this graph is std.Build.Step.
Every Step has a name and a list of dependencies, which are other Steps.
These Steps and the dependencies between them form the build graph.
The most basic way to create a new step is via the std.Build.step method.
This method creates a new standalone Step, meaning that it does not depend on any other Steps, and no other Steps depend on it.
You can add this step as a dependency of another step via the dependent step’s std.Build.Step.dependOn method.
You can also use dependOn to add dependencies to this step.
The std.Build.step method is generic in the sense that it’s agnostic to the contents and purpose of the Step that it creates.
However, in many cases there are helper methods to create Steps for various purposes.
For instance, the std.Build.installArtifact method creates a std.Build.Step.InstallArtifact and adds its step as a dependency of the top-level “install” step.
This ensures that some artifact will be installed to zig-out when zig build install or zig build (since “install” is the default step) are run.
It’s also possible to use the std.Build.addInstallArtifact method to create an InstallArtifact step that isn’t tied to the top-level “install” step, which gives you the ability to install an artifact as part of some other build step.
Another helper method to be aware of is std.Build.addExecutable, which was shown in the previous section.
This helper method creates a std.Build.Step.Compile, which is one of the arguments required by the std.Build.installArtifact method.
This is why in examples you’ll frequently see both addExecutable and installArtifact.
This may give you the impression that “executable” and “artifact” are different kinds of entities that you need to know about in order to write your build.zig, but it really just boils down to Steps.