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

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

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

Visibility: public

Requested revision: 787020b30b68d665cd08824d05ce5c7e459eccd1

Requested commit: 787020b30b68d665cd08824d05ce5c7e459eccd1

Commit: 787020b30b68d665cd08824d05ce5c7e459eccd1

Tree: 7083cf9378b05b9e79d35f17a6c195733b997fb6

Author: mlugg

Committer: Matthew Lugg

## 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

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

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