Skip to content

[libc][bazel] Add support for generating headers in Bazel #134780

@vonosmas

Description

@vonosmas

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bazel"Peripheral" support tier build system: utils/bazellibc

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions