CI: serialize model_generator.sh + explicit Flutter precache step

The 'async' flag in model_generator.sh launches per-module flutter pub get
in parallel via 'bash -c ... &'. Flutter has a single-process startup lock
for SDK initialization — when N parallel calls race for it, most lose,
leaving the SDK cache half-initialized. Subsequent pub gets then fail
with the misleading 'doesn't support null safety' error because Flutter
can't resolve its own bundled sky_engine.

Two fixes:
1. Drop 'async' — model_generator.sh now runs the 8 modules sequentially.
   Adds maybe 3 minutes per CI run vs parallel, but reliable beats fast.
2. Add explicit 'flutter precache --linux' step before model_generator. The
   '|| true' absorbs the known flutter_gpu.zip 404 on Flutter 3.32.0 —
   that asset isn't actually published at the URL Flutter constructs and
   isn't needed for desktop Linux.
This commit is contained in:
jwinterm
2026-05-15 13:55:23 -04:00
parent df188b6114
commit 70320114a2
+12 -1
View File
@@ -150,8 +150,19 @@ jobs:
- name: Generate per-module secrets.g.dart files
run: dart run tool/generate_new_secrets.dart
# Initialize Flutter SDK once before parallel-ish work happens. flutter
# precache for Flutter 3.32.0 hits a 404 on flutter_gpu.zip (asset not
# actually published at the path Flutter constructs); the `|| true`
# absorbs that — desktop Linux build doesn't need flutter_gpu.
- name: Initialize Flutter SDK
run: |
flutter --version
flutter precache --linux --no-android --no-ios --no-macos --no-windows --no-fuchsia --no-web || true
# Sequential — async flag races on Flutter's startup lock and corrupts
# the SDK state, causing the "doesn't support null safety" cascade.
- name: Build generated code (mobx + hive adapters)
run: bash model_generator.sh async
run: bash model_generator.sh
- name: Generate localization
run: dart run tool/generate_localization.dart