<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/134780>134780</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[libc][bazel] Add support for generating headers in Bazel
</td>
</tr>
<tr>
<th>Labels</th>
<td>
libc,
bazel
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
vonosmas
</td>
</tr>
</table>
<pre>
Currently, there's no supported way to invoke hdrgen tool from Bazel build. In order to support generating headers in Bazel build we need to:
- [ ] Add integration with [pyyaml](https://github.com/yaml/pyyaml) to Bazel build. Otherwise, Bazel-build libc:hdrgen py_binary can't run, since it fails in "import yaml" statement.
- [ ] Add `libc_generated_header` macro to wrap genrule that would invoke hdrgen tool to generate public libc header from YAML file.
- [ ] Use `libc_generated_header` for some of the common headers important for downstream users.
- [ ] Add support for running header tests: libc/test/include has a lot of unit tests, which are not ported to Bazel currently.
- [ ] (optional) add a convenient way to group generated headers, expose them together, and let llvm-libc users depend on them, similar to how `libc_release_library` is used to expose a subset of llvm-libc functions.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJx8VE2PszYQ_jXmMtoIHNgkBw67G0Wq1KqnHnpaGTyAW-NB9jg0_fWVHbLb1ftqpUgR4MfzfNkqBDM6xFY0r6I5FyryRL69kqMwq1B0pG_tW_QeHdubkG_AE3oU8hDAEYS4LOQZNazqBkxg3JX-Rpi0H9EBE1kYPM3wqv5FC100Vu_gFwfkNfoE2HaAER16xcaNMKHS6AMY938YrAgOUQOT2L-IMv2eQDSvIJozvGgNxjGOaQ9ysBqe0sfldlOzFc1ZyOPEvISElRchL6PhKXa7nmYhL3mRvGyr5Skx-0L59yR7NQGTBfnL052VNV0v9i-b4OX23hmn_A165YQ8MPjoEiQY1yMYhkEZm6UJKc2cpd9nSgisGGd0vPtBmngu06D3zSXU73eTxHMJs-o9JcKrV0vy0UeLwJNiWCla_bNMmB6GIyyxs6bPQjbr75H9-fLbrzAYi1_p_BHwWzoDeQg0I9CQugI9zTO5z1CzZuU4L9S0usAe1QwxoA8_Kn_0I6320bnPggBj4JTnPQN5Sc9CXozrbdQIkwqgwBInJtEZ3gDyDdbJ9BMoj-CIYWvwR-T9o-5f2Qh5pCWVS-WGKK1BQU_uis6g48cJGD3F5cNd_RCexuI_C4UUDc7ANGLqVHqvnAaLDNZe56ecQzYDNC7oNJDLkHuNZmNVPjgTrR85eLSoAr5b03nlbykGE9ImWdU2VkGIXcBsx-ekIbo-iQq7Qrd7fdqfVIFtdajr8tg0dVVM7X4YVD_0naqqU3c8ng51d6z1oZJaV4fyIAvTylI2ZV0ey7qSstrVskQpm_65GWq1LwdRlzgrY3dp7o78WJgQIrbVvj4cy8KqDm3IV5CU9zClkG9Cyi4Fkp6ac-HbzLqLYxB1aU3g8LkfG7b5Esvw5iya1zv2JzX65qoporftN_dEmrf9PS2e_sI-Ny6JCUJeNj3XVv4XAAD__01FzeM">