-
Notifications
You must be signed in to change notification settings - Fork 30
[libclang parser] include headers hermetically #378
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
Open
hoe-jo
wants to merge
1
commit into
main
Choose a base branch
from
joho_hermetic_libclang
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,9 +42,23 @@ bazel_dep(name = "download_utils", version = "1.2.2") | |
| bazel_dep(name = "trlc", version = "3.0.0") | ||
| bazel_dep(name = "lobster", version = "1.0.4") | ||
| bazel_dep(name = "rules_distroless", version = "0.8.0") | ||
|
|
||
| # The released 0.8.0 only supports the old manifest/lock apt.install() API. | ||
| # apt.sysroot() (needed for the hermetic libclang sysroot below, and for the | ||
| # docs_runtime dependency_set API) is only available on this fork, which is | ||
| # also what eclipse-score-communication2 overrides to (see its | ||
| # third_party/score_tooling/bump_rules_distroless_api.patch, which exists | ||
| # specifically to migrate *this* module's old-API usage to match this fork | ||
| # when score_tooling is a non-root dependency). | ||
| git_override( | ||
| module_name = "rules_distroless", | ||
| commit = "2cda8c523a2219593e91dbb044dd30c793d9d68f", | ||
| remote = "https://github.com/LittleHuba/rules_distroless.git", | ||
| ) | ||
|
|
||
| bazel_dep(name = "googletest", version = "1.17.0.bcr.2") | ||
|
|
||
| bazel_dep(name = "toolchains_llvm", version = "1.6.0", dev_dependency = True) # Libclang Tooling | ||
| bazel_dep(name = "toolchains_llvm", version = "1.8.0", dev_dependency = True) # Libclang Tooling | ||
|
|
||
| bazel_dep(name = "rules_jvm_external", version = "6.10") # PlantUML | ||
|
|
||
|
|
@@ -286,22 +300,75 @@ deb( | |
| ) | ||
|
|
||
| ############################################################################### | ||
| # Hermetic doc-tool sysroot (docs_runtime) | ||
| # Hermetic apt packages (docs_runtime sysroot + LLVM toolchain sysroot) | ||
| # | ||
| # Distroless rootfs providing graphviz + fakechroot for hermetic dot execution | ||
| # via //third_party/docs_runtime:dot (exec_in_sysroot). | ||
| # Pinned to the Ubuntu 24.04 (noble) snapshot so the package closure is | ||
| # reproducible. Both dependency sets below share this one sources_list. | ||
| ############################################################################### | ||
| # bsdtar (used by //bazel/rules/exec_in_sysroot to extract sysroot archives). | ||
| bazel_dep(name = "tar.bzl", version = "0.6.0") | ||
|
|
||
| apt = use_extension("@rules_distroless//apt:extensions.bzl", "apt") | ||
| apt.sources_list( | ||
| architectures = ["amd64"], | ||
| components = [ | ||
| "main", | ||
| "universe", | ||
| ], | ||
| suites = [ | ||
| "noble", | ||
| "noble-security", | ||
| "noble-updates", | ||
| ], | ||
| types = ["deb"], | ||
| uris = ["https://snapshot.ubuntu.com/ubuntu/20260401T104001Z"], | ||
| ) | ||
|
|
||
| # Distroless rootfs providing graphviz + fakechroot for hermetic dot execution | ||
| # via //third_party/docs_runtime:dot (exec_in_sysroot). | ||
| apt.install( | ||
| name = "docs_runtime", | ||
| lock = "//third_party/docs_runtime:docs_runtime.lock.json", | ||
| manifest = "//third_party/docs_runtime:docs_runtime.yaml", | ||
| dependency_set = "docs_runtime", | ||
| mergedusr = True, | ||
| packages = [ | ||
| "fakechroot", # /usr/bin/fakechroot + libfakechroot.so for exec_in_sysroot | ||
| "graphviz", # /usr/bin/dot and plugins used by Sphinx + PlantUML | ||
| ], | ||
| suites = [ | ||
| "noble", | ||
| "noble-security", | ||
| "noble-updates", | ||
| ], | ||
| ) | ||
|
|
||
| # Hermetic sysroot for the LLVM toolchain (see cpp/libclang), so that | ||
| # cpp_parser's cc_common-derived flags (and any normal C++ compile using this | ||
| # toolchain) resolve libc/libstdc++ headers from a pinned rootfs instead of the | ||
| # build host, matching eclipse-score-communication2's ubuntu24_04_sysroot setup. | ||
| apt.install( | ||
| dependency_set = "tooling_sysroot", | ||
| mergedusr = True, | ||
| packages = [ | ||
| "libatomic1", # Non-lock-free atomics support | ||
| "libc6", # Core C/POSIX | ||
| "libc6-dev", # Core C/POSIX | ||
| "libgcc-s1", # Exception unwinding | ||
| "libstdc++-13-dev", # C++ standard library headers | ||
| "libstdc++6", # C++ standard library runtime | ||
| "linux-libc-dev", # Core C/POSIX | ||
| ], | ||
| suites = [ | ||
| "noble", | ||
| "noble-security", | ||
| "noble-updates", | ||
| ], | ||
| ) | ||
| use_repo(apt, "docs_runtime") | ||
| apt.sysroot( | ||
| name = "tooling_sysroot_amd64", | ||
| architecture = "amd64", | ||
| dependency_set = "tooling_sysroot", | ||
| ) | ||
| apt.lock(into = "//:rules_distroless.lock.json") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can drop this line. It is only required for Bazel versions <8 which is outside of our compatibility level anyway. |
||
| use_repo(apt, "docs_runtime", "tooling_sysroot_amd64") | ||
|
|
||
| register_toolchains( | ||
| "//bazel/rules/rules_score:sphinx_default_toolchain", | ||
|
|
@@ -401,4 +468,9 @@ llvm.toolchain( | |
| ]}, | ||
| llvm_version = "19.1.7", | ||
| ) | ||
| llvm.sysroot( | ||
| name = "llvm_toolchain", | ||
| label = "@tooling_sysroot_amd64//sysroot", | ||
| targets = ["linux-x86_64"], | ||
| ) | ||
| use_repo(llvm, "llvm_toolchain", "llvm_toolchain_llvm") | ||
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
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
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
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please bump to
6e17a8b59c851243d612108a96d05bc77f6f58d1Then remove
mergedusrattribute and add packagebase-filesto the list.