sysroot: Add a new option to use Bazel to build packages

BUG=b:262460632
TEST=build_packages --board=amd64-generic --bazel --no-withdev --no-withdebug --no-withfactory --no-withtest --no-withautotest && build_image --board=amd64-generic base

Cq-Depend: chromium:4592613
Change-Id: I8e00c0f4c70cd48ff821c15950ac9aedd503d49b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/4591373
Tested-by: Ryo Hashimoto <hashimoto@chromium.org>
Reviewed-by: Tim Bain <tbain@google.com>
Reviewed-by: Alex Klein <saklein@chromium.org>
Commit-Queue: Ryo Hashimoto <hashimoto@chromium.org>
diff --git a/api/controller/sysroot_unittest.py b/api/controller/sysroot_unittest.py
index 69836b5..1846027 100644
--- a/api/controller/sysroot_unittest.py
+++ b/api/controller/sysroot_unittest.py
@@ -668,6 +668,7 @@
         goma_counterz_file=None,
         package_indexes=None,
         packages=None,
+        bazel=False,
     ):
         """Helper to build an input proto instance."""
         instance = sysroot_pb2.InstallPackagesRequest()
@@ -695,6 +696,8 @@
                 pkg_info = package_info.parse(pkg)
                 pkg_info_msg = instance.packages.add()
                 controller_util.serialize_package_info(pkg_info, pkg_info_msg)
+        if bazel:
+            instance.flags.bazel = bazel
         return instance
 
     def _OutputProto(self):
@@ -915,6 +918,7 @@
             dryrun=False,
             backtrack=sysroot_controller.DEFAULT_BACKTRACK,
             workon=False,
+            bazel=False,
         )
 
     def testSuccessWithGomaLogs(self):