flutterpi_tool icon indicating copy to clipboard operation
flutterpi_tool copied to clipboard

Build error: Artifacts for engine [hash] are not yet available

Open filiph opened this issue 9 months ago • 2 comments

I'm trying to build the bundle (with flutterpi_tool build) for an example app and I'm getting this error:

Artifacts for engine 871f65ac1bf129edb222c3293a636ff4b67534a6 are not yet available.

I'm on Flutter (Channel stable, 3.29.1, on Ubuntu 24.04.2 LTS 6.11.0-19-generic, locale en_US.UTF-8).

This has happened before: https://github.com/ardera/flutterpi_tool/issues/40

I'm assuming this will "fix itself" when some CI tool on the Flutter's side uploads the correct artifact to the correct cloud storage. I have a couple of questions:

  • How long does this normally take? Hours? Days? Weeks?
  • What's the recommended workaround? Downgrade local Flutter installation? How far back?

filiph avatar Mar 13 '25 12:03 filiph

For what it's worth, my workaround was to downgrade to the previous stable version of Flutter:

  1. flutter downgrade 3.27.3
  2. flutter pub global deactivate flutterpi_tool (needed to do this because I was using my patched version)
  3. flutter pub global activate flutterpi_tool
  4. flutter clean (to get rid of previous version in the app's directory and errors such as "Error: The specified language version is too high.")
  5. flutter run (to get rid of ".dart_tool/package_config.json does not exist")

Now flutterpi_tool build succeeds.

filiph avatar Mar 13 '25 13:03 filiph

Hey!

The CI in question is running here: https://github.com/ardera/flutter-ci/ It builds the libflutter_engine.so and the dart compiler (gen_snapshot).

Unfortunately, the kind of artifacts necessary are not built by the official Flutter CI, or only in a very limited way. I think there's an embedder API engine for x64, but only one runtime mode. (But that might be out of date.)

Furthermore, the engine that is built by this CI is not exactly the upstream engine. It has some patches on top to support building the engine for linux-armv7. Additionally there's some patches to be able build cross compiling dart gen_snapshots for all the OS & architecture combinations out there. (linux-x64 targeting linux-arm, linux-arm64 targeting x64, windows targeting linux-arm32, macos targeting linux, etc.); and then there's also patches to allow CPU-specific tuning for e.g. Raspberry Pi 3 and 4.

The build itself takes 1h30min, and most of the time the engine builds fine out of the box for a new major flutter version, then you might have the new artifacts maybe ~2 hours after the version was released.

However, sometimes it doesn't work out of the box. 3.29 is the first stable flutter version that has the merged flutter/engine monorepo and I'm currently still in the process of making that work: https://github.com/ardera/flutter-ci/pull/23

What's the recommended workaround? Downgrade local Flutter installation? How far back?

Yeah I think that's the best way, the next-oldest flutter version should work fine. Maybe fvm makes this part a bit easier

ardera avatar Mar 17 '25 17:03 ardera

https://github.com/ardera/flutter-ci/releases/tag/engine%2Fcf56914b326edb0ccb123ffdc60f00060bd513fa mentions 3.29.3 as the latest release, but this one cannot be selected via flutter channel 3.29.3 (any more at least, right now only channel 3.29 is allowed, which howevers is in turn not supported by flutter pi:

Also, 3.27 is now dropped as a selectable channel, leading to currently no channel at all being selectable to work with flutterpi_tool

on 3.29:

dart run flutterpi_tool build --arch=arm64 --release
Building package executable... 
Built flutterpi_tool:flutterpi_tool.
Artifacts for engine 99bf419997accdfe6013c1732ce6bc873b01d45f are not yet available.

Right now, the only way to make it work is to manually clone flutter at 3.29.3 which works with flutterpi_tool.

Would be cool if 3.32 was built in flutterpi's CI, eliminating the headache.

@maxhochlenertarnoldnextg 3.32 is supported now in version 0.8.0. But even before it worked, using 3.29, 3.27, or whatever you desire. It's just that flutter channel 3.29.3 / flutter channel 3.29 is not a correct way to check out specific flutter versions.

ardera avatar Jun 13 '25 09:06 ardera