Output directory keeps changing + kernel_blob.bin appearing in release builds
Description
What currently happens:
- The output directory structure of
flutterpi_tool buildkeeps changing over time. Originally it was something likebuild/, thenbuild/flutter-pi/aarch64-generic, then apparently back tobuild/, etc. - An extra file
kernel_blob.binsometimes shows up in the output, even when building in what I expect should be AOT / release modes. - These variations (dir structure + presence of
kernel_blob.bin) break downstream scripts, automations, deployment paths.
What I expect:
- A stable, documented output layout (with versioned or released version of the tool) so that user scripts don’t need to adjust weekly.
- In
--releaseorprofilebuilds, nokernel_blob.binshould appear (because release/profile builds should use AOT/ELF snapshots, not JIT / kernel bytecode, right?). - Directory names / paths should either be configurable or at least have stable canonical names (arch, generic / cpu, etc.).
Steps to Reproduce / Observations
- Using
flutterpi_tool build --arch=<some arch> --release - Initially the output was under
build/. - Later versions of
flutterpi_toolput output underbuild/flutter-pi/aarch64-generic/(or similar arch-named subdir). - Recently, the output moved back to just
build/or another layout. - Even in release mode, I sometimes see
kernel_blob.binunderflutter_assets/.
Impact
- My automation scripts assume some fixed path to pick up binaries/assets, and these keep breaking.
- If
kernel_blob.binis included in release builds, then that suggests the build is not fully AOT, which may impact performance, binary size, startup, or be surprising for users expecting release-mode behavior.
What I Checked / Need Validation
- The changelog: I reviewed the
flutterpi_toolchangelog on pub.dev and see many fixes & version bumps. - There is no explicit note (so far as I saw) that
kernel_blob.binis removed in release builds, or that output directory layout is intended to be stable. - I also found that in Flutter itself, there is an issue “Failed to find snapshot: flutter_assets/kernel_blob.bin” when in release mode, meaning having
kernel_blob.binabsent is expected in some configurations. (108803)
Hey, those are completely valid concerns. The output directory did change in 0.9, I forgot to put that in the changelog. I'll add tests in the future to make sure the output directory doesn't change accidentally.
However, I can't reproduce the other issues you mentioned. For me, with 0.9.2, the output directory is now build/flutter-pi/armv7-generic consistently, as it should be.
If you have a kernel_blob.bin in the output directory for an AOT mode, it's probably a leftover from a previous debug mode build. But I change it so that the previous build outputs are deleted when doing a new build.
Hey, thanks for following up! A few clarifications from my side:
- My scripts always build in
--releasemode. I never run debug builds on these machines. - Each build starts by deleting the entire
build/directory (so no leftover artifacts should exist). - I’ve been using this same setup for 3-4 months. The kernel_blob.bin problem only started appearing recently, without any changes to our scripts.
Unfortunately, upgrading to 0.9.x isn’t possible yet because our current Flutter SDK version is incompatible with that release. So all of this is happening with flutterpi_tool ^0.8.0 (likely 0.8.1 or 0.8.2; I noticed 0.8.2 no longer appears on pub.dev). So is 0.8.2 yanked/changed on pub.dev?
Given that, it looks like the kernel_blob.bin issue may still exist in 0.8.x release builds. Could you confirm whether any changes between 0.8.x and 0.9.x touched the release build pipeline regarding AOT vs kernel blobs? Or if there’s a known workaround for 0.8.x?
Thanks!