Reland "[bazel] Update to v5.2.0"
This is a reland of commit fb13c18ddf
Bazel 5.2.0 was fine, it was the fact that our toolchain
was not erroring when clang failed that was an issue.
We were always returning error code 0, but Bazel 5.2.0
was correctly identifying that we hadn't produced the
promised build artifacts.
Original change's description:
> [bazel] Update to v5.2.0
>
> The primary change we are looking for is
> "Add support for .ar archives (and .deb files)
> https://github.com/bazelbuild/bazel/pull/15218"
>
> https://blog.bazel.build/2022/06/08/bazel-5.2.html
>
> In theory, we should be able to trigger Linux RBE
> compilations (e.g. IWYU) from Mac with this change.
>
> Change-Id: I217406d21fd55507e090c4bb5f79c796230717e6
> Bug: skia:12541
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549659
> Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Bug: skia:12541
Change-Id: I160b5802adc232d5cf7f7d05b20d5eabbb3d5102
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/551841
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
This commit is contained in:
parent
c37b386886
commit
2e99fcb021
@ -1 +1 @@
|
||||
5.0.0
|
||||
5.2.0
|
||||
|
@ -150,21 +150,15 @@ debs_to_install = [
|
||||
def _download_and_extract_deb(ctx, deb, sha256, prefix, output = ""):
|
||||
"""Downloads a debian file and extracts the data into the provided output directory"""
|
||||
|
||||
# https://bazel.build/rules/lib/repository_ctx#download
|
||||
# .deb files are also .ar archives.
|
||||
ctx.download(
|
||||
# https://bazel.build/rules/lib/repository_ctx#download_and_extract
|
||||
# A .deb file has a data.tar.xz and a control.tar.xz, but the important contents
|
||||
# (i.e. the headers or libs) are in the data.tar.xz
|
||||
ctx.download_and_extract(
|
||||
url = _mirror([deb, mirror_prefix + sha256 + ".deb"]),
|
||||
output = "tmp/deb.ar",
|
||||
output = "tmp",
|
||||
sha256 = sha256,
|
||||
)
|
||||
|
||||
# https://bazel.build/rules/lib/repository_ctx#execute
|
||||
# This uses the statically built binary from the infra repo
|
||||
res = ctx.execute(["bin/open_ar", "--input", "tmp/deb.ar", "--output_dir", "tmp"], quiet = False)
|
||||
if res.return_code != 0:
|
||||
# Run it again to display the error
|
||||
fail("Could not open deb.ar from " + deb)
|
||||
|
||||
# https://bazel.build/rules/lib/repository_ctx#extract
|
||||
ctx.extract(
|
||||
archive = "tmp/data.tar.xz",
|
||||
@ -176,16 +170,6 @@ def _download_and_extract_deb(ctx, deb, sha256, prefix, output = ""):
|
||||
ctx.delete("tmp")
|
||||
|
||||
def _download_linux_amd64_toolchain_impl(ctx):
|
||||
# Workaround for Bazel not yet supporting .ar files
|
||||
# See https://skia-review.googlesource.com/c/buildbot/+/524764
|
||||
# https://bazel.build/rules/lib/repository_ctx#download
|
||||
ctx.download(
|
||||
url = mirror_prefix + "open_ar_v1",
|
||||
sha256 = "55bb74d9ce5d6fa06e390b2319a410ec595dbb591a3ce650da356efe970f86d3",
|
||||
executable = True,
|
||||
output = "bin/open_ar",
|
||||
)
|
||||
|
||||
# Download the clang toolchain (the extraction can take a while)
|
||||
# https://bazel.build/rules/lib/repository_ctx#download_and_extract
|
||||
ctx.download_and_extract(
|
||||
|
@ -6,6 +6,8 @@
|
||||
|
||||
export LD_LIBRARY_PATH="external/clang_linux_amd64/usr/lib/x86_64-linux-gnu:external/clang_linux_amd64/usr/lib/llvm-13/lib"
|
||||
|
||||
set -e
|
||||
|
||||
# We only want to run include-what-you-use if DSKIA_ENFORCE_IWYU is in the arguments
|
||||
# passed in (i.e. the "skia_enforce_iwyu" feature is enabled) and we are not linking
|
||||
# (as detected by the presence of -fuse-ld).
|
||||
|
Loading…
Reference in New Issue
Block a user