Lines Matching +full:platform +full:- +full:sdk +full:- +full:version
3 # Use of this source code is governed by a BSD-style license that can be
5 """Check out the Fuchsia SDK from a given GCS path. Should be used in a
13 import platform
29 host_arch = platform.machine()
30 # platform.machine() returns AMD64 on 64-bit Windows.
38 def GetSDKOverrideGCSPath() -> Optional[str]:
39 """Fetches the sdk override path from a file or an environment variable.
42 The override sdk location, stripped of white space.
43 Example: gs://fuchsia-artifacts/development/some-id/sdk
57 def _GetTarballPath(gcs_tarball_prefix: str) -> str:
58 """Get the full path to the sdk tarball on GCS"""
59 platform = get_host_os()
61 return f'{gcs_tarball_prefix}/{platform}-{arch}/core.tar.gz'
64 def _GetCurrentVersionFromManifest() -> Optional[str]:
73 parser.add_argument('--cipd-prefix', help='CIPD base directory for the SDK.')
74 parser.add_argument('--version', help='Specifies the SDK version.')
75 parser.add_argument('--verbose',
76 '-v',
78 help='Enable debug-level logging.')
83 # Exit if there's no SDK support for this platform.
87 logging.warning('Fuchsia SDK is not supported on this platform.')
91 # include the "version:" prefix.
92 if args.version.startswith('version:'):
93 args.version = args.version[len('version:'):]
97 # sdk_override contains the full path but not only the version id. But since
98 # the scenario is limited to dry-run, it's not worth complexity to extract
99 # the version id.
100 if args.version == _GetCurrentVersionFromManifest():
108 parser.exit(1, '--cipd-prefix must be specified.')
109 if not args.version:
110 parser.exit(2, '--version must be specified.')
111 logging.info('Downloading SDK from CIPD...')
112 ensure_file = '%s%s-%s version:%s' % (args.cipd_prefix, host_plat,
113 _GetHostArch(), args.version)
114 subprocess.run(('cipd', 'ensure', '-ensure-file', '-', '-root', SDK_ROOT,
115 '-log-level', 'warning'),
120 # Verify that the downloaded version matches the expected one.
122 if downloaded_version != args.version:
124 'SDK version after download does not match expected (downloaded:%s '
125 'vs expected:%s)', downloaded_version, args.version)
128 logging.info('Downloading SDK from GCS...')
132 # Build rules (e.g. fidl_library()) depend on updates to the top-level
133 # manifest to spot when to rebuild for an SDK update. Ensure that ninja
134 # sees that the SDK manifest has changed, regardless of the mtime set by