Repository navigation
fix(cli): use the precompiled DDC SDK from kernel/ddc/canary on Flutter 3.50 - #1000
Conversation
Package Version ReportThe following packages have been updated: |
There was a problem hiding this comment.
🟢 Approval recommended
There are no active review issues blocking approval.
No open issues 🎉
What changed in this PR
Fixes #999 by updating the CLI’s development build configuration to find Flutter 3.50’s relocated precompiled DDC SDK, while preserving compatibility with older Flutter layouts.
Changes:
- Adds SDK path selection that prefers
kernel/ddc/canaryfor DDC library bundles and falls back to the legacy location. - Updates development commands to use the helper; AMD behavior remains unchanged.
- Adds a regression test for the Flutter 3.50 layout and documents the fix in the changelog.
| File | Description |
|---|---|
packages/jaspr/CHANGELOG.md |
Records the Flutter 3.50 development-build fix. |
packages/jaspr_cli/test/src/commands/serve_command_test.dart |
Verifies build arguments select the canary SDK in the new layout. |
packages/jaspr_cli/lib/src/dev/flutter_runner.dart |
Adds and documents SDK directory selection with legacy fallback. |
packages/jaspr_cli/lib/src/commands/dev_command.dart |
Uses the helper to configure the prebuilt SDK path. |
Review effort: Balanced
schultek
left a comment
There was a problem hiding this comment.
Thanks. Two small things:
- Please put the changelog entry under a new
## Unreleased 0.24.0-beta.2headline. - Please also fix the
sdkJsPathfor the build command.
…, move the changelog entry to 0.24.0-beta.2
|
Done, both in the last commit:
One side effect: |
Fixes #999
Flutter 3.50 moved the precompiled DDC SDK in
flutter_web_sdkfromkernel/ddcLibraryBundle-canvaskitandkernel/amd-canvaskittokernel/ddc/canaryandkernel/ddc/stable, and no longer ships an AMD build.jaspr servewith Flutter embedding or plugins still pointedbuild_web_compilers:sdk_js=use-prebuilt-sdk-from-pathat the old folder, so the initial build failed withPrebuilt SDK file "dart_sdk.js" does not exist. This is also why theTest CLIjobs with Flutter (cnen, cspn, smpn, snpn, vnen) fail onmain. They pass with this PR.Which folder
From
engine/src/flutter/web_sdk/BUILD.gn:amd-canvaskitis compiled with--modules amd,ddcLibraryBundle-canvaskitwith--modules ddcand--canary.ddc/stableis compiled with--modules ddc,ddc/canarywith--modules ddcand--canary.build_web_compilerscompiles DDC library bundles with--canary(sdk_js_compile_builder.dart:if (canaryFeatures || ddcLibraryBundle) '--canary'), and jaspr enablescanaryFeaturesin DWDS for theddcmodule format. Sokernel/ddc/canaryis the match for the oldddcLibraryBundle-canvaskit. Without DDC library bundles it compiles without--canary, sokernel/ddc/stableis the closest match for the oldamd-canvaskit.This PR
FlutterRunner.precompiledDdcSdkDir(webSdkDir, ddcLibraryBundle: …). For DDC library bundles it useskernel/ddc/canarywhen it exists, otherwisekernel/ddcLibraryBundle-canvaskitas before. Without them it useskernel/ddc/stablewhen it exists, otherwisekernel/amd-canvaskitas before.dev_command.dartandbuild_command.dartuse it instead of building the path themselves.Not changed:
--module-format=amd): Flutter no longer ships an AMD SDK, so there is no matching folder. It now getskernel/ddc/stableand stays broken. Happy to add a clear error message if you prefer.Tests:
serve_command_test.dart: Flutter embedding with a fake web SDK in the 3.50 layout (kernel/ddc/{canary,stable}/dart_sdk.js). The build args must point tokernel/ddc/canary. Fails without the fix.build_command_test.dart: the same layout forjaspr build. The build args must point tokernel/ddc/stable. Fails without the fix.main, pass on this PR.Type of Change
Ready Checklist
the semantic_changelog format.
///).