Skip to content

[engine_tool] et rejects every Dart test target because their names contain a dot #192422

Closed

Description

@dzolotov

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

  1. added
    engineflutter/engine related. See also e: labels.
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    on Sep 8, 2026
  2. mbcorona commented on Sep 8, 2026

    @mbcorona
    Member

    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.

  3. added
    P2Important issues not at the top of the work list
    on Sep 14, 2026
  4. github-actions commented on Oct 2, 2026

    @github-actions

    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 -v and a minimal reproduction of the issue.

  5. locked as resolved and limited conversation to collaborators on Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listengineflutter/engine related. See also e: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onteam-engineOwned by Engine teamtriaged-engineTriaged by Engine team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions