Make global builds uniquely named per platform (flutter/engine#50764)

This is expected to help with
https://github.com/flutter/flutter/issues/132807
This commit is contained in:
Zachary Anderson
2024-02-21 03:41:40 +00:00
committed by GitHub
parent 6a936a530c
commit 6ebbce07e7
9 changed files with 168 additions and 153 deletions

View File

@@ -15,7 +15,9 @@
"--android-cpu=x64",
"--no-lto",
"--rbe",
"--no-goma"
"--no-goma",
"--target-dir",
"android_emulator_debug_x64"
],
"dependencies": [
{
@@ -23,9 +25,9 @@
"version": "git_revision:720a542f6fe4f92922c3b8f0fdcc4d2ac6bb83cd"
}
],
"name": "android_debug_x64",
"name": "android_emulator_debug_x64",
"ninja": {
"config": "android_debug_x64",
"config": "android_emulator_debug_x64",
"targets": [
"flutter/shell/platform/android:flutter_shell_native_unittests",
"flutter/testing/scenario_app"
@@ -51,7 +53,7 @@
"script": "flutter/testing/run_tests.py",
"parameters": [
"--android-variant",
"android_debug_x64",
"android_emulator_debug_x64",
"--type",
"android"
]
@@ -74,7 +76,7 @@
],
"script": "flutter/testing/scenario_app/run_android_tests.sh",
"parameters": [
"android_debug_x64",
"android_emulator_debug_x64",
"--no-enable-impeller"
]
},
@@ -96,7 +98,7 @@
],
"script": "flutter/testing/scenario_app/run_android_tests.sh",
"parameters": [
"android_debug_x64",
"android_emulator_debug_x64",
"--enable-impeller",
"--impeller-backend=vulkan"
]
@@ -118,7 +120,9 @@
"--android-cpu=x86",
"--no-lto",
"--rbe",
"--no-goma"
"--no-goma",
"--target-dir",
"android_emulator_debug_x86"
],
"dependencies": [
{
@@ -126,9 +130,9 @@
"version": "git_revision:720a542f6fe4f92922c3b8f0fdcc4d2ac6bb83cd"
}
],
"name": "android_debug_x86",
"name": "android_emulator_debug_x86",
"ninja": {
"config": "android_debug_x86",
"config": "android_emulator_debug_x86",
"targets": [
"flutter/shell/platform/android:flutter_shell_native_unittests",
"flutter/testing/scenario_app"
@@ -154,7 +158,7 @@
"script": "flutter/testing/run_tests.py",
"parameters": [
"--android-variant",
"android_debug_x86",
"android_emulator_debug_x86",
"--type",
"android"
]

View File

@@ -15,7 +15,9 @@
"--android-cpu=x64",
"--no-lto",
"--rbe",
"--no-goma"
"--no-goma",
"--target-dir",
"android_debug_api33_x64"
],
"dependencies": [
{
@@ -23,9 +25,9 @@
"version": "git_revision:720a542f6fe4f92922c3b8f0fdcc4d2ac6bb83cd"
}
],
"name": "android_debug_x64",
"name": "android_debug_api33_x64",
"ninja": {
"config": "android_debug_x64",
"config": "android_debug_api33_x64",
"targets": [
"flutter/shell/platform/android:flutter_shell_native_unittests",
"flutter/testing/scenario_app"
@@ -51,7 +53,7 @@
"script": "flutter/testing/run_tests.py",
"parameters": [
"--android-variant",
"android_debug_x64",
"android_debug_api33_x64",
"--type",
"android"
]
@@ -74,7 +76,7 @@
],
"script": "flutter/testing/scenario_app/run_android_tests.sh",
"parameters": [
"android_debug_x64"
"android_debug_api33_x64"
]
}
]

View File

@@ -15,7 +15,9 @@
"--android-cpu=x64",
"--no-lto",
"--rbe",
"--no-goma"
"--no-goma",
"--target-dir",
"android_emulator_opengles_debug_x64"
],
"dependencies": [
{
@@ -23,9 +25,9 @@
"version": "git_revision:720a542f6fe4f92922c3b8f0fdcc4d2ac6bb83cd"
}
],
"name": "android_debug_x64",
"name": "android_emulator_opengles_debug_x64",
"ninja": {
"config": "android_debug_x64",
"config": "android_emulator_opengles_debug_x64",
"targets": [
"flutter/testing/scenario_app"
]
@@ -49,7 +51,7 @@
],
"script": "flutter/testing/scenario_app/run_android_tests.sh",
"parameters": [
"android_debug_x64",
"android_emulator_opengles_debug_x64",
"--enable-impeller",
"--impeller-backend=opengles"
]

View File

@@ -10,11 +10,13 @@
"--android",
"--android-cpu",
"arm64",
"--no-lto"
"--no-lto",
"--target-dir",
"android_debug_arm64_clang_tidy"
],
"name": "android_debug_arm64",
"name": "android_debug_arm64_clang_tidy",
"ninja": {
"config": "android_debug_arm64"
"config": "android_debug_arm64_clang_tidy"
}
},
{
@@ -27,11 +29,13 @@
"--runtime-mode",
"debug",
"--prebuilt-dart-sdk",
"--no-lto"
"--no-lto",
"--target-dir",
"host_debug_clang_tidy"
],
"name": "host_debug",
"name": "host_debug_clang_tidy",
"ninja": {
"config": "host_debug"
"config": "host_debug_clang_tidy"
}
}
],
@@ -48,19 +52,19 @@
"download_android_deps": false
},
"dependencies": [
"host_debug"
"host_debug_clang_tidy"
],
"tasks": [
{
"name": "test: lint host_debug",
"parameters": [
"--variant",
"host_debug",
"host_debug_clang_tidy",
"--lint-all",
"--shard-id=0",
"--shard-variants=host_debug,host_debug,host_debug"
"--shard-variants=host_debug_clang_tidy,host_debug_clang_tidy,host_debug_clang_tidy"
],
"max_attempts": 1,
"max_attempts": 1,
"script": "flutter/ci/clang_tidy.sh"
}
]
@@ -77,19 +81,19 @@
"download_android_deps": false
},
"dependencies": [
"host_debug"
"host_debug_clang_tidy"
],
"tasks": [
{
"name": "test: lint host_debug",
"parameters": [
"--variant",
"host_debug",
"host_debug_clang_tidy",
"--lint-all",
"--shard-id=1",
"--shard-variants=host_debug,host_debug,host_debug"
"--shard-variants=host_debug_clang_tidy,host_debug_clang_tidy,host_debug_clang_tidy"
],
"max_attempts": 1,
"max_attempts": 1,
"script": "flutter/ci/clang_tidy.sh"
}
]
@@ -106,20 +110,19 @@
"download_android_deps": false
},
"dependencies": [
"host_debug",
"android_debug_arm64"
"host_debug_clang_tidy"
],
"tasks": [
{
"name": "test: lint host_debug",
"parameters": [
"--variant",
"host_debug",
"host_debug_clang_tidy",
"--lint-all",
"--shard-id=2",
"--shard-variants=host_debug,host_debug,host_debug"
"--shard-variants=host_debug_clang_tidy,host_debug_clang_tidy,host_debug_clang_tidy"
],
"max_attempts": 1,
"max_attempts": 1,
"script": "flutter/ci/clang_tidy.sh"
}
]
@@ -136,20 +139,19 @@
"download_android_deps": false
},
"dependencies": [
"host_debug",
"android_debug_arm64"
"host_debug_clang_tidy"
],
"tasks": [
{
"name": "test: lint host_debug",
"parameters": [
"--variant",
"host_debug",
"host_debug_clang_tidy",
"--lint-all",
"--shard-id=3",
"--shard-variants=host_debug,host_debug,host_debug"
"--shard-variants=host_debug_clang_tidy,host_debug_clang_tidy,host_debug_clang_tidy"
],
"max_attempts": 1,
"max_attempts": 1,
"script": "flutter/ci/clang_tidy.sh"
}
]
@@ -163,20 +165,20 @@
"cores=32"
],
"dependencies": [
"host_debug",
"android_debug_arm64"
"host_debug_clang_tidy",
"android_debug_arm64_clang_tidy"
],
"tasks": [
{
"name": "test: lint android_debug_arm64",
"parameters": [
"--variant",
"android_debug_arm64",
"android_debug_arm64_clang_tidy",
"--lint-all",
"--shard-id=0",
"--shard-variants=host_debug,host_debug,host_debug,host_debug"
"--shard-variants=host_debug_clang_tidy,host_debug_clang_tidy,host_debug_clang_tidy,host_debug_clang_tidy"
],
"max_attempts": 1,
"max_attempts": 1,
"script": "flutter/ci/clang_tidy.sh"
}
]

View File

@@ -4,10 +4,10 @@
"archives": [
{
"name": "host_debug",
"base_path": "out/host_debug/zip_archives/",
"base_path": "out/host_debug_desktop/zip_archives/",
"type": "gcs",
"include_paths": [
"out/host_debug/zip_archives/linux-x64-debug/linux-x64-flutter-gtk.zip"
"out/host_debug_desktop/zip_archives/linux-x64-debug/linux-x64-flutter-gtk.zip"
],
"realm": "production"
}
@@ -26,11 +26,13 @@
"--enable-fontconfig",
"--prebuilt-dart-sdk",
"--rbe",
"--no-goma"
"--no-goma",
"--target-dir",
"host_debug_desktop"
],
"name": "host_debug",
"name": "host_debug_desktop",
"ninja": {
"config": "host_debug",
"config": "host_debug_desktop",
"targets": [
"flutter/shell/platform/linux:flutter_gtk"
]
@@ -40,10 +42,10 @@
"archives": [
{
"name": "host_profile",
"base_path": "out/host_profile/zip_archives/",
"base_path": "out/host_profile_desktop/zip_archives/",
"type": "gcs",
"include_paths": [
"out/host_profile/zip_archives/linux-x64-profile/linux-x64-flutter-gtk.zip"
"out/host_profile_desktop/zip_archives/linux-x64-profile/linux-x64-flutter-gtk.zip"
],
"realm": "production"
}
@@ -63,11 +65,13 @@
"--enable-fontconfig",
"--prebuilt-dart-sdk",
"--rbe",
"--no-goma"
"--no-goma",
"--target-dir",
"host_profile_desktop"
],
"name": "host_profile",
"name": "host_profile_desktop",
"ninja": {
"config": "host_profile",
"config": "host_profile_desktop",
"targets": [
"flutter/shell/platform/linux:flutter_gtk"
]
@@ -77,10 +81,10 @@
"archives": [
{
"name": "host_release",
"base_path": "out/host_release/zip_archives/",
"base_path": "out/host_release_desktop/zip_archives/",
"type": "gcs",
"include_paths": [
"out/host_release/zip_archives/linux-x64-release/linux-x64-flutter-gtk.zip"
"out/host_release_desktop/zip_archives/linux-x64-release/linux-x64-flutter-gtk.zip"
],
"realm": "production"
}
@@ -99,11 +103,13 @@
"--enable-fontconfig",
"--prebuilt-dart-sdk",
"--rbe",
"--no-goma"
"--no-goma",
"--target-dir",
"host_release_desktop"
],
"name": "host_release",
"name": "host_release_desktop",
"ninja": {
"config": "host_release",
"config": "host_release_desktop",
"targets": [
"flutter/shell/platform/linux:flutter_gtk"
]

View File

@@ -14,11 +14,13 @@
"debug",
"--prebuilt-dart-sdk",
"--no-lto",
"--force-mac-arm64"
"--force-mac-arm64",
"--target-dir",
"host_debug_clang_tidy"
],
"name": "host_debug",
"name": "host_debug_clang_tidy",
"ninja": {
"config": "host_debug"
"config": "host_debug_clang_tidy"
}
},
{
@@ -36,11 +38,13 @@
"debug",
"--simulator",
"--no-lto",
"--force-mac-arm64"
"--force-mac-arm64",
"--target-dir",
"ios_debug_sim_clang_tidy"
],
"name": "ios_debug_sim",
"name": "ios_debug_sim_clang_tidy",
"ninja": {
"config": "ios_debug_sim"
"config": "ios_debug_sim_clang_tidy"
}
}
],
@@ -57,7 +61,7 @@
"download_android_deps": false
},
"dependencies": [
"host_debug"
"host_debug_clang_tidy"
],
"contexts": [
"osx_sdk"
@@ -67,10 +71,10 @@
"name": "test: lint host_debug",
"parameters": [
"--variant",
"host_debug",
"host_debug_clang_tidy",
"--lint-all",
"--shard-id=0",
"--shard-variants=host_debug,host_debug,host_debug"
"--shard-variants=host_debug_clang_tidy,host_debug_clang_tidy,host_debug_clang_tidy"
],
"max_attempts": 1,
"script": "flutter/ci/clang_tidy.sh"
@@ -89,7 +93,7 @@
"download_android_deps": false
},
"dependencies": [
"host_debug"
"host_debug_clang_tidy"
],
"contexts": [
"osx_sdk"
@@ -99,10 +103,10 @@
"name": "test: lint host_debug",
"parameters": [
"--variant",
"host_debug",
"host_debug_clang_tidy",
"--lint-all",
"--shard-id=1",
"--shard-variants=host_debug,host_debug,host_debug"
"--shard-variants=host_debug_clang_tidy,host_debug_clang_tidy,host_debug_clang_tidy"
],
"max_attempts": 1,
"script": "flutter/ci/clang_tidy.sh"
@@ -121,7 +125,7 @@
"download_android_deps": false
},
"dependencies": [
"host_debug"
"host_debug_clang_tidy"
],
"contexts": [
"osx_sdk"
@@ -131,10 +135,10 @@
"name": "test: lint host_debug",
"parameters": [
"--variant",
"host_debug",
"host_debug_clang_tidy",
"--lint-all",
"--shard-id=2",
"--shard-variants=host_debug,host_debug,host_debug"
"--shard-variants=host_debug_clang_tidy,host_debug_clang_tidy,host_debug_clang_tidy"
],
"max_attempts": 1,
"script": "flutter/ci/clang_tidy.sh"
@@ -153,7 +157,7 @@
"download_android_deps": false
},
"dependencies": [
"host_debug"
"host_debug_clang_tidy"
],
"contexts": [
"osx_sdk"
@@ -163,10 +167,10 @@
"name": "test: lint host_debug",
"parameters": [
"--variant",
"host_debug",
"host_debug_clang_tidy",
"--lint-all",
"--shard-id=3",
"--shard-variants=host_debug,host_debug,host_debug"
"--shard-variants=host_debug_clang_tidy,host_debug_clang_tidy,host_debug_clang_tidy"
],
"max_attempts": 1,
"script": "flutter/ci/clang_tidy.sh"
@@ -185,8 +189,8 @@
"download_android_deps": false
},
"dependencies": [
"host_debug",
"ios_debug_sim"
"host_debug_clang_tidy",
"ios_debug_sim_clang_tidy"
],
"contexts": [
"osx_sdk"
@@ -196,10 +200,10 @@
"name": "test: lint ios_debug_sim",
"parameters": [
"--variant",
"ios_debug_sim",
"ios_debug_sim_clang_tidy",
"--lint-all",
"--shard-id=0",
"--shard-variants=host_debug"
"--shard-variants=host_debug_clang_tidy"
],
"max_attempts": 1,
"script": "flutter/ci/clang_tidy.sh"

View File

@@ -1,14 +1,6 @@
{
"builds": [
{
"archives": [
{
"base_path": "out/host_debug_unopt/zip_archives/",
"type": "gcs",
"include_paths": [],
"name": "host_debug_unopt"
}
],
"drone_dimensions": [
"device_type=none",
"os=Mac-13",
@@ -56,14 +48,6 @@
]
},
{
"archives": [
{
"base_path": "out/ios_debug_sim/zip_archives/",
"type": "gcs",
"include_paths": [],
"name": "ios_debug_sim"
}
],
"properties": {
"$flutter/osx_sdk": {
"runtime_versions": [
@@ -89,11 +73,13 @@
"--no-lto",
"--rbe",
"--no-goma",
"--xcode-symlinks"
"--xcode-symlinks",
"--target-dir",
"ios_debug_unopt_sim"
],
"name": "ios_debug_sim",
"name": "ios_debug_unopt_sim",
"ninja": {
"config": "ios_debug_sim",
"config": "ios_debug_unopt_sim",
"targets": [
"flutter/testing/scenario_app",
"flutter/shell/platform/darwin/ios:ios_test_flutter"
@@ -102,37 +88,28 @@
"tests": [
{
"language": "python3",
"name": "Tests for ios_debug_sim",
"name": "Tests for ios_debug_unopt_sim",
"script": "flutter/testing/run_tests.py",
"parameters": [
"--variant",
"ios_debug_sim",
"ios_debug_unopt_sim",
"--type",
"objc",
"--engine-capture-core-dump",
"--ios-variant",
"ios_debug_sim"
"ios_debug_unopt_sim"
]
},
{
"name": "Scenario App Integration Tests",
"parameters": [
"ios_debug_sim"
"ios_debug_unopt_sim"
],
"script": "flutter/testing/scenario_app/run_ios_tests.sh"
}
]
},
{
"archives": [
{
"base_path": "out/host_debug_unopt_arm64/zip_archives/",
"type": "gcs",
"include_paths": [
],
"name": "host_debug_unopt_arm64"
}
],
"drone_dimensions": [
"device_type=none",
"os=Mac-13",
@@ -168,15 +145,6 @@
}
},
{
"archives": [
{
"base_path": "out/ios_debug_sim_arm64/zip_archives/",
"type": "gcs",
"include_paths": [
],
"name": "ios_debug_sim_arm64"
}
],
"properties": {
"$flutter/osx_sdk": {
"runtime_versions": [
@@ -205,11 +173,13 @@
"arm64",
"--rbe",
"--no-goma",
"--xcode-symlinks"
"--xcode-symlinks",
"--target-dir",
"ios_debug_unopt_sim_arm64"
],
"name": "ios_debug_sim_arm64",
"name": "ios_debug_unopt_sim_arm64",
"ninja": {
"config": "ios_debug_sim_arm64",
"config": "ios_debug_unopt_sim_arm64",
"targets": [
"flutter/testing/scenario_app",
"flutter/shell/platform/darwin/ios:ios_test_flutter"
@@ -218,22 +188,22 @@
"tests": [
{
"language": "python3",
"name": "Tests for ios_debug_sim_arm64",
"name": "Tests for ios_debug_unopt_sim_arm64",
"script": "flutter/testing/run_tests.py",
"parameters": [
"--variant",
"ios_debug_sim_arm64",
"ios_debug_unopt_sim_arm64",
"--type",
"objc",
"--engine-capture-core-dump",
"--ios-variant",
"ios_debug_sim_arm64"
"ios_debug_unopt_sim_arm64"
]
},
{
"name": "Scenario App Integration Tests",
"parameters": [
"ios_debug_sim_arm64"
"ios_debug_unopt_sim_arm64"
],
"script": "flutter/testing/scenario_app/run_ios_tests.sh"
}
@@ -241,15 +211,6 @@
]
},
{
"archives": [
{
"base_path": "out/ios_debug_sim_arm64_extension_safe/zip_archives/",
"type": "gcs",
"include_paths": [
],
"name": "ios_debug_sim_arm64_extension_safe"
}
],
"properties": {
"$flutter/osx_sdk": {
"runtime_versions": [
@@ -279,11 +240,13 @@
"--darwin-extension-safe",
"--rbe",
"--no-goma",
"--xcode-symlinks"
"--xcode-symlinks",
"--target-dir",
"ios_debug_unopt_sim_arm64_extension_safe"
],
"name": "ios_debug_sim_arm64_extension_safe",
"name": "ios_debug_unopt_sim_arm64_extension_safe",
"ninja": {
"config": "ios_debug_sim_arm64_extension_safe",
"config": "ios_debug_unopt_sim_arm64_extension_safe",
"targets": [
"flutter/testing/scenario_app",
"flutter/shell/platform/darwin/ios:ios_test_flutter"
@@ -292,26 +255,25 @@
"tests": [
{
"language": "python3",
"name": "Tests for ios_debug_sim_arm64_extension_safe",
"name": "Tests for ios_debug_unopt_sim_arm64_extension_safe",
"script": "flutter/testing/run_tests.py",
"parameters": [
"--variant",
"ios_debug_sim_arm64_extension_safe",
"ios_debug_unopt_sim_arm64_extension_safe",
"--type",
"objc",
"--engine-capture-core-dump",
"--ios-variant",
"ios_debug_sim_arm64_extension_safe"
"ios_debug_unopt_sim_arm64_extension_safe"
]
},
{
"name": "Scenario App Integration Tests",
"parameters": [
"ios_debug_sim_arm64_extension_safe"
"ios_debug_unopt_sim_arm64_extension_safe"
],
"script": "flutter/testing/scenario_app/run_ios_tests.sh"
}
]
}
]

View File

@@ -62,12 +62,12 @@ def get_out_dir(args):
if args.macos_enable_metal:
target_dir.append('metal')
if args.target_dir != '':
target_dir = [args.target_dir]
if args.darwin_extension_safe:
target_dir.append('extension_safe')
if args.target_dir != '':
target_dir = [args.target_dir]
return os.path.join(args.out_dir, 'out', '_'.join(target_dir))

View File

@@ -7,6 +7,7 @@ import 'dart:io' as io;
import 'package:engine_build_configs/engine_build_configs.dart';
import 'package:engine_repo_tools/engine_repo_tools.dart';
import 'package:path/path.dart' as p;
import 'package:platform/platform.dart';
// Usage:
// $ dart bin/check.dart [/path/to/engine/src]
@@ -64,4 +65,36 @@ void main(List<String> args) {
io.stderr.writeln(' $error');
}
}
// Check that global builds for the same platform are uniquely named.
final List<String> hostPlatforms = <String>[
Platform.linux, Platform.macOS, Platform.windows,
];
// For each host platform, a mapping from GlobalBuild.name to GlobalBuild.
final Map<String, Map<String, (BuildConfig, GlobalBuild)>> builds =
<String, Map<String, (BuildConfig, GlobalBuild)>>{};
for (final String platform in hostPlatforms) {
builds[platform] = <String, (BuildConfig, GlobalBuild)>{};
}
for (final String name in configs.keys) {
final BuildConfig buildConfig = configs[name]!;
for (final GlobalBuild build in buildConfig.builds) {
for (final String platform in hostPlatforms) {
if (!build.canRunOn(FakePlatform(operatingSystem: platform))) {
continue;
}
if (builds[platform]!.containsKey(build.name)) {
final (BuildConfig oldConfig, _) = builds[platform]![build.name]!;
io.stderr.writeln(
'${build.name} is duplicated.\n'
'\tFound definition in ${buildConfig.path}.\n'
'\tPrevious definition was in ${oldConfig.path}.',
);
io.exitCode = 1;
}
builds[platform]![build.name] = (buildConfig, build);
}
}
}
}