# reduce garbage for repeated \`zig cc \-\` calls · gitcafe/zig

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

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

Visibility: public

Requested revision: 400145ee3bb0740cc274a75b7c612d799811b5fe

Requested commit: 400145ee3bb0740cc274a75b7c612d799811b5fe

Commit: 400145ee3bb0740cc274a75b7c612d799811b5fe

Tree: 01a4303a0d32299630f8a876ecc4d8978f59f408

Author: Motiejus Jakštys

Committer: Andrew Kelley

## Message

```
reduce garbage for repeated `zig cc -` calls

Context: user provides `-` to read from stdin instead of a file.

Before: it would create a file in $ZIG_LOCAL_CACHE_DIR/tmp/ for each
invocation and leave it there.
After: it hashes the file contents and renames the file to the hash.

Result: repeated invocations of `zig cc` do not cause so much trash to
be created.

```

## Parents

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

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