From 70320114a2809a861e2177ae761544c43ee9b6f5 Mon Sep 17 00:00:00 2001 From: jwinterm Date: Fri, 15 May 2026 13:55:23 -0400 Subject: [PATCH] CI: serialize model_generator.sh + explicit Flutter precache step MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .github/workflows/build-linux.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index fe58093f..db9d3e66 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -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 -- 2.50.1 (Apple Git-155)