# Compilation: don't warn about failure to delete missing C depfile · gitcafe/zig

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

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

Visibility: public

Requested revision: 7199cfc21fa8c278d568b268a129c2a4410fec78

Requested commit: 7199cfc21fa8c278d568b268a129c2a4410fec78

Commit: 7199cfc21fa8c278d568b268a129c2a4410fec78

Tree: 3428fc0bdbe0b019672d827a6f4af4f8ebc033c8

Author: mlugg

Committer: Alex Rønne Petersen

## Message

````
Compilation: don't warn about failure to delete missing C depfile

If clang encountered bad imports, the depfile will not be generated. It
doesn't make sense to warn the user in this case. In fact,
`FileNotFound` is never worth warning about here; it just means that
the file we were deleting to save space isn't there in the first place!
If the missing file actually affected the compilation (e.g. another
process raced to delete it for some reason) we would already error in
the normal code path which reads these files, so we can safely omit the
warning in the `FileNotFound` case always, only warning when the file
might still exist.

To see what this fixes, create the following file...

```c
#include <nonexist>
```

...and run `zig build-obj` on it. Before this commit, you will get a
redundant warning; after this commit, that warning is gone.

````

## Parents

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

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