From e95075314f97e63062c641156e655b76a2627911 Mon Sep 17 00:00:00 2001 From: Ryan Gonzalez Date: Fri, 15 Nov 2024 17:29:59 -0600 Subject: [PATCH] chromiumchecker: Use Gentoo-hosted tarball mirrors on 404 Upstream keeps having issues in their CI pipelines, resulting in massively delayed tarball uploads. Gentoo has been doing custom uploads in the interim, so try to automatically fall back to those URLs on 404. Signed-off-by: Ryan Gonzalez --- src/checkers/chromiumchecker.py | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/checkers/chromiumchecker.py b/src/checkers/chromiumchecker.py index 2fc089c7..bbf35b5b 100644 --- a/src/checkers/chromiumchecker.py +++ b/src/checkers/chromiumchecker.py @@ -60,12 +60,30 @@ class ChromiumComponent(Component): "https://commondatastorage.googleapis.com" "/chromium-browser-official/chromium-{version}.tar.xz" ) + # https://groups.google.com/a/chromium.org/g/chromium-packagers/c/wjv9UKg2u4w/m/SwSvLazmCAAJ + _GENTOO_URL_FORMAT = ( + "https://chromium-tarballs.distfiles.gentoo.org/chromium-{version}.tar.xz" + ) async def check(self) -> None: assert isinstance(self.external_data, ExternalData) - latest_url = self._URL_FORMAT.format(version=self.latest_version) - await self.update_external_source_version(latest_url) + try: + latest_url = self._URL_FORMAT.format(version=self.latest_version) + await self.update_external_source_version(latest_url) + except CheckerFetchError as err: + if ( + isinstance(err.__cause__, aiohttp.ClientResponseError) + and err.__cause__.status == 404 + ): + log.error( + "Chromium tarball is missing (falling back to alternate URL): %s", + err, + ) + latest_url = self._GENTOO_URL_FORMAT.format(version=self.latest_version) + await self.update_external_source_version(latest_url) + else: + raise class LLVMComponent(Component):