scripts: has_prebuilt: sync emerge flags from build_packages
The default set of emerge flags used by build_packages can trigger
rebuilds in more situations than the set of emerge flags used by
has_prebuilt. Most notably, --rebuild-if-new-rev can trigger a lot
of ripples whenever a library is updated.
Since has_prebuilt is currently only being used to check for chrome
prebuilts, and has_prebuilt in general is only used to make early
decisions before invoking build_packages, it's reasonable to keep
the set of flags in sync.
Arguably it's not entirely correct as running has_prebuilt and then
build_packages with --no-rebuild could result in has_prebuilt saying
there's no binpkg, but then build_packages uses one. But since we
aren't leveraging these tools in such a way currently, and most likely
won't start, let's consider that an academic exercise.
BUG=b:280661408,b:285204341
TEST=CQ passes
Change-Id: I1973e9d0e604a65867895196e2b346e34bec7a94
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/4652897
Auto-Submit: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Sergey Frolov <sfrolov@google.com>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Sergey Frolov <sfrolov@google.com>
diff --git a/scripts/has_prebuilt.py b/scripts/has_prebuilt.py
index 04a48e2..3aab870 100644
--- a/scripts/has_prebuilt.py
+++ b/scripts/has_prebuilt.py
@@ -101,6 +101,11 @@
# Don't actually install it :).
"--pretend",
"--selective=n",
+ # We run build_packages by default with these flags which can
+ # trigger rebuilds (and ignoring of binpkgs) in more cases.
+ "--newrepo",
+ "--with-test-deps=y",
+ "--rebuild-if-new-rev",
]
if board:
args.append("--board=%s" % board)