# stage2: fix CLI not populating output binary files · gitcafe/zig

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

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

Visibility: public

Requested revision: d6c5602d4665ba4e9e7c0b7f42bd00b2489d420c

Requested commit: d6c5602d4665ba4e9e7c0b7f42bd00b2489d420c

Commit: d6c5602d4665ba4e9e7c0b7f42bd00b2489d420c

Tree: c234262f9c98e834ed470fd5fddf18c04cad94d2

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
stage2: fix CLI not populating output binary files

This fixes a regression in this branch that can be reproduced with the
following steps:

1. `zig build-exe hello.zig`
2. delete the "hello" binary
3. `zig build-exe hello.zig`
4. observe that the "hello" binary is missing

This happened because it was a cache hit, but nothing got copied to the
output directory.

This commit sets CacheMode to incremental - even for stage1 - when the
CLI requests `disable_lld_caching` (this option should be renamed),
resulting in the main Compilation to be repeated (uncached) for stage1,
populating the binary into the cwd as expected.

For stage2 the result is even better: the incremental compilation system
will look for build artifacts to incrementally compile, and start fresh
if not found.

```

## Parents

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

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