From 72770c513c60ae624f56a704ced3165328666a4f Mon Sep 17 00:00:00 2001 From: Mike Mueller Date: Tue, 5 May 2026 19:31:43 +0200 Subject: [PATCH] ci(linux): strip stray 'typedef bool = ...' that flutter_rust_bridge emits on Linux --- .gitea/workflows/build-linux.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.gitea/workflows/build-linux.yml b/.gitea/workflows/build-linux.yml index 3897fe849..87f5f2b7c 100644 --- a/.gitea/workflows/build-linux.yml +++ b/.gitea/workflows/build-linux.yml @@ -146,6 +146,32 @@ jobs: (cd flutter && git checkout -- pubspec.yaml) (cd flutter && /opt/flutter/bin/flutter pub get) + # ============================================================ + # CRITICAL FIX for flutter_rust_bridge_codegen 1.80.1 on Linux + # ============================================================ + # flutter_rust_bridge_codegen 1.80.1 emits a stray + # typedef bool = ffi.NativeFunction)>; + # line near the end of generated_bridge.dart on Linux (the Windows + # generation does not hit this codepath). That typedef shadows + # dart:core.bool for the whole library AND every part file (notably + # generated_bridge.freezed.dart), corrupting every `bool` reference in + # the codebase. Symptoms include: + # - "Type 'Int' not found" / "Type 'Pointer' not found" in .freezed.dart + # - "value of type 'bool' can't be assigned to NativeFunction<...>" + # in every model file + # - the wire class's `int ptr` mismatching its parent's + # Pointer> type + # + # Drop the line. References to `bool` then resolve to dart:core.bool + # as every line of source code actually intends. + sed -i '/^typedef bool = /d' flutter/lib/generated_bridge.dart + if grep -n '^typedef bool = ' flutter/lib/generated_bridge.dart >/dev/null; then + echo "ERROR: stray 'typedef bool' still present in generated_bridge.dart" >&2 + grep -n '^typedef bool = ' flutter/lib/generated_bridge.dart >&2 + exit 1 + fi + echo "Stripped stray 'typedef bool = ...' line from generated_bridge.dart" + - name: Diagnose generated bridge files shell: bash run: |