| # Copyright 2022 The Dart Authors. All rights reserved. | |
| # Use of this source code is governed by a BSD-style license that can be | |
| # found in the LICENSE file. | |
| import datetime, json | |
| from recipe_engine.post_process import (MustRun, DoesNotRunRE, DropExpectation) | |
| from PB.recipe_modules.dart.build.build import Build | |
| from PB.recipes.dart.release.sdk import BuildOptions | |
| DEPS = [ | |
| 'dart', | |
| 'dart/build', | |
| 'depot_tools/bot_update', | |
| 'depot_tools/gclient', | |
| 'depot_tools/git', | |
| 'depot_tools/gsutil', | |
| 'depot_tools/osx_sdk', | |
| 'recipe_engine/archive', | |
| 'recipe_engine/context', | |
| 'recipe_engine/cipd', | |
| 'recipe_engine/buildbucket', | |
| 'recipe_engine/bcid_reporter', | |
| 'recipe_engine/file', | |
| 'recipe_engine/path', | |
| 'recipe_engine/platform', | |
| 'recipe_engine/properties', | |
| 'recipe_engine/raw_io', | |
| 'recipe_engine/runtime', | |
| 'recipe_engine/scheduler', | |
| 'recipe_engine/step', | |
| 'recipe_engine/time', | |
| 'safe_cipd', | |
| ] | |
| DARTDOC_BASE_URL = 'gs://dart-api-documentation' | |
| PYTHON_VERSION_COMPATIBILITY = 'PY3' | |
| PROPERTIES = BuildOptions | |
| DART_ARCH_TO_DEBIAN_ARCH = { | |
| 'ia32': 'i386', | |
| 'x64': 'amd64', | |
| 'arm': 'armhf', | |
| 'arm64': 'arm64', | |
| 'riscv32': 'riscv32', | |
| 'riscv64': 'riscv64', | |
| } | |
| def _is_cross(api, arch): | |
| archs = {'ia32', 'x64'} if api.platform.arch == 'intel' else \ | |
| {'arm64'} if api.platform.arch == 'arm' else \ | |
| {api.platform.arch} | |
| if api.platform.name == 'mac' and api.platform.arch == 'arm': | |
| archs.add('x64') | |
| return not arch in archs | |
| def _build_root(api): | |
| if api.platform.name == 'mac': | |
| return 'xcodebuild' | |
| return 'out' | |
| def _build_conf(api, arch): | |
| mode = 'Release' | |
| cross = 'X' if _is_cross(api, arch) else '' | |
| return f'{mode}{cross}{arch.upper()}' | |
| def _build(api, properties, commit, os, sdk_dir, version): | |
| # Build the Dart SDK. | |
| args = ['--sanitizer=none', '--mode=release', '--check-clean'] | |
| args.append('--arch=' + ','.join(properties.archs)) | |
| if properties.args: | |
| args.extend(properties.args) | |
| args.append('create_sdk') | |
| if os == 'linux': | |
| args.append('debian_package') | |
| api.build.build(sdk_dir, args=args) | |
| for arch in properties.archs: | |
| out_path = sdk_dir / _build_root(api) / _build_conf(api, arch) | |
| dart_sdk_path = out_path / 'dart-sdk' | |
| zip_name = f'dartsdk-{os}-{arch}-release.zip' | |
| zip_path = out_path / zip_name | |
| (api.archive.package(out_path).with_dir(dart_sdk_path).archive( | |
| f'zip {zip_name}', zip_path)) | |
| sha256 = api.file.file_hash(zip_path) | |
| sha256_name = zip_name + '.sha256sum' | |
| sha256_path = out_path / sha256_name | |
| api.file.write_text(f'write {sha256_name}', sha256_path, | |
| f'{sha256} *{zip_name}\n') | |
| # Build dartdocs. | |
| if properties.dartdoc_arch: | |
| arch = properties.dartdoc_arch | |
| out_path = sdk_dir / _build_root(api) / _build_conf(api, arch) | |
| dart_exe = 'dart.exe' if os == 'windows' else 'dart' | |
| dart_path = out_path / f'dart-sdk/bin/{dart_exe}' | |
| dartdocs_path = out_path / 'gen-dartdocs' | |
| dartdocs_zip_path = out_path / 'dartdocs-gen-api.zip' | |
| api.step('build api_docs', [ | |
| dart_path, | |
| sdk_dir / 'third_party/pkg/dartdoc/bin/dartdoc.dart', | |
| '--sdk-docs', | |
| f'--output={dartdocs_path}', | |
| '--rel-canonical-prefix=https://api.dart.dev', | |
| ]) | |
| api.archive.package(out_path).with_dir(dartdocs_path).archive( | |
| 'zip dartdocs', dartdocs_zip_path) | |
| # Create VERSION file for the release archive. | |
| commit_date = api.git( | |
| 'show', | |
| '-s', | |
| '--date=format:%Y-%m-%d', | |
| '--format=format:%cd', | |
| name='read commit date', | |
| stdout=api.raw_io.output_text(add_output_log=True)).stdout.rstrip() | |
| gcs_version_path = sdk_dir / 'VERSION' | |
| gcs_version_text = json.dumps( | |
| { | |
| 'date': commit_date, | |
| 'version': str(version), | |
| 'revision': commit, | |
| }, | |
| indent=2) | |
| api.file.write_text('write gcs VERSION', gcs_version_path, gcs_version_text) | |
| def _upload_build(api, properties, os, out_path, bucket, topdir, subdir, arch): | |
| # Upload the Dart SDK zip. | |
| zip_name = f'dartsdk-{os}-{arch}-release.zip' | |
| zip_path = out_path / zip_name | |
| object_path = f'{topdir}/{subdir}/sdk/{zip_name}' | |
| api.gsutil.upload( | |
| zip_path, bucket, object_path, name=f'upload {zip_name} ({subdir})') | |
| # Report the cloud storage object to snoopy and get the provenance. | |
| if not properties.disable_bcid: | |
| sha256 = api.file.file_hash(zip_path) | |
| api.bcid_reporter.report_gcs(sha256, f'gs://{bucket}/{object_path}') | |
| # Upload the Dart SDK zip sha256sum. | |
| sha256_name = zip_name + '.sha256sum' | |
| sha256_path = out_path / sha256_name | |
| api.gsutil.upload( | |
| sha256_path, | |
| bucket, | |
| object_path + '.sha256sum', | |
| name=f'upload {sha256_name} ({subdir})') | |
| _upload_unstripped(api, 'dart', os, out_path, bucket, topdir, subdir, arch) | |
| _upload_unstripped(api, 'dartaotruntime', os, out_path, bucket, topdir, subdir, arch) | |
| def _upload_unstripped(api, executable_name, os, out_path, bucket, topdir, subdir, arch): | |
| executable = f'{executable_name}.exe' if os == 'windows' else executable_name | |
| # Upload the unstripped dart executable for debugging. | |
| unstripped_path = out_path / executable | |
| upstripped_object_path = f'{topdir}/{subdir}/unstripped/{os}/{arch}/{executable}' | |
| api.gsutil.upload( | |
| unstripped_path, | |
| bucket, | |
| upstripped_object_path, | |
| name=f'upload unstripped {executable} ({subdir})') | |
| def _test_deb(api, sdk_dir, version, arch): | |
| out_path = sdk_dir / _build_root(api) / _build_conf(api, arch) | |
| deb_arch = DART_ARCH_TO_DEBIAN_ARCH[arch] | |
| deb_name = f'dart_{version}-1_{deb_arch}.deb' | |
| deb_path = out_path / deb_name | |
| api.step('test debian package', | |
| ['tools/debian_package/test_debian_package.sh', deb_path, arch]) | |
| def _upload_deb(api, properties, os, out_path, bucket, topdir, subdir, arch, | |
| version): | |
| deb_arch = DART_ARCH_TO_DEBIAN_ARCH[arch] | |
| deb_name = f'dart_{version}-1_{deb_arch}.deb' | |
| deb_path = out_path / deb_name | |
| deb_object_path = f'{topdir}/{subdir}/linux_packages/{deb_name}' | |
| api.gsutil.upload( | |
| deb_path, bucket, deb_object_path, name=f'upload {deb_name} ({subdir})') | |
| # Report the cloud storage object to snoopy and get the provenance. | |
| if not properties.disable_bcid: | |
| sha256 = api.file.file_hash(deb_path) | |
| api.bcid_reporter.report_gcs(sha256, f'gs://{bucket}/{deb_object_path}') | |
| CROSS_COMPILE_HOST_OSES = ['linux', 'macos', 'windows'] | |
| CROSS_COMPILE_HOST_ARCHS = ['arm64', 'x64'] | |
| CROSS_COMPILE_TARGET_OSES = ['linux'] | |
| CROSS_COMPILE_TARGET_ARCHS = ['arm', 'arm64', 'riscv64', 'x64'] | |
| def _upload_cross_compile_support(api, properties, os, out_path, bucket, topdir, | |
| subdir, arch): | |
| files_and_paths = [] | |
| ext = '.exe' if os == 'windows' else '' | |
| # Where the stripped binaries live. Note that not all builds use this for | |
| # stripped binaries (e.g., MSVC-based Windows builds), so we need to check | |
| # and fall back to out_path if there isn't a binary there. | |
| stripped_path = out_path / 'exe.stripped' | |
| # upload dartaotruntime binaries for cross compilation targets. | |
| if os in CROSS_COMPILE_TARGET_OSES and arch in CROSS_COMPILE_TARGET_ARCHS: | |
| dartaotruntime_binary = f'dartaotruntime_product{ext}' | |
| dartaotruntime_path = stripped_path / dartaotruntime_binary | |
| if not api.path.exists(dartaotruntime_path): | |
| dartaotruntime_path = out_path / dartaotruntime_binary | |
| if api.path.exists(dartaotruntime_path): | |
| object_path = f'{topdir}/{subdir}/sdk/dartaotruntime_{os}_{arch}{ext}' | |
| api.gsutil.upload( | |
| dartaotruntime_path, | |
| bucket, | |
| object_path, | |
| name=f'upload dartaotruntime_{os}_{arch}{ext} ({subdir})') | |
| files_and_paths.append((dartaotruntime_path, object_path)) | |
| # upload gen_snapshot binaries for cross compilation targets. | |
| if os in CROSS_COMPILE_HOST_OSES and arch in CROSS_COMPILE_HOST_ARCHS: | |
| for target_os in CROSS_COMPILE_TARGET_OSES: | |
| for target_arch in CROSS_COMPILE_TARGET_ARCHS: | |
| # skip gen_snapshot upload when host == target. | |
| if not (os == target_os and arch == target_arch): | |
| gen_snapshot_binary = f'gen_snapshot_product_{target_os}_{target_arch}{ext}' | |
| gen_snapshot_path = stripped_path / gen_snapshot_binary | |
| if not api.path.exists(gen_snapshot_path): | |
| gen_snapshot_path = out_path / gen_snapshot_binary | |
| if api.path.exists(gen_snapshot_path): | |
| object_path = f'{topdir}/{subdir}/sdk/gen_snapshot_{os}_{arch}_{target_os}_{target_arch}{ext}' | |
| api.gsutil.upload( | |
| gen_snapshot_path, | |
| bucket, | |
| object_path, | |
| name=f'upload gen_snapshot_{os}_{arch}_{target_os}_{target_arch}{ext} ({subdir})' | |
| ) | |
| files_and_paths.append((gen_snapshot_path, object_path)) | |
| # Report the uploaded files to snoopy and get the provenance. | |
| if not properties.disable_bcid: | |
| for file_path, object_path in files_and_paths: | |
| sha256 = api.file.file_hash(file_path) | |
| api.bcid_reporter.report_gcs(sha256, f'gs://{bucket}/{object_path}') | |
| def _upload_dartdoc(api, properties, out_path, bucket, topdir, subdir): | |
| dartdocs_zip_path = out_path / 'dartdocs-gen-api.zip' | |
| dartdoc_object_path = f'{topdir}/{subdir}/api-docs/dartdocs-gen-api.zip' | |
| if not properties.disable_bcid: | |
| sha256 = api.file.file_hash(dartdocs_zip_path) | |
| api.bcid_reporter.report_gcs(sha256, f'gs://{bucket}/{dartdoc_object_path}') | |
| api.gsutil.upload( | |
| dartdocs_zip_path, | |
| bucket, | |
| dartdoc_object_path, | |
| name=f'upload dartdocs ({subdir})') | |
| if not properties.disable_bcid: | |
| sha256 = api.file.file_hash(dartdocs_zip_path) | |
| api.bcid_reporter.report_gcs(sha256, | |
| f'gs://{bucket}/{dartdoc_object_path}') | |
| def _upload_cipd(api, properties, commit, out_path, arch): | |
| dart_sdk_path = out_path / 'dart-sdk' | |
| cipd_os = api.dart.platform_to_cipd_os(api.platform.name) | |
| cipd_arch = api.dart.arch_to_cipd_arch(arch) | |
| cipd_platform = cipd_os + '-' + cipd_arch | |
| cipd_file = out_path / f'{cipd_platform}.zip' | |
| for prefix in ['flutter', 'dart']: | |
| # Signed cipd packages are made on the sign-mac builder. | |
| if prefix == 'dart' and cipd_os == 'mac': | |
| continue | |
| package_name = f'{prefix}/dart-sdk/{cipd_platform}' | |
| pkg = api.cipd.PackageDefinition( | |
| package_name, dart_sdk_path, 'copy', preserve_writable=True) | |
| pkg.add_dir(dart_sdk_path) | |
| report_bcid = (not properties.disable_bcid and prefix == 'dart') | |
| api.safe_cipd.register( | |
| package_name, | |
| pkg, | |
| cipd_file, | |
| unique_tags={'git_revision': commit}, | |
| report_bcid=report_bcid) | |
| def _upload_version(api, sdk_dir, bucket, topdir, subdir): | |
| gcs_version_path = sdk_dir / 'VERSION' | |
| gcs_version_object_path = f'{topdir}/{subdir}/VERSION' | |
| api.gsutil.upload( | |
| gcs_version_path, | |
| bucket, | |
| gcs_version_object_path, | |
| name=f'upload VERSION ({subdir})') | |
| def _publish_main_dartdoc(api, commit, dartdocs_path, base): | |
| assert (commit) | |
| dartdocs_gs_dir = f'{base}/main/{commit}' | |
| api.gsutil(['-m', 'rsync', '-d', '-r', dartdocs_path, dartdocs_gs_dir], | |
| name='publish dartdoc') | |
| def _sign_mac(api, commit, version, arch): | |
| trigger = api.scheduler.GitilesTrigger( | |
| repo='https://dart.googlesource.com/sdk', | |
| ref=f'refs/heads/{version.channel}', | |
| revision=commit, | |
| properties={'archs': [arch]}) | |
| api.scheduler.emit_trigger(trigger, 'dart-internal', | |
| [f'sign-mac-{arch}-{version.channel}']) | |
| def _upload(api, properties, commit, os, sdk_dir, version): | |
| channel = version.channel | |
| is_new_version = channel == 'main' or api.git( | |
| 'diff', | |
| '--name-only', | |
| 'HEAD~1', | |
| 'tools/VERSION', | |
| name='check for updated tools/VERSION', | |
| stdout=api.raw_io.output_text(add_output_log=True)).stdout.rstrip() != '' | |
| bucket = 'dart-archive' | |
| topdir = f'channels/{channel}/raw' | |
| subdirs = [f'hash/{commit}'] | |
| if is_new_version: | |
| subdirs.append('latest') | |
| for subdir in subdirs: | |
| for arch in properties.archs: | |
| out_path = sdk_dir / _build_root(api) / _build_conf(api, arch) | |
| _upload_build(api, properties, os, out_path, bucket, topdir, subdir, arch) | |
| # Upload extra binaries to support dartdev compile exe for | |
| # different targets. | |
| if channel == 'main': | |
| # Mock paths for tests. | |
| ext = '.exe' if os == "windows" else '' | |
| stripped_path = out_path if os == "windows" else out_path / 'exe.stripped' | |
| api.path.mock_add_file(stripped_path / f'dartaotruntime_product{ext}') | |
| for target_os in CROSS_COMPILE_TARGET_OSES: | |
| for target_arch in CROSS_COMPILE_TARGET_ARCHS: | |
| api.path.mock_add_file( | |
| stripped_path / | |
| f'gen_snapshot_product_{target_os}_{target_arch}{ext}') | |
| _upload_cross_compile_support(api, properties, os, out_path, bucket, | |
| topdir, subdir, arch) | |
| # Upload Debian binary package. | |
| if os == 'linux': | |
| _upload_deb(api, properties, os, out_path, bucket, topdir, subdir, arch, | |
| version) | |
| # Upload the dartdocs. | |
| if properties.dartdoc_arch: | |
| out_path = sdk_dir / _build_root(api) / _build_conf( | |
| api, properties.dartdoc_arch) | |
| _upload_dartdoc(api, properties, out_path, bucket, topdir, subdir) | |
| # Upload the VERSION file with release metadata. | |
| _upload_version(api, sdk_dir, bucket, topdir, subdir) | |
| # Upload the SDK to cipd. | |
| if version.channel != 'main': | |
| for arch in properties.archs: | |
| out_path = sdk_dir / _build_root(api) / _build_conf(api, arch) | |
| _upload_cipd(api, properties, commit, out_path, arch) | |
| # Publish the main channel dartdocs immediately since they are not promoted. | |
| arch = properties.dartdoc_arch | |
| out_path = sdk_dir / _build_root(api) / _build_conf(api, arch) | |
| dartdocs_path = out_path / 'gen-dartdocs' | |
| if properties.dartdoc_arch and version.channel == 'main': | |
| _publish_main_dartdoc(api, commit, dartdocs_path, DARTDOC_BASE_URL) | |
| _publish_main_dartdoc(api, 'latest', dartdocs_path, DARTDOC_BASE_URL) | |
| if os == 'macos' and version.channel != 'main': | |
| for arch in properties.archs: | |
| _sign_mac(api, commit, version, arch) | |
| def _report_stage(api, properties, stage): | |
| if not properties.disable_bcid: | |
| api.bcid_reporter.report_stage(stage) | |
| def RunSteps(api, properties): | |
| assert properties.archs, 'the recipe requires archs to be specified' | |
| _report_stage(api, properties, 'start') | |
| with api.osx_sdk('mac'): | |
| # Fetch the Dart SDK source code while Snoopy keeps track of dependencies. | |
| _report_stage(api, properties, 'fetch') | |
| api.gclient.set_config('dart') | |
| sdk_dir = api.bot_update.ensure_checkout(timeout=35 * 60).source_root.path | |
| api.gclient.runhooks() | |
| with api.context(cwd=sdk_dir): | |
| # Build the Dart SDKs. | |
| _report_stage(api, properties, 'compile') | |
| commit = api.buildbucket.gitiles_commit.id | |
| os = api.dart.platform_to_os(api.platform.name) | |
| version_path = sdk_dir / 'tools/VERSION' | |
| version_contents = api.file.read_text('read tools/VERSION', version_path) | |
| version = api.dart.Version(text=version_contents, git_revision=commit) | |
| _build(api, properties, commit, os, sdk_dir, version) | |
| # Test Debian binary package. We only have a Docker working for x64 and arm64. | |
| if os == 'linux': | |
| if 'x64' in properties.archs: | |
| _test_deb(api, sdk_dir, version, 'x64') | |
| if 'arm64' in properties.archs: | |
| _test_deb(api, sdk_dir, version, 'arm64') | |
| # Upload the built Dart SDKs to cloud storage. | |
| _report_stage(api, properties, 'upload') | |
| builder_name = api.buildbucket.builder_name | |
| if (not api.runtime.is_experimental and | |
| not builder_name.endswith('-try') and | |
| not builder_name.endswith('-experimental')): | |
| _upload(api, properties, commit, os, sdk_dir, version) | |
| _report_stage(api, properties, 'upload-complete') | |
| def GenTests(api): | |
| yield api.test( | |
| 'dart-sdk-linux-main', | |
| api.platform.name('linux'), | |
| api.buildbucket.ci_build( | |
| project='dart-internal', | |
| builder='dart-sdk-linux-main', | |
| git_repo='https://dart.googlesource.com/sdk', | |
| git_ref='refs/heads/main', | |
| revision='bb0184365d4dc4ace67914a0e1fc6ac3b052cefe'), | |
| api.properties( | |
| BuildOptions( | |
| archs=['ia32', 'x64', 'arm', 'arm64'], dartdoc_arch='x64')), | |
| api.properties(**{'$dart/build': Build(disable_rbe=True)}), | |
| api.step_data( | |
| 'read tools/VERSION', | |
| api.file.read_text(''' | |
| CHANNEL main | |
| MAJOR 2 | |
| MINOR 17 | |
| PATCH 3 | |
| PRERELEASE 0 | |
| PRERELEASE_PATCH 0 | |
| ''')), | |
| api.step_data( | |
| 'read commit date', stdout=api.raw_io.output_text('2025-03-19\n')), | |
| api.post_process( | |
| MustRun, | |
| 'gsutil upload dartsdk-linux-x64-release.zip (hash/bb0184365d4dc4ace67914a0e1fc6ac3b052cefe)' | |
| ), | |
| api.post_process( | |
| MustRun, | |
| 'gsutil upload dartaotruntime_linux_arm (hash/bb0184365d4dc4ace67914a0e1fc6ac3b052cefe)' | |
| ), | |
| api.post_process( | |
| MustRun, | |
| 'gsutil upload dartaotruntime_linux_arm64 (hash/bb0184365d4dc4ace67914a0e1fc6ac3b052cefe)' | |
| ), | |
| api.post_process( | |
| MustRun, | |
| 'gsutil upload dartaotruntime_linux_x64 (hash/bb0184365d4dc4ace67914a0e1fc6ac3b052cefe)' | |
| ), | |
| api.post_process( | |
| MustRun, | |
| 'gsutil upload gen_snapshot_linux_arm64_linux_arm (hash/bb0184365d4dc4ace67914a0e1fc6ac3b052cefe)' | |
| ), | |
| api.post_process( | |
| MustRun, | |
| 'gsutil upload gen_snapshot_linux_arm64_linux_riscv64 (hash/bb0184365d4dc4ace67914a0e1fc6ac3b052cefe)' | |
| ), | |
| api.post_process( | |
| MustRun, | |
| 'gsutil upload gen_snapshot_linux_arm64_linux_x64 (hash/bb0184365d4dc4ace67914a0e1fc6ac3b052cefe)' | |
| ), | |
| api.post_process( | |
| MustRun, | |
| 'gsutil upload gen_snapshot_linux_x64_linux_arm (hash/bb0184365d4dc4ace67914a0e1fc6ac3b052cefe)' | |
| ), | |
| api.post_process( | |
| MustRun, | |
| 'gsutil upload gen_snapshot_linux_x64_linux_arm64 (hash/bb0184365d4dc4ace67914a0e1fc6ac3b052cefe)' | |
| ), | |
| api.post_process( | |
| MustRun, | |
| 'gsutil upload gen_snapshot_linux_x64_linux_riscv64 (hash/bb0184365d4dc4ace67914a0e1fc6ac3b052cefe)' | |
| ), | |
| ) | |
| yield api.test( | |
| 'dart-sdk-linux-stable', | |
| api.platform.name('linux'), | |
| api.buildbucket.ci_build( | |
| project='dart-internal', | |
| builder='dart-sdk-linux-stable', | |
| git_repo='https://dart.googlesource.com/sdk', | |
| git_ref='refs/heads/stable', | |
| revision='abfdc3d50f6cf66165767da8df4f681a68467178'), | |
| api.properties( | |
| BuildOptions( | |
| archs=['ia32', 'x64', 'arm', 'arm64'], dartdoc_arch='x64')), | |
| api.properties(**{'$dart/build': Build(disable_rbe=True)}), | |
| api.step_data( | |
| 'read tools/VERSION', | |
| api.file.read_text(''' | |
| CHANNEL stable | |
| MAJOR 2 | |
| MINOR 17 | |
| PATCH 3 | |
| PRERELEASE 0 | |
| PRERELEASE_PATCH 0 | |
| ''')), | |
| api.step_data( | |
| 'read commit date', stdout=api.raw_io.output_text('2022-06-01\n')), | |
| api.step_data( | |
| 'check for updated tools/VERSION', | |
| stdout=api.raw_io.output_text('tools/VERSION\n')), | |
| api.post_process( | |
| MustRun, | |
| 'gsutil upload dartsdk-linux-x64-release.zip (hash/abfdc3d50f6cf66165767da8df4f681a68467178)' | |
| ), | |
| api.post_process(MustRun, 'register dart/dart-sdk/linux-amd64'), | |
| api.post_process(MustRun, 'snoop: report_stage (5)'), | |
| ) | |
| yield api.test( | |
| 'dart-sdk-linux-riscv64-dev', | |
| api.platform.name('linux'), | |
| api.buildbucket.ci_build( | |
| project='dart-internal', | |
| builder='dart-sdk-linux-dev', | |
| git_repo='https://dart.googlesource.com/sdk', | |
| git_ref='refs/heads/dev', | |
| revision='da07db8582242af643370cc866b5eed357367e83'), | |
| api.step_data( | |
| 'read tools/VERSION', | |
| api.file.read_text(''' | |
| CHANNEL dev | |
| MAJOR 2 | |
| MINOR 17 | |
| PATCH 0 | |
| PRERELEASE 158 | |
| PRERELEASE_PATCH 0 | |
| ''')), | |
| api.properties(BuildOptions(archs=['riscv64'], args=['--no-clang'])), | |
| api.properties(**{'$dart/build': Build(disable_rbe=True)}), | |
| api.step_data( | |
| 'check for updated tools/VERSION', | |
| stdout=api.raw_io.output_text('tools/VERSION\n')), | |
| api.post_process( | |
| MustRun, | |
| 'gsutil upload dartsdk-linux-riscv64-release.zip (hash/da07db8582242af643370cc866b5eed357367e83)' | |
| ), | |
| api.post_process(MustRun, 'register dart/dart-sdk/linux-riscv64'), | |
| api.post_process(MustRun, 'snoop: report_stage (5)'), | |
| ) | |
| yield api.test( | |
| 'dart-sdk-linux-riscv64-main', | |
| api.platform.name('linux'), | |
| api.buildbucket.ci_build( | |
| project='dart-internal', | |
| builder='dart-sdk-linux-main', | |
| git_repo='https://dart.googlesource.com/sdk', | |
| git_ref='refs/heads/dev', | |
| revision='bb0184365d4dc4ace67914a0e1fc6ac3b052cefe'), | |
| api.step_data( | |
| 'read tools/VERSION', | |
| api.file.read_text(''' | |
| CHANNEL main | |
| MAJOR 2 | |
| MINOR 17 | |
| PATCH 3 | |
| PRERELEASE 0 | |
| PRERELEASE_PATCH 0 | |
| ''')), | |
| api.properties(BuildOptions(archs=['riscv64'], args=['--no-clang'])), | |
| api.properties(**{'$dart/build': Build(disable_rbe=True)}), | |
| api.post_process( | |
| MustRun, | |
| 'gsutil upload dartaotruntime_linux_riscv64 (hash/bb0184365d4dc4ace67914a0e1fc6ac3b052cefe)' | |
| ), | |
| api.post_process( | |
| MustRun, | |
| 'gsutil upload dartsdk-linux-riscv64-release.zip (hash/bb0184365d4dc4ace67914a0e1fc6ac3b052cefe)' | |
| ), | |
| api.post_process(DoesNotRunRE, 'register dart/dart-sdk/linux-riscv64'), | |
| api.post_process(MustRun, 'snoop: report_stage (5)'), | |
| ) | |
| yield api.test( | |
| 'dart-sdk-mac-beta', | |
| api.platform.name('mac'), | |
| api.step_data( | |
| 'find macOS version', stdout=api.raw_io.output_text('10.15.7')), | |
| api.platform.arch('arm'), | |
| api.buildbucket.ci_build( | |
| project='dart-internal', | |
| builder='dart-sdk-mac-beta', | |
| git_repo='https://dart.googlesource.com/sdk', | |
| git_ref='refs/heads/beta', | |
| revision='a6465a49920e649938df378684d75df2aca56ccf'), | |
| api.step_data( | |
| 'read tools/VERSION', | |
| api.file.read_text(''' | |
| CHANNEL beta | |
| MAJOR 2 | |
| MINOR 18 | |
| PATCH 0 | |
| PRERELEASE 44 | |
| PRERELEASE_PATCH 1 | |
| ''')), | |
| api.properties(**{'$dart/build': Build(disable_rbe=True)}), | |
| api.properties(BuildOptions(archs=['x64'])), | |
| api.step_data( | |
| 'check for updated tools/VERSION', | |
| stdout=api.raw_io.output_text('tools/VERSION\n')), | |
| api.post_process( | |
| MustRun, | |
| 'gsutil upload dartsdk-macos-x64-release.zip (hash/a6465a49920e649938df378684d75df2aca56ccf)' | |
| ), | |
| api.post_process(DoesNotRunRE, 'register dart/dart-sdk/.*'), | |
| api.post_process(MustRun, 'snoop: report_stage (5)'), | |
| ) | |
| yield api.test( | |
| 'dart-sdk-mac-arm64-main', | |
| api.platform.name('mac'), | |
| api.step_data( | |
| 'find macOS version', stdout=api.raw_io.output_text('11.6.2')), | |
| api.platform.arch('arm'), | |
| api.buildbucket.ci_build( | |
| project='dart-internal', | |
| builder='dart-sdk-linux-main', | |
| git_repo='https://dart.googlesource.com/sdk', | |
| git_ref='refs/heads/dev', | |
| revision='bb0184365d4dc4ace67914a0e1fc6ac3b052cefe'), | |
| api.properties(**{'$dart/build': Build(disable_rbe=True)}), | |
| api.properties(BuildOptions(archs=['arm64'])), | |
| api.step_data( | |
| 'read tools/VERSION', | |
| api.file.read_text(''' | |
| CHANNEL main | |
| MAJOR 2 | |
| MINOR 17 | |
| PATCH 3 | |
| PRERELEASE 0 | |
| PRERELEASE_PATCH 0 | |
| ''')), | |
| api.post_process( | |
| MustRun, | |
| 'gsutil upload gen_snapshot_macos_arm64_linux_arm (hash/bb0184365d4dc4ace67914a0e1fc6ac3b052cefe)' | |
| ), | |
| api.post_process( | |
| MustRun, | |
| 'gsutil upload gen_snapshot_macos_arm64_linux_arm64 (hash/bb0184365d4dc4ace67914a0e1fc6ac3b052cefe)' | |
| ), | |
| api.post_process( | |
| MustRun, | |
| 'gsutil upload gen_snapshot_macos_arm64_linux_riscv64 (hash/bb0184365d4dc4ace67914a0e1fc6ac3b052cefe)' | |
| ), | |
| api.post_process( | |
| MustRun, | |
| 'gsutil upload gen_snapshot_macos_arm64_linux_x64 (hash/bb0184365d4dc4ace67914a0e1fc6ac3b052cefe)' | |
| ), | |
| api.post_process( | |
| MustRun, | |
| 'gsutil upload dartsdk-macos-arm64-release.zip (hash/bb0184365d4dc4ace67914a0e1fc6ac3b052cefe)' | |
| ), | |
| api.post_process(DoesNotRunRE, 'register dart/dart-sdk/.*'), | |
| api.post_process(MustRun, 'snoop: report_stage (5)'), | |
| ) | |
| yield api.test( | |
| 'dart-sdk-mac-arm64-stable', | |
| api.platform.name('mac'), | |
| api.step_data( | |
| 'find macOS version', stdout=api.raw_io.output_text('11.6.2')), | |
| api.platform.arch('arm'), | |
| api.buildbucket.ci_build( | |
| project='dart-internal', | |
| builder='dart-sdk-mac-arm64-stable', | |
| git_repo='https://dart.googlesource.com/sdk', | |
| git_ref='refs/heads/stable', | |
| revision='18df0aae67183931b1b6d5d12cc04d89f7137919'), | |
| api.properties(**{'$dart/build': Build(disable_rbe=True)}), | |
| api.properties(BuildOptions(archs=['arm64'])), | |
| api.step_data( | |
| 'read tools/VERSION', | |
| api.file.read_text(''' | |
| CHANNEL stable | |
| MAJOR 2 | |
| MINOR 17 | |
| PATCH 3 | |
| PRERELEASE 0 | |
| PRERELEASE_PATCH 0 | |
| ''')), | |
| api.step_data( | |
| 'check for updated tools/VERSION', | |
| stdout=api.raw_io.output_text('tools/VERSION\n')), | |
| api.post_process( | |
| MustRun, | |
| 'gsutil upload dartsdk-macos-arm64-release.zip (hash/18df0aae67183931b1b6d5d12cc04d89f7137919)' | |
| ), | |
| api.post_process(DoesNotRunRE, 'register dart/dart-sdk/.*'), | |
| api.post_process(MustRun, 'snoop: report_stage (5)'), | |
| ) | |
| yield api.test( | |
| 'dart-sdk-win-main', | |
| api.platform.name('win'), | |
| api.buildbucket.ci_build( | |
| project='dart-internal', | |
| builder='dart-sdk-win-main', | |
| git_repo='https://dart.googlesource.com/sdk', | |
| git_ref='refs/heads/main', | |
| revision='18df0aae67183931b1b6d5d12cc04d89f7137919'), | |
| api.properties(**{'$dart/build': Build(disable_rbe=True)}), | |
| api.properties( | |
| BuildOptions(archs=['ia32', 'x64', 'arm64'], dartdoc_arch='x64')), | |
| api.step_data( | |
| 'read tools/VERSION', | |
| api.file.read_text(''' | |
| CHANNEL main | |
| MAJOR 2 | |
| MINOR 17 | |
| PATCH 0 | |
| PRERELEASE 0 | |
| PRERELEASE_PATCH 0 | |
| ''')), | |
| api.post_process( | |
| MustRun, 'gsutil upload dartsdk-windows-x64-release.zip (latest)'), | |
| api.post_process( | |
| MustRun, | |
| 'gsutil upload gen_snapshot_windows_x64_linux_arm64.exe (hash/18df0aae67183931b1b6d5d12cc04d89f7137919)' | |
| ), | |
| api.post_process( | |
| MustRun, | |
| 'gsutil upload gen_snapshot_windows_arm64_linux_arm.exe (hash/18df0aae67183931b1b6d5d12cc04d89f7137919)' | |
| ), | |
| api.post_process( | |
| MustRun, | |
| 'gsutil upload gen_snapshot_windows_arm64_linux_arm64.exe (hash/18df0aae67183931b1b6d5d12cc04d89f7137919)' | |
| ), | |
| api.post_process( | |
| MustRun, | |
| 'gsutil upload gen_snapshot_windows_arm64_linux_riscv64.exe (hash/18df0aae67183931b1b6d5d12cc04d89f7137919)' | |
| ), | |
| api.post_process( | |
| MustRun, | |
| 'gsutil upload gen_snapshot_windows_arm64_linux_x64.exe (hash/18df0aae67183931b1b6d5d12cc04d89f7137919)' | |
| ), | |
| api.post_process( | |
| MustRun, | |
| 'gsutil upload gen_snapshot_windows_x64_linux_arm.exe (hash/18df0aae67183931b1b6d5d12cc04d89f7137919)' | |
| ), | |
| api.post_process( | |
| MustRun, | |
| 'gsutil upload gen_snapshot_windows_x64_linux_arm64.exe (hash/18df0aae67183931b1b6d5d12cc04d89f7137919)' | |
| ), | |
| api.post_process( | |
| MustRun, | |
| 'gsutil upload gen_snapshot_windows_x64_linux_riscv64.exe (hash/18df0aae67183931b1b6d5d12cc04d89f7137919)' | |
| ), | |
| api.post_process( | |
| MustRun, | |
| 'gsutil upload gen_snapshot_windows_x64_linux_x64.exe (hash/18df0aae67183931b1b6d5d12cc04d89f7137919)' | |
| ), | |
| api.post_process(DoesNotRunRE, 'register dart/dart-sdk/.*'), | |
| api.post_process(MustRun, 'snoop: report_stage (5)'), | |
| ) | |
| yield api.test( | |
| 'already-exists-but-matches', | |
| api.platform.name('win'), | |
| api.buildbucket.ci_build( | |
| project='dart-internal', | |
| builder='dart-sdk-win-stable', | |
| git_repo='https://dart.googlesource.com/sdk', | |
| git_ref='refs/heads/stable', | |
| revision='18df0aae67183931b1b6d5d12cc04d89f7137919'), | |
| api.properties(**{'$dart/build': Build(disable_rbe=True)}), | |
| api.properties(BuildOptions(archs=['ia32', 'arm64'])), | |
| api.step_data( | |
| 'read tools/VERSION', | |
| api.file.read_text(''' | |
| CHANNEL stable | |
| MAJOR 2 | |
| MINOR 17 | |
| PATCH 0 | |
| PRERELEASE 0 | |
| PRERELEASE_PATCH 0 | |
| ''')), | |
| api.step_data( | |
| 'check for updated tools/VERSION', | |
| stdout=api.raw_io.output_text('tools/VERSION\n')), | |
| api.step_data( | |
| 'cipd search dart/dart-sdk/windows-arm64 git_revision:18df0aae67183931b1b6d5d12cc04d89f7137919', | |
| api.cipd.example_search( | |
| 'dart/dart-sdk/windows-arm64', | |
| instances=['40-chars-fake-of-the-package-instance_id'], | |
| )), | |
| api.post_process( | |
| MustRun, | |
| "upload skipped: dart/dart-sdk/windows-arm64 already exists for unique tags: ['git_revision:18df0aae67183931b1b6d5d12cc04d89f7137919']" | |
| ), | |
| api.post_process(DoesNotRunRE, 'register dart/dart-sdk/windows-arm64'), | |
| api.post_process(DropExpectation), | |
| ) | |
| yield api.test( | |
| 'already-exists-but-mismatches', | |
| api.platform.name('win'), | |
| api.buildbucket.ci_build( | |
| project='dart-internal', | |
| builder='dart-sdk-win-stable', | |
| git_repo='https://dart.googlesource.com/sdk', | |
| git_ref='refs/heads/stable', | |
| revision='18df0aae67183931b1b6d5d12cc04d89f7137919'), | |
| api.properties(**{'$dart/build': Build(disable_rbe=True)}), | |
| api.properties(BuildOptions(archs=['ia32', 'arm64'])), | |
| api.step_data( | |
| 'read tools/VERSION', | |
| api.file.read_text(''' | |
| CHANNEL stable | |
| MAJOR 2 | |
| MINOR 17 | |
| PATCH 0 | |
| PRERELEASE 0 | |
| PRERELEASE_PATCH 0 | |
| ''')), | |
| api.step_data( | |
| 'check for updated tools/VERSION', | |
| stdout=api.raw_io.output_text('tools/VERSION\n')), | |
| api.step_data( | |
| 'cipd search dart/dart-sdk/windows-arm64 git_revision:18df0aae67183931b1b6d5d12cc04d89f7137919', | |
| api.cipd.example_search( | |
| 'dart/dart-sdk/windows-arm64', | |
| instances=['mismatching_instance_id'], | |
| )), | |
| api.post_process(DoesNotRunRE, 'register dart/dart-sdk/windows-arm64'), | |
| api.post_process(DropExpectation), | |
| status='FAILURE', | |
| ) |