diff --git a/.bazelversion b/.bazelversion index 28cbf7c0aa..91ff57278e 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -5.0.0 \ No newline at end of file +5.2.0 diff --git a/toolchain/download_linux_amd64_toolchain.bzl b/toolchain/download_linux_amd64_toolchain.bzl index 0b8c924141..6be9a57493 100644 --- a/toolchain/download_linux_amd64_toolchain.bzl +++ b/toolchain/download_linux_amd64_toolchain.bzl @@ -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( diff --git a/toolchain/linux_trampolines/clang_trampoline_linux.sh b/toolchain/linux_trampolines/clang_trampoline_linux.sh index a8bb9e9d68..09483aaf1e 100755 --- a/toolchain/linux_trampolines/clang_trampoline_linux.sh +++ b/toolchain/linux_trampolines/clang_trampoline_linux.sh @@ -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).