-
Notifications
You must be signed in to change notification settings - Fork 741
bazel: Fix some DEBUG warnings #30364
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
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
|
Member
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. The error says: which suggests using that existing That rule does exist and also seems to do that "expose a single dir" thing (for the same reason): https://github.com/bazel-contrib/toolchains_llvm/blob/master/toolchain/sysroot.bzl
Member
Author
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. Yes that's what an earlier version of this PR uses. That works fine to resolve the warning and works at build time but it's not enough for the "patching the loader" step which needs access to all the files by label again.
Member
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. Looking
Member
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. Still looking. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| """Repository rule that downloads a Linux sysroot tarball and exposes it as: | ||
|
|
||
| - `:sysroot` — single source-directory entry consumed by the cc_toolchain. | ||
| Mirrors @toolchains_llvm//toolchain:sysroot.bzl so bazel 9's merkle_cache | ||
| treats the sysroot as one input instead of ~1700 files. | ||
| - `:runtime` — versioned shared libraries plus the glibc dynamic loader. | ||
| Packaging consumes this to ship the relevant `.so`s alongside the binary | ||
| and to set the binary's INTERP. | ||
|
|
||
| BUILD lives in a `sysroot/` subdirectory because http_archive can't put a | ||
| build_file in a sub-path, and a top-level `srcs = ["."]` source-directory | ||
| trips Bazel's package-boundary check. | ||
| """ | ||
|
|
||
| _BUILD_FILE = """ | ||
| filegroup( | ||
| name = "sysroot", | ||
| srcs = ["."], | ||
| visibility = ["//visibility:public"], | ||
| ) | ||
|
|
||
| filegroup( | ||
| name = "runtime", | ||
| srcs = glob([ | ||
| "lib*/ld-linux-*.so.*", | ||
| "lib/*/lib*.so.*", | ||
| "usr/lib/*/lib*.so.*", | ||
| ], allow_empty = False), | ||
| visibility = ["//visibility:public"], | ||
| ) | ||
| """ | ||
|
|
||
| def _sysroot_repository_impl(rctx): | ||
| rctx.file("sysroot/BUILD.bazel", _BUILD_FILE) | ||
| rctx.download_and_extract( | ||
| url = rctx.attr.urls, | ||
| sha256 = rctx.attr.sha256, | ||
| output = "sysroot", | ||
| ) | ||
|
|
||
| sysroot_repository = repository_rule( | ||
| implementation = _sysroot_repository_impl, | ||
| attrs = { | ||
| "urls": attr.string_list(mandatory = True), | ||
| "sha256": attr.string(mandatory = True), | ||
| }, | ||
| ) |
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.
huh, i thought this was strictly an short hand / alias thing