From 262651adbf6c387505b3b233ced301cee2668d43 Mon Sep 17 00:00:00 2001 From: Godofredo Contreras Date: Mon, 8 May 2023 13:16:10 -0700 Subject: [PATCH 1/6] Migrate mac host clang tidy to engine v2. This removes the additional gn command from the ci/lint tool and uses a single gn command. --- .ci.yaml | 7 ++++ .../standalone/mac_host_clang_tidy.json | 36 +++++++++++++++++++ ci/lint.sh | 5 --- 3 files changed, 43 insertions(+), 5 deletions(-) create mode 100644 ci/builders/standalone/mac_host_clang_tidy.json diff --git a/.ci.yaml b/.ci.yaml index 7a69c457ff91b..e568bda5a5fe7 100644 --- a/.ci.yaml +++ b/.ci.yaml @@ -376,6 +376,13 @@ targets: properties: config_name: mac_android_aot_engine + - name: Mac mac_host_clang_tidy + bringup: true + recipe: engine_v2/builder + timeout: 60 + properties: + config_name: mac_host_clang_tidy + - name: Mac mac_host_engine recipe: engine_v2/engine_v2 timeout: 60 diff --git a/ci/builders/standalone/mac_host_clang_tidy.json b/ci/builders/standalone/mac_host_clang_tidy.json new file mode 100644 index 0000000000000..9655f446356ad --- /dev/null +++ b/ci/builders/standalone/mac_host_clang_tidy.json @@ -0,0 +1,36 @@ +{ + "drone_dimensions": [ + "device_type=none", + "os=Mac-12", + "cpu=arm64", + "mac_model=Macmini8,1" + ], + "gclient_variables": { + "download_android_deps": false + }, + "gn": [ + "--runtime-mode", + "debug", + "--prebuilt-dart-sdk", + "--no-lto", + "--force-mac-arm64" + ], + "name": "host_debug", + "ninja": { + "config": "host_debug" + }, + "tests": [ + { + "language": "python3", + "name": "test: lint host_debug", + "parameters": [ + "--variant", + "host_debug", + "--lint-all", + "--shard-id=1", + "--shard-variants=ios_debug_sim" + ], + "script": "flutter/ci/lint.sh" + } + ] +} diff --git a/ci/lint.sh b/ci/lint.sh index adfc2be39c8f9..a66b9dad0e52e 100755 --- a/ci/lint.sh +++ b/ci/lint.sh @@ -42,11 +42,6 @@ else fix_flag="--fix" fi -COMPILE_COMMANDS="$SRC_DIR/out/host_debug/compile_commands.json" -if [ ! -f "$COMPILE_COMMANDS" ]; then - (cd "$SRC_DIR"; ./flutter/tools/gn) -fi - echo "$(date +%T) Running clang_tidy" cd "$SCRIPT_DIR" From ac0bc0a8792bee92ee4c215b2ece6178cebcfacd Mon Sep 17 00:00:00 2001 From: Godofredo Contreras Date: Mon, 8 May 2023 17:57:15 -0700 Subject: [PATCH 2/6] Set shard parameter correctly. --- ci/builders/standalone/mac_host_clang_tidy.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/builders/standalone/mac_host_clang_tidy.json b/ci/builders/standalone/mac_host_clang_tidy.json index 9655f446356ad..6f111d11a3632 100644 --- a/ci/builders/standalone/mac_host_clang_tidy.json +++ b/ci/builders/standalone/mac_host_clang_tidy.json @@ -28,7 +28,7 @@ "host_debug", "--lint-all", "--shard-id=1", - "--shard-variants=ios_debug_sim" + "--shard-variants=host_debug" ], "script": "flutter/ci/lint.sh" } From ba3d2095cd94b029c33198f973390f6da517eeeb Mon Sep 17 00:00:00 2001 From: Godofredo Contreras Date: Tue, 9 May 2023 12:13:43 -0700 Subject: [PATCH 3/6] Consolidate ios and host clang tidy. --- .ci.yaml | 6 +- ci/builders/mac_clang_tidy.json | 71 +++++++++++++++++++ .../standalone/mac_host_clang_tidy.json | 36 ---------- ci/lint.sh | 5 ++ 4 files changed, 79 insertions(+), 39 deletions(-) create mode 100644 ci/builders/mac_clang_tidy.json delete mode 100644 ci/builders/standalone/mac_host_clang_tidy.json diff --git a/.ci.yaml b/.ci.yaml index e568bda5a5fe7..505253d123f9e 100644 --- a/.ci.yaml +++ b/.ci.yaml @@ -376,12 +376,12 @@ targets: properties: config_name: mac_android_aot_engine - - name: Mac mac_host_clang_tidy + - name: Mac mac_clang_tidy bringup: true - recipe: engine_v2/builder + recipe: engine_v2/engine_v2 timeout: 60 properties: - config_name: mac_host_clang_tidy + config_name: mac_clang_tidy - name: Mac mac_host_engine recipe: engine_v2/engine_v2 diff --git a/ci/builders/mac_clang_tidy.json b/ci/builders/mac_clang_tidy.json new file mode 100644 index 0000000000000..735b4b4895c69 --- /dev/null +++ b/ci/builders/mac_clang_tidy.json @@ -0,0 +1,71 @@ +{ + "builds": [ + { + "drone_dimensions": [ + "device_type=none", + "os=Mac-12", + "cpu=arm64" + ], + "gclient_variables": { + "download_android_deps": false + }, + "gn": [ + "--runtime-mode", + "debug", + "--prebuilt-dart-sdk", + "--no-lto", + "--force-mac-arm64" + ], + "name": "host_debug", + "ninja": { + "config": "host_debug" + } + }, + { + "drone_dimensions": [ + "device_type=none", + "os=Mac-12", + "cpu=arm64" + ], + "gclient_variables": { + "download_android_deps": false + }, + "gn": [ + "--ios", + "--runtime-mode", + "debug", + "--simulator", + "--no-lto", + "--force-mac-arm64" + ], + "name": "ios_debug_sim", + "ninja": { + "config": "ios_debug_sim" + } + } + ], + "tests": [ + { + "name": "test: lint host_debug", + "parameters": [ + "--variant", + "host_debug", + "--lint-all", + "--shard-id=1", + "--shard-variants=ios_debug_sim" + ], + "script": "flutter/ci/lint.sh" + }, + { + "name": "test: lint ios_debug_sim", + "parameters": [ + "--variant", + "ios_debug_sim", + "--lint-all", + "--shard-id=0", + "--shard-variants=host_debug" + ], + "script": "flutter/ci/lint.sh" + } + ] +} diff --git a/ci/builders/standalone/mac_host_clang_tidy.json b/ci/builders/standalone/mac_host_clang_tidy.json deleted file mode 100644 index 6f111d11a3632..0000000000000 --- a/ci/builders/standalone/mac_host_clang_tidy.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "drone_dimensions": [ - "device_type=none", - "os=Mac-12", - "cpu=arm64", - "mac_model=Macmini8,1" - ], - "gclient_variables": { - "download_android_deps": false - }, - "gn": [ - "--runtime-mode", - "debug", - "--prebuilt-dart-sdk", - "--no-lto", - "--force-mac-arm64" - ], - "name": "host_debug", - "ninja": { - "config": "host_debug" - }, - "tests": [ - { - "language": "python3", - "name": "test: lint host_debug", - "parameters": [ - "--variant", - "host_debug", - "--lint-all", - "--shard-id=1", - "--shard-variants=host_debug" - ], - "script": "flutter/ci/lint.sh" - } - ] -} diff --git a/ci/lint.sh b/ci/lint.sh index a66b9dad0e52e..adfc2be39c8f9 100755 --- a/ci/lint.sh +++ b/ci/lint.sh @@ -42,6 +42,11 @@ else fix_flag="--fix" fi +COMPILE_COMMANDS="$SRC_DIR/out/host_debug/compile_commands.json" +if [ ! -f "$COMPILE_COMMANDS" ]; then + (cd "$SRC_DIR"; ./flutter/tools/gn) +fi + echo "$(date +%T) Running clang_tidy" cd "$SCRIPT_DIR" From 784b8a2eff046248806df83a4c9b58a688b28f69 Mon Sep 17 00:00:00 2001 From: Godofredo Contreras Date: Tue, 9 May 2023 14:55:26 -0700 Subject: [PATCH 4/6] Move test to generators to run from the same build. --- ci/builders/mac_clang_tidy.json | 50 +++++++++++++++++---------------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/ci/builders/mac_clang_tidy.json b/ci/builders/mac_clang_tidy.json index 735b4b4895c69..214d9c24bf90c 100644 --- a/ci/builders/mac_clang_tidy.json +++ b/ci/builders/mac_clang_tidy.json @@ -44,28 +44,30 @@ } } ], - "tests": [ - { - "name": "test: lint host_debug", - "parameters": [ - "--variant", - "host_debug", - "--lint-all", - "--shard-id=1", - "--shard-variants=ios_debug_sim" - ], - "script": "flutter/ci/lint.sh" - }, - { - "name": "test: lint ios_debug_sim", - "parameters": [ - "--variant", - "ios_debug_sim", - "--lint-all", - "--shard-id=0", - "--shard-variants=host_debug" - ], - "script": "flutter/ci/lint.sh" - } - ] + "generators": { + "tasks": [ + { + "name": "test: lint host_debug", + "parameters": [ + "--variant", + "host_debug", + "--lint-all", + "--shard-id=1", + "--shard-variants=ios_debug_sim" + ], + "script": "flutter/ci/lint.sh" + }, + { + "name": "test: lint ios_debug_sim", + "parameters": [ + "--variant", + "ios_debug_sim", + "--lint-all", + "--shard-id=0", + "--shard-variants=host_debug" + ], + "script": "flutter/ci/lint.sh" + } + ] + } } From b99fce60b6722e81bab78e25868a39e9f35b3003 Mon Sep 17 00:00:00 2001 From: Godofredo Contreras Date: Tue, 9 May 2023 19:51:08 -0700 Subject: [PATCH 5/6] Move out lint tasks to global tests. --- ci/builders/mac_clang_tidy.json | 84 +++++++++++++++++++++++---------- 1 file changed, 59 insertions(+), 25 deletions(-) diff --git a/ci/builders/mac_clang_tidy.json b/ci/builders/mac_clang_tidy.json index 214d9c24bf90c..6c742cd7951af 100644 --- a/ci/builders/mac_clang_tidy.json +++ b/ci/builders/mac_clang_tidy.json @@ -44,30 +44,64 @@ } } ], - "generators": { - "tasks": [ - { - "name": "test: lint host_debug", - "parameters": [ - "--variant", - "host_debug", - "--lint-all", - "--shard-id=1", - "--shard-variants=ios_debug_sim" - ], - "script": "flutter/ci/lint.sh" + "tests": [ + { + "name": "test: lint host_debug", + "recipe": "engine_v2/tester_engine", + "drone_dimensions": [ + "device_type=none", + "os=Mac", + "cpu=arm64" + ], + "gclient_variables": { + "download_android_deps": false }, - { - "name": "test: lint ios_debug_sim", - "parameters": [ - "--variant", - "ios_debug_sim", - "--lint-all", - "--shard-id=0", - "--shard-variants=host_debug" - ], - "script": "flutter/ci/lint.sh" - } - ] - } + "dependencies": [ + "host_debug", + "ios_debug_sim" + ], + "tasks": [ + { + "name": "test: lint host_debug", + "parameters": [ + "--variant", + "host_debug", + "--lint-all", + "--shard-id=1", + "--shard-variants=ios_debug_sim" + ], + "script": "flutter/ci/lint.sh" + } + ] + }, + { + "name": "test: lint host_debug", + "recipe": "engine_v2/tester_engine", + "drone_dimensions": [ + "device_type=none", + "os=Mac", + "cpu=arm64" + ], + "gclient_variables": { + "download_android_deps": false + }, + "dependencies": [ + "host_debug", + "ios_debug_sim" + ], + "tasks": [ + { + "name": "test: lint ios_debug_sim", + "parameters": [ + "--variant", + "ios_debug_sim", + "--lint-all", + "--shard-id=0", + "--shard-variants=host_debug" + ], + "script": "flutter/ci/lint.sh" + } + ] + } + ] } From a8f12aa594702e6c19177e54bbb2bf9a8c311d4d Mon Sep 17 00:00:00 2001 From: Godofredo Contreras Date: Tue, 9 May 2023 21:31:53 -0700 Subject: [PATCH 6/6] Update duplicated test name. --- ci/builders/mac_clang_tidy.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/builders/mac_clang_tidy.json b/ci/builders/mac_clang_tidy.json index 6c742cd7951af..9a710376ac8bd 100644 --- a/ci/builders/mac_clang_tidy.json +++ b/ci/builders/mac_clang_tidy.json @@ -75,7 +75,7 @@ ] }, { - "name": "test: lint host_debug", + "name": "test: lint ios_debug_sim", "recipe": "engine_v2/tester_engine", "drone_dimensions": [ "device_type=none",