# stage2: implement zig build · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/c2b1cd7c456e274c7ead96e597d147e2df7d317e)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: c2b1cd7c456e274c7ead96e597d147e2df7d317e

Requested commit: c2b1cd7c456e274c7ead96e597d147e2df7d317e

Commit: c2b1cd7c456e274c7ead96e597d147e2df7d317e

Tree: bf924cc095e8bb77dfee6484d6bdc2fb0f7aa2e3

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
stage2: implement zig build

As part of this:

 * add std.process.cleanExit. closes #6395
   - use it in several places
 * adjust the alignment of text in `zig build --help` menu
 * Cache: support the concept of "unhit" so that we properly keep track
   of the cache when we find out using the secondary hash that the cache
   "hit" was actually a miss. Use this to fix false negatives of caching
   of stage1 build artifacts.
 * fix not deleting the symlink hash for stage1 build artifacts causing
   false positives.
 * implement support for Package arguments in stage1 build artifacts
 * update and add missing usage text
 * add --override-lib-dir and --enable-cache CLI options
   - `--enable-cache` takes the place of `--cache on`
 * CLI supports -femit-bin=foo combined with --enable-cache to do an
   "update file" operation. --enable-cache without that argument
   will build the output into a cache directory and then print the path
   to stdout (matching master branch behavior).
 * errors surfacing from main() now print "error: Foo" instead of
   "error: error.Foo".

```

## Parents

- [250664bea41cc5dde66e3054ca0c1b6e0feab9be](https://git.cafe/gitcafe/zig/commit/250664bea41cc5dde66e3054ca0c1b6e0feab9be?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/c2b1cd7c456e274c7ead96e597d147e2df7d317e?format=markdown)
