autotest-chromite: Checkout chromite to master. Checking out the chromite in autotest/files/site-packages to master as origin/prod is not being set by staging. BUG=chromium:1034631 TEST=None Change-Id: I8196e8c90fd2c065b7b892ddc4a4bab9afac68d9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/1985469 Tested-by: Sanika Kulkarni <[email protected]> Reviewed-by: Allen Li <[email protected]> Commit-Queue: Sanika Kulkarni <[email protected]> Auto-Submit: Sanika Kulkarni <[email protected]>
diff --git a/utils/build_externals.py b/utils/build_externals.py index 34f3790..c373139 100755 --- a/utils/build_externals.py +++ b/utils/build_externals.py
@@ -77,8 +77,8 @@ fetched_packages, fetch_errors = fetch_necessary_packages( package_dir, install_dir, set(options.names_to_check)) - install_errors = build_and_install_packages( - fetched_packages, install_dir, options.use_chromite_master) + install_errors = build_and_install_packages(fetched_packages, install_dir, + options.use_chromite_master) # Byte compile the code after it has been installed in its final # location as .pyc files contain the path passed to compile_dir(). @@ -160,20 +160,31 @@ def build_and_install_packages(packages, install_dir, - use_chromite_master=False): + use_chromite_master=True): """ Builds and installs all packages into install_dir. @param packages - A list of already fetched ExternalPackage instances. @param install_dir - Directory the packages should be installed into. - @param use_chromite_master: True if updating chromite to master branch. + @param use_chromite_master: True if updating chromite to master branch. Due + to the non-usage of origin/prod tag, the default + value for this argument has been set to True. + This argument has not been removed for backward + compatibility. @returns A list of error messages for any installs that failed. """ errors = [] for package in packages: - if use_chromite_master and package.name.lower() == 'chromiterepo': - result = package.build_and_install(install_dir, master_branch=True) + if package.name.lower() == 'chromiterepo': + if not use_chromite_master: + logging.warning( + 'Even though use_chromite_master has been set to %s, it ' + 'will be checked out to master as the origin/prod tag ' + 'carries little value now.', use_chromite_master) + logging.info('Checking out autotest-chromite to master branch.') + result = package.build_and_install( + install_dir, master_branch=True) else: result = package.build_and_install(install_dir) if isinstance(result, bool):