Description
The PR flutter/engine#38448 , [web] Build multiple CanvasKit variants (using toolchain_args), has broken building without a prebuilt Dart SDK.
The gn command
python3 flutter/tools/gn --runtime-mode release --no-prebuilt-dart-sdk --web
now gives an error because it tries to copy from the prebuilt Dart SDK location. This is in the target
See //flutter/build/dart/BUILD.gn:21:3: whence it was called.
copy_trees("_copy_trees") {
Probably because of the change to run the CanvasKit build using a separate toolchain, and not using the args passed to gn,
the flutter_prebuilt_dart_sdk flag seems to be true when this target is hit from the CanvasKit build.
To reproduce the error, you need to delete the downloaded prebuilts from src/flutter/prebuilts.
This breaks all flutter tools on builds created from a tip-of-tree Dart or a tryjob with a patched Dart, such as the monorepo builds running on the Dart CI, now that the flutter tools download the platform-independent canvaskit. We cannot build and upload this canvaskit because the host-wasm build cannot run without a prebuilt Dart SDK.