Repository navigation
Description
Steps to reproduce
testing/dart/BUILD.gn generates one compile target per Dart test file, and the file name is part of the target name:
foreach(test, tests) {
flutter_frontend_server("compile_$test") { ... }
}so the targets are compile_gpu_test.dart, compile_assets_test.dart, and so on — 55 of them. et refuses every one of them, and the group that depends on them:
$ et build -c host_debug_unopt_arm64 //flutter/testing/dart:compile_gpu_test.dart
ERROR: FormatException: Target name must be a valid identifier.
compile_gpu_test.dart
#0 new Label (package:engine_tool/src/label.dart:37:7)
#1 new TargetPattern (package:engine_tool/src/label.dart:167:19)
#2 TargetPattern.parse (package:engine_tool/src/label.dart:184:12)
#3 BuildCommand.run (package:engine_tool/src/commands/build_command.dart:54:50)
$ et build -c host_debug_unopt_arm64 //flutter/testing/dart:dart
ERROR: FormatException: Target name must be a valid identifier.
compile_assets_test.dart
#0 new Label (package:engine_tool/src/label.dart:37:7)
#1 Label.parse (package:engine_tool/src/label.dart:53:12)
#2 Label.parseGn (package:engine_tool/src/label.dart:70:18)
The group fails too, because it enumerates its dependencies and parses each one.
Expected results
et build and et test accept these labels, since GN accepts them and the engine's own build files produce them. ninja -t targets all lists flutter/testing/dart:compile_gpu_test.dart alongside everything else.
Actual results
Every Dart test target in the engine is unreachable through et. Building one means dropping to ninja directly:
ninja -C engine/src/out/host_debug_unopt_arm64 gen/gpu_test.dart.dill
which works, so this is the label parser rather than the build.
Cause
engine/src/flutter/tools/engine_tool/lib/src/label.dart:
static final RegExp _identifier = RegExp(r'^[a-zA-Z_][a-zA-Z0-9_-]*$');The same pattern validates both package components and target names, and it has no ., so any target whose name carries a file extension is rejected.
Suggested fix
Allow . in target names. Package components can stay as they are — no directory in the engine tree has a dot in its name, while target names with one are generated by the repository's own BUILD.gn.
Happy to send a PR with a regression test in engine_tool/test/label_test.dart, next to the existing "rejects other invalid characters" case.
Context
Found while running the Dart-side flutter_gpu tests for #192398 on a fresh engine checkout: the documented et path did not work for them, and it took a while to conclude the checkout was fine and the tool was not.
Activity
mbcorona commentedon Sep 8, 2026
Hi @dzolotov, thanks for tracing this to the parser and linking PR #192423, which scopes the dot to target names only and keeps package paths strict. Routing to the engine team for evaluation.
[engine_tool] Allow a dot in GN target names (flutter#192423)
github-actions commentedon Oct 2, 2026
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.