Skip to content

fix(cli): use the precompiled DDC SDK from kernel/ddc/canary on Flutter 3.50 - #1000

Merged
schultek merged 2 commits into
schultek:mainfrom
lewinpauli:fix/flutter-350-ddc-sdk-path
Nov 18, 2026
Merged

schultek merged 2 commits into
schultek:mainfrom
lewinpauli:fix/flutter-350-ddc-sdk-path

Conversation

@lewinpauli

@lewinpauli lewinpauli commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #999

Flutter 3.50 moved the precompiled DDC SDK in flutter_web_sdk from kernel/ddcLibraryBundle-canvaskit and kernel/amd-canvaskit to kernel/ddc/canary and kernel/ddc/stable, and no longer ships an AMD build. jaspr serve with Flutter embedding or plugins still pointed build_web_compilers:sdk_js=use-prebuilt-sdk-from-path at the old folder, so the initial build failed with Prebuilt SDK file "dart_sdk.js" does not exist. This is also why the Test CLI jobs with Flutter (cnen, cspn, smpn, snpn, vnen) fail on main. They pass with this PR.

Which folder

From engine/src/flutter/web_sdk/BUILD.gn:

  • 3.47.9: amd-canvaskit is compiled with --modules amd, ddcLibraryBundle-canvaskit with --modules ddc and --canary.
  • 3.50.0: ddc/stable is compiled with --modules ddc, ddc/canary with --modules ddc and --canary.

build_web_compilers compiles DDC library bundles with --canary (sdk_js_compile_builder.dart: if (canaryFeatures || ddcLibraryBundle) '--canary'), and jaspr enables canaryFeatures in DWDS for the ddc module format. So kernel/ddc/canary is the match for the old ddcLibraryBundle-canvaskit. Without DDC library bundles it compiles without --canary, so kernel/ddc/stable is the closest match for the old amd-canvaskit.

This PR

  • Adds FlutterRunner.precompiledDdcSdkDir(webSdkDir, ddcLibraryBundle: …). For DDC library bundles it uses kernel/ddc/canary when it exists, otherwise kernel/ddcLibraryBundle-canvaskit as before. Without them it uses kernel/ddc/stable when it exists, otherwise kernel/amd-canvaskit as before.
  • dev_command.dart and build_command.dart use it instead of building the path themselves.

Not changed:

  • AMD with Flutter 3.50 (--module-format=amd): Flutter no longer ships an AMD SDK, so there is no matching folder. It now gets kernel/ddc/stable and 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 to kernel/ddc/canary. Fails without the fix.
  • build_command_test.dart: the same layout for jaspr build. The build args must point to kernel/ddc/stable. Fails without the fix.
  • The existing tests with Flutter embedding still cover the pre-3.50 layout.
  • The CI integration jobs with Flutter 3.50 (cnen, cspn, smpn, snpn, vnen), which fail on main, pass on this PR.

Type of Change

  • 🛠️ Bug fix

Ready Checklist

  • I've read the Contribution Guide.
  • In case this PR changes one of the core packages, I've modified the respective CHANGELOG.md file using
    the semantic_changelog format.
  • I updated/added relevant documentation (doc comments with ///).
  • I added myself to the AUTHORS file (optional, if you want to).

@lewinpauli
lewinpauli requested a review from schultek as a code owner November 13, 2026 21:29
Copilot AI balanced review requested due to automatic review settings November 13, 2026 21:29
@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Package Version Report

The following packages have been updated:
jaspr_test : 0.24.0-beta.1 -> 0.24.0-beta.2
jaspr : 0.24.0-beta.1 -> 0.24.0-beta.2
jaspr_builder : 0.24.0-beta.1 -> 0.24.0-beta.2
jaspr_cli : 0.24.0-beta.1 -> 0.24.0-beta.2

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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/canary for 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

@lewinpauli

Copy link
Copy Markdown
Contributor Author

@schultek This one makes the Test CLI jobs green again. They have been failing on main and on every PR since the CI picked up Flutter 3.50 (#999).

@schultek schultek left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Two small things:

  1. Please put the changelog entry under a new ## Unreleased 0.24.0-beta.2 headline.
  2. Please also fix the sdkJsPath for the build command.

@lewinpauli

Copy link
Copy Markdown
Contributor Author

Done, both in the last commit:

  1. The changelog entry is now under ## Unreleased 0.24.0-beta.2.
  2. build_command.dart uses FlutterRunner.precompiledDdcSdkDir as well. Without DDC library bundles it returns kernel/ddc/stable when it exists (the build without --canary, like amd-canvaskit before), otherwise kernel/amd-canvaskit. Added a regression test for the build command with the 3.50 layout, it fails without the change.

One side effect: jaspr serve --module-format=amd gets kernel/ddc/stable on Flutter 3.50 too. Flutter no longer ships an AMD SDK, so that combination doesn't work either way.

@schultek schultek left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@schultek
schultek merged commit 95e0462 into schultek:main Nov 18, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: jaspr serve with Flutter embedding or plugins fails on Flutter 3.50, the precompiled DDC SDK moved to kernel/ddc/{stable,canary}

3 participants