ci(linux): strip stray 'typedef bool = ...' that flutter_rust_bridge emits on Linux
build-linux / build-linux-x64 (push) Failing after 4m24s
build-windows / build-windows-x64 (push) Successful in 1h9m47s

This commit is contained in:
2026-05-05 19:31:43 +02:00
parent f8cbd4c492
commit 72770c513c
+26
View File
@@ -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<ffi.Int Function(ffi.Pointer<ffi.Int>)>;
# 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<NativeFunction<Bool ...>> 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: |