From f399131af6e6e6f86634d4c380236d8719b53b53 Mon Sep 17 00:00:00 2001 From: Jenn Magder Date: Wed, 23 Oct 2024 16:01:15 -0700 Subject: [PATCH] Add standalone 'Mac clangd' builder to replace 'Linux mac_clangd' orchestrator (flutter/engine#56014) "Orchestrator" builders are top-level builds that can perform some caching, kick off "drone" sub-builds, and then do things with those build artifacts like run tests, or "generators" that do work on those artifacts. See more details in https://flutter.dev/go/engine-build-definition-language. `Linux mac_clangd` is currently set up as an orchestrator builder, but it only kicks off one gn and one test that can be converted to a standalone build. `Linux mac_clangd` is confusingly named because the orchestrator is a Linux machine, but the drone is a Mac. Copy `Linux mac_clangd` into [`ci/builders/standalone`](https://github.com/flutter/engine/tree/c17390e606bf1ef5d64caf34c2e6d2fb5800fc1a/ci/builders/standalone) and reference it in a new `Mac clangd` build in `bringup`. Note since we want to rename the builder it can't replace `Linux mac_clangd` in the same commit. I will follow up and remove `Linux mac_clangd` once `Mac clangd` `bringup` is removed. Unfortunately that means we lose commit history. Differences from [ci/builders/mac_unopt_debug_no_rbe.json](https://github.com/flutter/engine/blob/9a7492dc886374eff8f44f47b1a8eb73bba6bc13/ci/builders/mac_unopt_debug_no_rbe.json) to the standalone version: 1. Remove the drone_dimensions `device_type` and `os` and `$flutter/osx_sdk` property `sdk_version` since they are [already set via the "Mac" builder name](https://github.com/flutter/engine/blob/c17390e606bf1ef5d64caf34c2e6d2fb5800fc1a/.ci.yaml#L26-L37). Remove `mac_model` since there's no reason to specify hardware except for benchmarks afaik. `Macmini8,1` used to need to be specified to run on an Intel Mac before the `cpu` property was supported. 2. Remove `timeout` (default back to 30 minutes) since the timeout was added for the cold cache orchestrator timeouts (https://github.com/flutter/engine/pull/55988). I repurposed non-bringup `Mac mac_unopt` to test the standalone config (and then reverted it) ([result](https://ci.chromium.org/ui/p/flutter/builders/try/Mac%20mac_unopt/10479/infra)). Here's the passing clangd test: https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8733402970006982913/+/u/test:_clangd/stdout I also renamed linux_unopt_debug_no_rbe.json to linux_clangd.json to match and added cas_archive (see https://github.com/flutter/engine/pull/56014#pullrequestreview-2385392205). Part of https://github.com/flutter/flutter/issues/155041 Fixes https://github.com/flutter/flutter/issues/157275 [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style --- engine/src/flutter/.ci.yaml | 11 ++++- ...pt_debug_no_rbe.json => linux_clangd.json} | 1 + .../ci/builders/standalone/mac_clangd.json | 40 +++++++++++++++++++ 3 files changed, 50 insertions(+), 2 deletions(-) rename engine/src/flutter/ci/builders/standalone/{linux_unopt_debug_no_rbe.json => linux_clangd.json} (97%) create mode 100644 engine/src/flutter/ci/builders/standalone/mac_clangd.json diff --git a/engine/src/flutter/.ci.yaml b/engine/src/flutter/.ci.yaml index 239cce5468..0e2436dca7 100644 --- a/engine/src/flutter/.ci.yaml +++ b/engine/src/flutter/.ci.yaml @@ -406,7 +406,7 @@ targets: - name: Linux clangd recipe: engine_v2/builder properties: - config_name: linux_unopt_debug_no_rbe + config_name: linux_clangd - name: Linux linux_unopt recipe: engine_v2/engine_v2 @@ -503,7 +503,7 @@ targets: drone_dimensions: - os=Mac-13|Mac-14 - # Avoid using a Mac orchestrator to save ~5 minutes of Mac host time. + # TODO(jmagman) Replace with "Mac clangd" when bringup is removed. - name: Linux mac_clangd recipe: engine_v2/engine_v2 timeout: 90 @@ -514,6 +514,13 @@ targets: properties: config_name: mac_unopt_debug_no_rbe + - name: Mac clangd + recipe: engine_v2/builder + bringup: true + properties: + config_name: mac_clangd + cpu: x86 + - name: Mac mac_unopt recipe: engine_v2/engine_v2 properties: diff --git a/engine/src/flutter/ci/builders/standalone/linux_unopt_debug_no_rbe.json b/engine/src/flutter/ci/builders/standalone/linux_clangd.json similarity index 97% rename from engine/src/flutter/ci/builders/standalone/linux_unopt_debug_no_rbe.json rename to engine/src/flutter/ci/builders/standalone/linux_clangd.json index 05a775a1ca..7dc297eb0a 100644 --- a/engine/src/flutter/ci/builders/standalone/linux_unopt_debug_no_rbe.json +++ b/engine/src/flutter/ci/builders/standalone/linux_clangd.json @@ -7,6 +7,7 @@ "targets are specified, the build will fail, and if an empty list of ", "targets are specified, all targets are built (wasteful/slow)" ], + "cas_archive": false, "gn": [ "--runtime-mode", "debug", diff --git a/engine/src/flutter/ci/builders/standalone/mac_clangd.json b/engine/src/flutter/ci/builders/standalone/mac_clangd.json new file mode 100644 index 0000000000..4f7b01c033 --- /dev/null +++ b/engine/src/flutter/ci/builders/standalone/mac_clangd.json @@ -0,0 +1,40 @@ +{ + "_comment": [ + "This build is only used to generate compile_commands.json for clangd ", + "and should not be used for any other purpose.", + "", + "Note the `flutter/tools/font_subset` target is only used because if no ", + "targets are specified, the build will fail, and if an empty list of ", + "targets are specified, all targets are built (wasteful/slow)" + ], + "cas_archive": false, + "gn": [ + "--runtime-mode", + "debug", + "--unoptimized", + "--prebuilt-dart-sdk", + "--no-lto", + "--no-rbe", + "--no-goma", + "--xcode-symlinks", + "--target-dir", + "ci/mac_unopt_debug_no_rbe" + ], + "name": "ci/mac_unopt_debug_no_rbe", + "description": "Tests clangd on macOS.", + "ninja": { + "config": "ci/mac_unopt_debug_no_rbe", + "targets": ["flutter/tools/font_subset"] + }, + "tests": [ + { + "language": "dart", + "name": "clangd", + "script": "flutter/tools/clangd_check/bin/main.dart", + "parameters": [ + "--clangd=buildtools/mac-x64/clang/bin/clangd", + "--compile-commands-dir=../out/ci/mac_unopt_debug_no_rbe" + ] + } + ] +}