-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Revert "[libc][bazel] Support generating public libc headers in Bazel… #143001
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… builds. (llvm#141256)" This reverts commit 27143f2. It causes some downstream failures when bootstrapping builds.
@llvm/pr-subscribers-libc Author: Jordan Rupprecht (rupprecht) Changes… builds. (#141256)" This reverts commit 27143f2. It causes some downstream failures when bootstrapping builds. Full diff: https://github.com/llvm/llvm-project/pull/143001.diff 4 Files Affected:
diff --git a/utils/bazel/WORKSPACE b/utils/bazel/WORKSPACE
index c21812ef2363b..84e65e6f67b5a 100644
--- a/utils/bazel/WORKSPACE
+++ b/utils/bazel/WORKSPACE
@@ -182,15 +182,6 @@ maybe(
url = "https://github.com/wjakob/nanobind/archive/refs/tags/v2.4.0.tar.gz",
)
-maybe(
- http_archive,
- name = "pyyaml",
- build_file = "@llvm-raw//utils/bazel/third_party_build:pyyaml.BUILD",
- sha256 = "f0a35d7f282a6d6b1a4f3f3965ef5c124e30ed27a0088efb97c0977268fd671f",
- strip_prefix = "pyyaml-5.1/lib3",
- url = "https://github.com/yaml/pyyaml/archive/refs/tags/5.1.zip",
-)
-
load("@rules_python//python:repositories.bzl", "py_repositories", "python_register_toolchains")
py_repositories()
diff --git a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
index eb0f12dcab7e7..aa7f0a9389405 100644
--- a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
@@ -9,7 +9,6 @@ load("@rules_python//python:defs.bzl", "py_binary")
load(
":libc_build_rules.bzl",
"libc_function",
- "libc_generated_header",
"libc_header_library",
"libc_math_function",
"libc_support_library",
@@ -89,14 +88,6 @@ py_binary(
srcs = glob(["utils/hdrgen/hdrgen/**/*.py"]),
imports = ["utils/hdrgen"],
main = "utils/hdrgen/hdrgen/main.py",
- deps = ["@pyyaml//:yaml"],
-)
-
-libc_generated_header(
- name = "include_stdbit_h",
- hdr = "include/stdbit.h",
- other_srcs = ["include/stdbit.h.def"],
- yaml_template = "include/stdbit.yaml",
)
# Library containing all headers that can be transitively included by generated llvm-libc
diff --git a/utils/bazel/llvm-project-overlay/libc/libc_build_rules.bzl b/utils/bazel/llvm-project-overlay/libc/libc_build_rules.bzl
index 9c9cbdcce756c..7fe263ab08f71 100644
--- a/utils/bazel/llvm-project-overlay/libc/libc_build_rules.bzl
+++ b/utils/bazel/llvm-project-overlay/libc/libc_build_rules.bzl
@@ -248,29 +248,6 @@ def libc_header_library(name, hdrs, deps = [], **kwargs):
**kwargs
)
-def libc_generated_header(name, hdr, yaml_template, other_srcs = []):
- """Generates a libc header file from YAML template.
-
- Args:
- name: Name of the genrule target.
- hdr: Path of the header file to generate.
- yaml_template: Path of the YAML template file.
- other_srcs: Other files required to generate the header, if any.
- """
- hdrgen = "//libc:hdrgen"
- cmd = "$(location {hdrgen}) $(location {yaml}) -o $@".format(
- hdrgen = hdrgen,
- yaml = yaml_template,
- )
-
- native.genrule(
- name = name,
- outs = [hdr],
- srcs = [yaml_template] + other_srcs,
- cmd = cmd,
- tools = [hdrgen],
- )
-
def libc_math_function(
name,
additional_deps = None):
diff --git a/utils/bazel/third_party_build/pyyaml.BUILD b/utils/bazel/third_party_build/pyyaml.BUILD
deleted file mode 100644
index 78261a7f60d9b..0000000000000
--- a/utils/bazel/third_party_build/pyyaml.BUILD
+++ /dev/null
@@ -1,16 +0,0 @@
-# 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
-
-load("@rules_python//python:defs.bzl", "py_library")
-
-package(
- default_visibility = ["//visibility:public"],
- # BSD/MIT-like license (for PyYAML)
- licenses = ["notice"],
-)
-
-py_library(
- name = "yaml",
- srcs = glob(["yaml/*.py"]),
-)
|
rorth
pushed a commit
to rorth/llvm-project
that referenced
this pull request
Jun 11, 2025
… builds. (llvm#141256)" (llvm#143001) This reverts commit 27143f2. It causes some downstream failures when bootstrapping builds.
DhruvSrivastavaX
pushed a commit
to DhruvSrivastavaX/lldb-for-aix
that referenced
this pull request
Jun 12, 2025
… builds. (llvm#141256)" (llvm#143001) This reverts commit 27143f2. It causes some downstream failures when bootstrapping builds.
jtstogel
added a commit
to jtstogel/llvm-project
that referenced
this pull request
Jun 20, 2025
This requires adding a new dependency on PyYAML so that Bazel is able to run the `hdrgen` tool hermetically. This PR uses PyYAML version 5.1 due to keep in line with the docs: https://github.com/llvm/llvm-project/blob/b878e0d11874a898bbaa1daf58007dfd232005f2/libc/docs/dev/header_generation.rst?plain=1#L22 See llvm#134780. This is a follow-up to llvm#141256, which was reverted in llvm#143001 because it caused downstream failures when bootstrapping builds.
jtstogel
added a commit
to jtstogel/llvm-project
that referenced
this pull request
Jun 23, 2025
This requires adding a new dependency on PyYAML so that Bazel is able to run the `hdrgen` tool hermetically. This PR uses PyYAML version 5.1 due to keep in line with the docs: https://github.com/llvm/llvm-project/blob/b878e0d11874a898bbaa1daf58007dfd232005f2/libc/docs/dev/header_generation.rst?plain=1#L22 See llvm#134780. This is a follow-up to llvm#141256, which was reverted in llvm#143001 because it caused downstream failures when bootstrapping builds.
jtstogel
added a commit
to jtstogel/llvm-project
that referenced
this pull request
Jun 23, 2025
Running `hdrgen` in Bazel hermetically requires adding a new dependency on PyYAML. This PR uses PyYAML version 5.1 due to keep in line with the docs: https://github.com/llvm/llvm-project/blob/b878e0d11874a898bbaa1daf58007dfd232005f2/libc/docs/dev/header_generation.rst?plain=1#L22 See llvm#134780. Generated headers are placed in a `staging/` directory so that they have the opportunity to be treated differently from non-generated headers. This is a follow-up to llvm#141256, which was reverted in llvm#143001 because it caused downstream failures when bootstrapping builds.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
… builds. (#141256)"
This reverts commit 27143f2. It causes some downstream failures when bootstrapping builds.