From 284648a91114364749fc04bf581fc4f605ca0b79 Mon Sep 17 00:00:00 2001 From: Rob Mohr Date: Mon, 19 Aug 2024 21:19:18 +0000 Subject: [PATCH] pw_env_setup: Get bazelisk instead of bazel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Get bazelisk-as-bazel instead of bazel in environment setup. This is a Bazelisk executable named 'bazel', so it's a drop-in replacement for Bazel. Bug: 355438774 Change-Id: I30075031ce3d5eb12cd5af9305d7404c28fd790d Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/226376 Reviewed-by: Armando Montanez Commit-Queue: Rob Mohr Reviewed-by: Keir Mierle Presubmit-Verified: CQ Bot Account Reviewed-by: Wyatt Hepler Lint: Lint 🤖 --- pw_env_setup/py/cipd_setup_update_test.py | 3 ++- .../py/pw_env_setup/cipd_setup/bazel.json | 15 ++----------- .../py/pw_env_setup/cipd_setup/bazelisk.json | 21 +++++++++++++++++++ .../py/pw_env_setup/cipd_setup/openjdk.json | 16 ++++++++++++++ .../py/pw_env_setup/cipd_setup/upstream.json | 2 +- 5 files changed, 42 insertions(+), 15 deletions(-) create mode 100644 pw_env_setup/py/pw_env_setup/cipd_setup/bazelisk.json create mode 100644 pw_env_setup/py/pw_env_setup/cipd_setup/openjdk.json diff --git a/pw_env_setup/py/cipd_setup_update_test.py b/pw_env_setup/py/cipd_setup_update_test.py index 4bdaa66f8e..3b3a9e0a23 100644 --- a/pw_env_setup/py/cipd_setup_update_test.py +++ b/pw_env_setup/py/cipd_setup_update_test.py @@ -149,8 +149,9 @@ def test_all_package_files(self) -> None: upstream_load_order = [ Path('upstream.json'), - Path('bazel.json'), + Path('bazelisk.json'), Path('buildifier.json'), + Path('openjdk.json'), Path('cmake.json'), Path('coverage.json'), Path('default.json'), diff --git a/pw_env_setup/py/pw_env_setup/cipd_setup/bazel.json b/pw_env_setup/py/pw_env_setup/cipd_setup/bazel.json index bc95e1202a..c8207544c0 100644 --- a/pw_env_setup/py/pw_env_setup/cipd_setup/bazel.json +++ b/pw_env_setup/py/pw_env_setup/cipd_setup/bazel.json @@ -1,6 +1,7 @@ { "included_files": [ - "buildifier.json" + "buildifier.json", + "openjdk.json" ], "packages": [ { @@ -15,18 +16,6 @@ "version:2@8.0.0-pre.20240618.2.7" ], "version_file": ".versions/bazel.version" - }, - { - "path": "flutter/java/openjdk/${platform}", - "platforms": [ - "linux-amd64", - "mac-amd64", - "mac-arm64", - "windows-amd64" - ], - "tags": [ - "version:17" - ] } ] } diff --git a/pw_env_setup/py/pw_env_setup/cipd_setup/bazelisk.json b/pw_env_setup/py/pw_env_setup/cipd_setup/bazelisk.json new file mode 100644 index 0000000000..a9f7ca03d6 --- /dev/null +++ b/pw_env_setup/py/pw_env_setup/cipd_setup/bazelisk.json @@ -0,0 +1,21 @@ +{ + "included_files": [ + "buildifier.json", + "openjdk.json" + ], + "packages": [ + { + "path": "fuchsia/third_party/bazelisk-as-bazel/${platform}", + "platforms": [ + "linux-amd64", + "mac-amd64", + "mac-arm64", + "windows-amd64" + ], + "tags": [ + "version:2@1.20.0" + ], + "version_file": ".versions/bazelisk-as-bazel.version" + } + ] +} diff --git a/pw_env_setup/py/pw_env_setup/cipd_setup/openjdk.json b/pw_env_setup/py/pw_env_setup/cipd_setup/openjdk.json new file mode 100644 index 0000000000..e0d31378df --- /dev/null +++ b/pw_env_setup/py/pw_env_setup/cipd_setup/openjdk.json @@ -0,0 +1,16 @@ +{ + "packages": [ + { + "path": "flutter/java/openjdk/${platform}", + "platforms": [ + "linux-amd64", + "mac-amd64", + "mac-arm64", + "windows-amd64" + ], + "tags": [ + "version:17" + ] + } + ] +} diff --git a/pw_env_setup/py/pw_env_setup/cipd_setup/upstream.json b/pw_env_setup/py/pw_env_setup/cipd_setup/upstream.json index 5f3e71e195..3e1906baea 100644 --- a/pw_env_setup/py/pw_env_setup/cipd_setup/upstream.json +++ b/pw_env_setup/py/pw_env_setup/cipd_setup/upstream.json @@ -1,6 +1,6 @@ { "included_files": [ - "bazel.json", + "bazelisk.json", "cmake.json", "coverage.json", "default.json",