From 4c24fe14c6483e863c64470fa3bfb022a85e5f7b Mon Sep 17 00:00:00 2001 From: Zach Anderson Date: Mon, 19 Feb 2024 10:31:07 -0800 Subject: [PATCH] Make global builds uniquely named per platform --- ci/builders/linux_android_emulator.json | 24 +++-- .../linux_android_emulator_api_33.json | 12 ++- .../linux_android_emulator_opengles.json | 10 +- ci/builders/linux_clang_tidy.json | 60 ++++++------ ci/builders/linux_host_desktop_engine.json | 36 +++++--- ci/builders/mac_clang_tidy.json | 48 +++++----- ci/builders/mac_unopt.json | 92 ++++++------------- tools/gn | 6 +- tools/pkg/engine_build_configs/bin/check.dart | 33 +++++++ 9 files changed, 168 insertions(+), 153 deletions(-) diff --git a/ci/builders/linux_android_emulator.json b/ci/builders/linux_android_emulator.json index 2ed81249af4b9..7217a14ee08be 100644 --- a/ci/builders/linux_android_emulator.json +++ b/ci/builders/linux_android_emulator.json @@ -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" ] diff --git a/ci/builders/linux_android_emulator_api_33.json b/ci/builders/linux_android_emulator_api_33.json index 2457782fda800..104793a23c56e 100644 --- a/ci/builders/linux_android_emulator_api_33.json +++ b/ci/builders/linux_android_emulator_api_33.json @@ -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" ] } ] diff --git a/ci/builders/linux_android_emulator_opengles.json b/ci/builders/linux_android_emulator_opengles.json index 91d691ac80ff6..4f74f628e0982 100644 --- a/ci/builders/linux_android_emulator_opengles.json +++ b/ci/builders/linux_android_emulator_opengles.json @@ -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" ] diff --git a/ci/builders/linux_clang_tidy.json b/ci/builders/linux_clang_tidy.json index c80a985ac3417..18134dee42f92 100644 --- a/ci/builders/linux_clang_tidy.json +++ b/ci/builders/linux_clang_tidy.json @@ -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" } ] diff --git a/ci/builders/linux_host_desktop_engine.json b/ci/builders/linux_host_desktop_engine.json index 686a374276b1e..29393e3a6b976 100644 --- a/ci/builders/linux_host_desktop_engine.json +++ b/ci/builders/linux_host_desktop_engine.json @@ -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" ] diff --git a/ci/builders/mac_clang_tidy.json b/ci/builders/mac_clang_tidy.json index ece0afa5fd236..b691ed787a792 100644 --- a/ci/builders/mac_clang_tidy.json +++ b/ci/builders/mac_clang_tidy.json @@ -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" diff --git a/ci/builders/mac_unopt.json b/ci/builders/mac_unopt.json index 71e72c6612cd9..dc6f18b3a88df 100644 --- a/ci/builders/mac_unopt.json +++ b/ci/builders/mac_unopt.json @@ -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" } - ] } ] diff --git a/tools/gn b/tools/gn index 05db32eeef80f..c81f35fe6ff73 100755 --- a/tools/gn +++ b/tools/gn @@ -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)) diff --git a/tools/pkg/engine_build_configs/bin/check.dart b/tools/pkg/engine_build_configs/bin/check.dart index 0eb959fed6cd9..250c0c8fe736c 100644 --- a/tools/pkg/engine_build_configs/bin/check.dart +++ b/tools/pkg/engine_build_configs/bin/check.dart @@ -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 args) { io.stderr.writeln(' $error'); } } + + // Check that global builds for the same platform are uniquely named. + final List hostPlatforms = [ + Platform.linux, Platform.macOS, Platform.windows, + ]; + + // For each host platform, a mapping from GlobalBuild.name to GlobalBuild. + final Map> builds = + >{}; + for (final String platform in hostPlatforms) { + builds[platform] = {}; + } + 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); + } + } + } }