Skip to content

Commit 3ab8fab

Browse files
committed
Rename host_clang_cpu -> builder_cpu
Per @gaaclarke's review feedback on #187591 (BUILDCONFIG.gn:154). builder_cpu is clearer than host_clang_cpu: - Says what the var ROLE is (the build host's CPU) rather than what it IS (the CPU clang runs on). - Generic -- covers both the clang binary AND the build-time Dart SDK, not just clang. - Maps to existing CI vocabulary (LUCI "builder", "bot"). - Decouples the name from an implementation detail. Pure mechanical rename across 4 files. No behavioral change. Updated the declare_args() doc comment in BUILDCONFIG.gn to use the new name and reflect the broader scope.
1 parent a4a8ee8 commit 3ab8fab

4 files changed

Lines changed: 9 additions & 7 deletions

File tree

‎engine/src/build/config/BUILDCONFIG.gn‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,12 @@ declare_args() {
148148
is_clang = current_os == "mac" || current_os == "ios" ||
149149
current_os == "linux" || current_os == "chromeos"
150150

151-
# CPU arch of toolchain binaries that run on the build machine (clang, llvm
152-
# tools). Equals host_cpu normally; differs when cross-compiling host
153-
# binaries (e.g. linux-arm64 gen_snapshot on a linux-x64 builder).
154-
host_clang_cpu = host_cpu
151+
# CPU arch of the build machine itself -- the CPU that build-time toolchain
152+
# binaries (clang, dart) actually execute on. Equals host_cpu in the normal
153+
# case; diverges only when cross-compiling a host binary (e.g. linux-arm64
154+
# gen_snapshot on a linux-x64 builder), where host_cpu describes the produced
155+
# binary's runtime arch and builder_cpu describes the build machine's arch.
156+
builder_cpu = host_cpu
155157

156158
# Compile for Address Sanitizer to find memory bugs.
157159
is_asan = false

‎engine/src/build/toolchain/linux/BUILD.gn‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ if (use_rbe) {
3333
link_prefix = ""
3434
}
3535

36-
if (host_clang_cpu == "arm64") {
36+
if (builder_cpu == "arm64") {
3737
rebased_clang_dir =
3838
rebase_path("$buildtools_path/linux-arm64/clang/bin", root_build_dir)
3939
} else {

‎engine/src/flutter/common/config.gni‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ if (_host_os_name == "mac") {
118118
# When building 32-bit Android development artifacts for Windows host (like
119119
# gen_snapshot), the host_cpu is set to x86. However, the correct prebuilt
120120
# Dart SDK to use during this build is still the 64-bit one.
121-
_host_cpu = host_clang_cpu
121+
_host_cpu = builder_cpu
122122
if (host_os == "win" && host_cpu == "x86") {
123123
_host_cpu = "x64"
124124
}

‎engine/src/flutter/tools/gn‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ def to_gn_args(args):
532532
# Cross-compiling host binaries: clang toolchain + build-time Dart SDK must
533533
# match the build machine, not the (overridden) target host_cpu.
534534
if args.host_cpu and args.host_cpu != get_host_cpu():
535-
gn_args['host_clang_cpu'] = get_host_cpu()
535+
gn_args['builder_cpu'] = get_host_cpu()
536536

537537
if not args.build_engine_artifacts:
538538
gn_args['flutter_build_engine_artifacts'] = False

0 commit comments

Comments
 (0)