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`](c17390e606/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](9a7492dc88/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](c17390e606/.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
This commit is contained in:
Jenn Magder
2024-10-23 16:01:15 -07:00
committed by GitHub
parent 4feca7ed3f
commit f399131af6
3 changed files with 50 additions and 2 deletions

View File

@@ -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:

View File

@@ -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",

View File

@@ -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"
]
}
]
}