commandline: Remove build-target type.
build_target_lib now requires proto for the prebuilts overhaul.
commandline imports build_target_lib for the build-target type.
wrapper3.py imports commandline.
The compile_build_api_proto wrapper imports proto due to the
import chain above. Failed proto compilations can mean the protos
do not exist, so then generating the next round of protos is
impossible.
This removes the indirect dependency on the protos. The final solution
will be to 1) totally decouple compile_build_api_proto from chromite
-- since it's setting up a component of chromite it shouldn't depend
on it -- and 2) find a better scheme to inject types into the argument
parser rather than having them pre-defined in commandline.
BUG=chromium:1124331, chromium:1124332
TEST=run_tests
Change-Id: Iac776f15357c6f71a439103d54888ea150d416b8
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/2390843
Tested-by: Alex Klein <saklein@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Alex Klein <saklein@chromium.org>
diff --git a/scripts/has_prebuilt.py b/scripts/has_prebuilt.py
index 2ecb222..f96c5fc 100644
--- a/scripts/has_prebuilt.py
+++ b/scripts/has_prebuilt.py
@@ -30,7 +30,7 @@
parser.add_argument(
'-b',
'--build-target',
- type='build_target',
+ dest='build_target_name',
help='The build target that is being checked.')
parser.add_argument(
'--output',
@@ -71,7 +71,7 @@
opts = _ParseArguments(argv)
cros_build_lib.AssertInsideChroot()
- board = opts.build_target.name if opts.build_target else None
+ board = opts.build_target_name
bests = {}
for cpv in opts.packages:
bests[cpv.cp] = portage_util.PortageqBestVisible(cpv.cp, board=board)