0

[Fuchsia] Add check for sdk update

Due to the transition to CIPD, sometimes the SDK directory will end up
in a bad state on builders, where only the .hash file remains. Adds a
check so that in scenarios like this, the SDK is still downloaded.

Bug: 1325179
Change-Id: I5e0bb912dfca46c6aeec677ae449fc41179f0c42
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3653415
Commit-Queue: Chong Gu <chonggu@google.com>
Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
Auto-Submit: Chong Gu <chonggu@google.com>
Cr-Commit-Position: refs/heads/main@{#1004868}
This commit is contained in:
Chong Gu
2022-05-18 18:22:18 +00:00
committed by Chromium LUCI CQ
parent cfaf4056e6
commit 200b1eb8c2

@ -21,6 +21,7 @@ from common import GetHostOsFromPlatform, GetHostArchFromPlatform, \
sys.path.append(os.path.join(DIR_SOURCE_ROOT, 'build'))
import find_depot_tools
LICENSE_FILE = 'LICENSE'
SDK_SIGNATURE_FILE = '.hash'
SDK_TARBALL_PATH_TEMPLATE = (
'gs://{bucket}/development/{sdk_hash}/sdk/{platform}-amd64/gn.tar.gz')
@ -154,9 +155,14 @@ def main():
return 1
signature_filename = os.path.join(SDK_ROOT, SDK_SIGNATURE_FILE)
# crbug.com/1325179: Need to check LICENSE file existence due to transition
# to using CIPD to download the SDK.
license_filename = os.path.join(SDK_ROOT, LICENSE_FILE)
current_signature = (open(signature_filename, 'r').read().strip()
if os.path.exists(signature_filename) else '')
if current_signature != sdk_hash:
if current_signature != sdk_hash or not os.path.exists(license_filename):
logging.info('Downloading GN SDK %s...' % sdk_hash)
MakeCleanDirectory(SDK_ROOT)