aml_sta_341615000 (11423312,com.google.android.go.os.statsd,com.google.android.os.statsd)
Alias ijar_cc_binary and singlejar_cc_bin to prebuilts in java tools am: 133a600c82 am: 138067d91d am: 3789562e8f am: baa93d1c0b

Original change: https://android-review.googlesource.com/c/platform/prebuilts/bazel/common/+/2532599

Change-Id: I064c7f7f40b5c6a267ce1974520944b005dcee85
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
tree: 47f427f139c82d7f175a32c4b5f696976b42e396
  1. android_tools/
  2. proto/
  3. r8/
  4. remote_java_tools/
  5. bazel-complete.bash
  6. LICENSE
  7. README.md
  8. release_bazel.py
  9. update.sh
  10. update_tools.sh
README.md

Updating the Bazel prebuilts in AOSP

Instructions

First, decide which version of Bazel you need.

  • A Bazel release (e.g. Bazel 3.7.0)
  • A Bazel nightly
  • A Bazel per-commit build

Whichever of these you use, you will need to use official nojdk x86-64 versions of Bazel, for Linux and macOS (Darwin).

Run the update.sh script in the Linux prebuilts repository to download the and verify the binaries from the trusted Bazel CI pipeline:

./update.sh <commit>

To get the commit hash for builds, see the [Bazel releases], [Bazel nightlies] or [Bazel per-commit builds] sections below.

update.sh will also:

  • Download the remote_java_tools prebuilts corresponding to the downloaded Bazel binary
  • verify that the downloaded binary has the correct SHA-256 checksum as provided from Bazel CI metadata.

Once you have the binaries, you will need to create and send up to three CLs, to update the Linux, macOS, and platform-agnostic prebuilts that live in separate Git repositories, i.e.

The update script does not automatically create CLs, so you need to create them manually. In each CL description, mention the testing you did, which should at least include:

  • For release builds only: Verifying the file signature, e.g.
  • Verifying that Bazel starts, on Linux and on macOS, e.g.
    • source build/envsetup.sh
    • bazel info
  • Verifying basic user journeys succeed.
    • ./build/bazel/scripts/run_presubmits.sh (or let TreeHugger run these presubmits for you)

Ensure that the CLs are set to the same Gerrit topic so they are submitted together.

Obtaining Bazel binaries

The update.sh script automates downloading Bazel binaries. The next sections describe how the different Bazel binaries (release, nightly, per-commit) can be manually downloaded from the Bazel CI.

Bazel releases

The commit hash for linux and darwin nojdk x86-64 binaries are available from https://github.com/bazelbuild/bazel/releases

Bazel nightlies

The commit hash and urls for linux and macOS nojdk x86-64 binaries are available in https://storage.googleapis.com/bazel-builds/metadata/latest.json

Bazel per-commit builds

You need to know the GitHub commit that contains your change, e.g. https://github.com/bazelbuild/bazel/commit/364a867df255c57c8edc4a8aae8f78cb54900a54

And the linux and macOS nojdk x86-64 binaries are available from: