<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/62710>62710</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Dependency to non-existent header via __has_include always triggers full rebuild in ninja
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
ingomueller-net
</td>
</tr>
</table>
<pre>
I am compiling LLVM with Ninja and Clang and noticed that basically all my builds are full builds. Upon investigating, I realized that basically all targets depend on `/usr/include/tbb/tbb.h`, which hasn't been present on my system. No file of LLVM depends on that file *directly*, however, many depend on `/usr/include/x86_64-linux-gnu/c++/12/bits/c++config.h`, which contains the following line:
```cpp
# define _GLIBCXX_USE_TBB_PAR_BACKEND __has_include(<tbb/tbb.h>)
```
If I remove that line or create an empty file at the location of the missing `tbb.h`, I get partial builds as expected.
One question is whether this is intended behavior or not. On the one hand side, I guess that partial builds should still work even if `__has_include` dependencies are not present. On the other hand side, it was said [in the Ninja mailing list](https://groups.google.com/g/ninja-build/c/O1UDnbMDbVs/m/pjlRL4nJBAAJ) that not reporting a dependency to a non-existing file would mean that a real dependency is missed once that file gets created.
Another one is where this should be reported/discussed/fixed.
Some more details about my set-up below. Let me know if I should report anything else.
- Debian clang version 14.0.6
- libstdc++-12-dev:amd64 version 12.2.0-14
- Ninja version 1.11.1
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyEVVGP2joT_TXmZZQocRIWHniApXzaftv2qr2t-oYce0imdexc24Hl_vorJ7ALqytdCYUkHnvOmXNmIrynxiCuWLVh1XYmhtBatyLT2G5ArdElBsOstuq8egLRgbRdT5pMA8_PPz7BiUILn8n8EiCMgkctTDPeGRtIooLQigC18CSF1mcQWkN3hnogrTwIh3AYtL48p_C9twbIHNEHakQg0zD-CE_gUGj6-9-PC8I1GDwo7NEosAbYPGN8N3jH-I6M1INCxnehrqdr2o4Bj3BqS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