diff options
author | Yifan Hong <elsk@google.com> | 2024-04-17 15:44:11 -0700 |
---|---|---|
committer | Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> | 2024-04-19 04:20:50 +0000 |
commit | 74a8729d753059da9478b8ee2799dac8ba330f66 (patch) | |
tree | ff7cc11ee3727342a73d867f461bccf3d50c54be | |
parent | 1ce19a6a5ca62da25a89dea57eea1a8ccbcaf2a7 (diff) | |
download | build-74a8729d753059da9478b8ee2799dac8ba330f66.tar.gz |
kleaf: Fix tools/bazel --help.
Do not attach any --bazelrc flags when running
tools/bazel --help.
Add back integration test now that the issue in
Bazel about JDK_JAVA_OPTIONS is fixed.
Bug: 293357796
Test: TH
Change-Id: Ib65c245ecda54d1fa1c655f3dc365407570d73ec
-rwxr-xr-x | kleaf/bazel.py | 10 | ||||
-rw-r--r-- | kleaf/tests/integration_test/integration_test.py | 1 |
2 files changed, 6 insertions, 5 deletions
diff --git a/kleaf/bazel.py b/kleaf/bazel.py index ec2d1b0..9a87627 100755 --- a/kleaf/bazel.py +++ b/kleaf/bazel.py @@ -326,6 +326,9 @@ class BazelWrapper(KleafHelpPrinter): def _handle_bazelrc(self): """Rewrite bazelrc files.""" + if self.known_startup_options.help: + return + self.gen_bazelrc_dir = self.absolute_out_dir / "bazel/bazelrc" os.makedirs(self.gen_bazelrc_dir, exist_ok=True) @@ -370,10 +373,9 @@ class BazelWrapper(KleafHelpPrinter): build --//build/kernel/kleaf:cache_dir={shlex.quote(str(self.known_args.cache_dir))} """)) - if not self.known_startup_options.help: - self.transformed_startup_options += self._transform_bazelrc_files([ - cache_dir_bazelrc, - ]) + self.transformed_startup_options += self._transform_bazelrc_files([ + cache_dir_bazelrc, + ]) self.transformed_startup_options += self._transform_bazelrc_files([ # Toolchains and platforms diff --git a/kleaf/tests/integration_test/integration_test.py b/kleaf/tests/integration_test/integration_test.py index 28d5f85..f874d55 100644 --- a/kleaf/tests/integration_test/integration_test.py +++ b/kleaf/tests/integration_test/integration_test.py @@ -605,7 +605,6 @@ class QuickIntegrationTest(KleafIntegrationTestBase): self.assertNotIn("DECLARED_SET", stderr) self.assertNotIn("DECLARED_UNSET", stderr) - @unittest.skip("b/293357796") def test_dash_dash_help(self): """Test that `bazel --help` works.""" self._check_output("--help", [], use_bazelrc=False) |