Implementation of Sysroot.CreateSimpleChromeSysroot in the BuildAPI.
This included regenerationg api/gen/chromite/api/sysroot_pb2.py
with api/compile_build_api_proto to pick up most recent proto
and updating sysroot__create_simple_chrome_example_input.json.
BUG=chromium:999670
TEST=manual, run_tests
Change-Id: Ibcd749b3d0cb0423688931c5aebaf3ce29d74edf
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/1829972
Reviewed-by: Alex Klein <saklein@chromium.org>
Commit-Queue: Michael Mortensen <mmortensen@google.com>
Tested-by: Michael Mortensen <mmortensen@google.com>
diff --git a/api/controller/sysroot.py b/api/controller/sysroot.py
index 5edbbc8..0f232f8 100644
--- a/api/controller/sysroot.py
+++ b/api/controller/sysroot.py
@@ -51,6 +51,23 @@
return controller.RETURN_CODE_SUCCESS
+@faux.all_empty
+@validate.require('build_target.name')
+@validate.validation_complete
+def CreateSimpleChromeSysroot(input_proto, output_proto, _config):
+ """Create a sysroot for SimpleChrome to use."""
+ build_target_name = input_proto.build_target.name
+ use_flags = input_proto.use_flags
+
+ sysroot_tar_path = sysroot.CreateSimpleChromeSysroot(build_target_name,
+ use_flags)
+ # By assigning this Path variable to the tar path, the tar file will be
+ # copied out to the input_proto's ResultPath location.
+ output_proto.sysroot_archive.path = sysroot_tar_path
+
+ return controller.RETURN_CODE_SUCCESS
+
+
def _MockFailedPackagesResponse(_input_proto, output_proto, _config):
"""Mock error response that populates failed packages."""
pkg = output_proto.failed_packages.add()