[llvm] [libc][bazel] Add a repo with linux kernel UAPI headers (PR #216867)
Jordan Rupprecht via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 20 16:03:40 PDT 2026
================
@@ -0,0 +1,55 @@
+# This file is licensed under the Apache License v2.0 with LLVM Exceptions.
+# See https://llvm.org/LICENSE.txt for license information.
+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+
+"""bzlmod extension for making Linux kernel UAPI headers available in Bazel."""
+
+_SYSTEM_HEADERS_PATH_ENV_VAR = "LINUX_UAPI_INCLUDE_DIR"
+
+_ERROR_MESSAGE_BZL = """\
+def error_message(name, message):
----------------
rupprecht wrote:
Using a rule rather than a macro moves the error from package loading / query phase to analysis phase. It makes the error a _little_ bit nicer:
```bzl
def _error_message_impl(ctx):
fail(ctx.attr.message)
error_message = rule(
implementation = _error_message_impl,
attrs = {"message": attr.string()},
)
```
https://github.com/llvm/llvm-project/pull/216867
More information about the llvm-commits
mailing list