Trying to build flutter engine with custom dart sdk

I was able to correctly compile the flutter windows engine and get the file (flutter_windows.dll) with the prebuilt dart sdk, but when I try to use --no-prebuilt-dart-sdk when added to the gn tool to use the internal sdk code (for example editing any dart file inside \engine\src\flutter\third_party\dart\sdk\lib) it doesn’t detect any changes and even if I deleted out\host_release completely it wasn’t able to use/build my custom dart sdk

so what could be the issue?

here are my build commands:

python .\flutter\tools\gn --no-goma --runtime-mode=release --windows-cpu=x64 --no-prebuilt-dart-sdk
ninja -C out/host_release flutter_windows.dll

when I edit the dark sdk ninja always outputs that there’s no changes:

$ ninja -C out/host_release flutter_windows.dll
ninja: Entering directory `out/host_release'
ninja: no work to do.

so what could I be doing wrong? I even deleted the folders in engine\src\flutter\prebuilts and still somehow compiled

What you’re seeing is pretty typical when working with the engine and Dart. Even with --no-prebuilt-dart-sdk, the Dart SDK is still built as a separate step and cached aggressively. Editing files under third_party/dart/sdk/lib won’t trigger website a rebuild of the Dart VM or SDK artifacts that the engine actually links against. Ninja just sees no dependency changes. You usually need to rebuild the Dart SDK explicitly, clean the Dart output directories, or modify VM sources instead. Also double-check that your GN args really propagated by inspecting args.gn.

1 Like