dart-lang / build

A build system for Dart written in Dart
https://pub.dev/packages/build
BSD 3-Clause "New" or "Revised" License
791 stars 211 forks source link

`dart run build_runner build` Precompile build script failure (Flutter v3.24.0 ONLY) #3733

Closed kNoAPP closed 3 months ago

kNoAPP commented 3 months ago

Issue present after Flutter 3.24.0:

[INFO] Generating build script...
[INFO] Generating build script completed, took 406ms

[INFO] Precompiling build script......
Could not find a command named "/opt/hostedtoolcache/flutter/stable-3.24.0-x64/bin/cache/dart-sdk/bin/snapshots/frontend_server.dart.snapshot".

Usage: dart <command|dart-file> [arguments]

Global options:
-v, --verbose               Show additional command output.
    --version               Print the Dart SDK version.
    --enable-analytics      Enable analytics.
    --disable-analytics     Disable analytics.
    --suppress-analytics    Disallow analytics for this `dart *` run without changing the analytics configuration.
-h, --help                  Print this usage information.

Available commands:
  analyze    Analyze Dart code in a directory.
  compile    Compile Dart to various formats.
  create     Create a new Dart project.
  devtools   Open DevTools (optionally connecting to an existing application).
  doc        Generate API documentation for Dart projects.
  fix        Apply automated fixes to Dart source code.
  format     Idiomatically format Dart source code.
  info       Show diagnostic information about the installed tooling.
  pub        Work with packages.
  run        Run a Dart program.
  test       Run tests for a project.

Run "dart help <command>" for more information about a command.
See https://dart.dev/tools/dart-tool for detailed documentation.
[INFO] Precompiling build script... completed, took 126ms

[SEVERE] Failed to precompile build script .dart_tool/build/entrypoint/build.dart.
This is likely caused by a misconfigured builder definition.

Error: Process completed with exit code 78.

Ran via GitHub Actions, was working fine at Flutter 3.22.0 and earlier.

jakemac53 commented 3 months ago

@kNoAPP I believe this is the result of having an outdated frontend_server_client package (this is a transitive dependency, you won't have it in your own pubspec).

Can you run a flutter pub upgrade? Or, you can try adding frontend_server_client: ^4.0.0 to your dependencies in your pubspec and running flutter pub get.

If you are already on version 4.0.0 please let me know and I can investigate further.

kNoAPP commented 3 months ago

@jakemac53 Works like a charm. Thank you.