feat: add Linux desktop support to core, auth, firestore, database, storage, remote_config, app_check#18461
feat: add Linux desktop support to core, auth, firestore, database, storage, remote_config, app_check#18461akshaynexus wants to merge 10 commits into
Conversation
…tabase, storage, remote_config, app_check Ports the Windows C++ (firebase-cpp-sdk 13.5.0) plugin implementations to the Flutter Linux GObject embedder for 7 packages: - Pigeon GObject codegen (gobjectHeaderOut/SourceOut) from the existing single-source pigeons/messages.dart definitions - linux/CMakeLists.txt per package: downloads the full firebase_cpp_sdk zip (contains prebuilt Linux x86_64 libs, both ABI variants), honors FIREBASE_CPP_SDK_DIR override, STATIC plugin libs to share one firebase_app registry across plugins - FlValue-based cross-plugin constants registry in firebase_core - All 123 host-API methods and 14 event channels (auth state/id-token, firestore snapshots, database value/child events, storage task progress, remote-config updates, app-check token changes) - Linux implements delete() and other gaps Windows leaves as TODO stubs - Shared platform-agnostic storage helpers extracted to src/ used by both windows/ and linux/ - README Linux column, melos generate:pigeon:linux + regen script encoding the required post-gen transforms, build-only Linux CI job Linux support is development-only, mirroring the Windows desktop policy.
…K link owned by firebase_core The prebuilt Firebase C++ archives have circular symbol deps (product libs -> firebase::rest::* in libfirebase_app.a; libfirebase_firestore.a -> firebase::g_auth_initializer in libfirebase_auth.a) that an ordered per-plugin link line cannot satisfy. firebase_core_plugin now links every desktop product archive in one -Wl,--start-group/--end-group and forwards libsecret (from the SDK's firebase_auth interface) plus system OpenSSL needed by database/firestore. Product plugins link only firebase_core_plugin.
…op unused font_awesome_flutter from auth example The SDK include dir was INTERFACE-only, but since the imported SDK targets are no longer linked directly, firebase_core's own sources need it too. font_awesome_flutter 10.x is incompatible with Flutter 3.44 (final IconData) and was never imported by the auth example.
v10 extends IconData, which is a final class as of Flutter 3.44, breaking compilation. flutter_signin_button constrains font_awesome_flutter with '>=9.0.0' so v11 resolves cleanly.
Enables building/running the E2E tests app on Linux desktop; exercises the firebase_auth Linux plugin (no example app covers it) alongside core, app_check, database, remote_config, and storage.
… 2.1.1 in example font_awesome_flutter 11 is required for Flutter >=3.44 (IconData became final; fa 10 subclassed it). No released flutter_signin_button supports fa 11's FaIconData yet, so override it with a patched fork (fa11-compat) until upstream ships the fix. Overrides live in the workspace root, as pub workspaces ignore member-level dependency_overrides.
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. |
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
81bf259 to
f17c6df
Compare
Description
Adds Linux desktop support to seven FlutterFire plugins, mirroring the existing Windows desktop implementation (same Firebase C++ SDK 13.5.0, same development-only support policy):
firebase_core,firebase_auth,cloud_firestore,firebase_database,firebase_storage,firebase_remote_config,firebase_app_checkThese are exactly the products the Firebase C++ SDK provides real (non-stub) desktop implementations for.
What was added
linux/implementation per plugin targeting Flutter's GLib/GObject Linux embedder (FlPluginRegistrar,FlValue,FlMethodChannel,FlEventChannel) — ported from thewindows/C++ implementations. 123 Pigeon host-API methods and 14 event channels (auth state / ID token, Firestore document & query snapshots + snapshots-in-sync, Database value/child listeners, Storage task progress, Remote Config update listener, App Check token changes).*_platform_interface/pigeons/messages.dartgainedgobjectHeaderOut/gobjectSourceOutoutputs, so the Linux channel layer is generated from the same single source of truth as every other platform. Amelos generate:pigeon:linuxscript (scripts/generate_pigeon_linux.sh) re-applies the small mechanical post-gen transforms the GObject generator needs (reserved-worddelete→delete_for auth, dispatch-localhandlerename for storage, Firestore custom-codec delegation) so a rawdart run pigeoncan't silently regress them.FIREBASE_SDK_VERSION(13.5.0), sameFIREBASE_CPP_SDK_DIRenv override with version check. Linux downloads the fullfirebase_cpp_sdk_13.5.0.zip(Google publishes no Linux-only archive); the SDK's own CMake selects the correct x86_64 C++11-ABI static libraries.firebase::rest::*insidelibfirebase_app.a;libfirebase_firestore.a→firebase::g_auth_initializerinsidelibfirebase_auth.a). GNU ld resolves archives left-to-right (unlike MSVC), sofirebase_core_pluginowns the SDK link and wraps all product archives in a single-Wl,--start-group/--end-group, pluslibsecret-1(forwarded from the SDK's ownfirebase_authinterface requirement), system OpenSSL (needed by Database/Firestore archives), and pthread. Product plugins link onlyfirebase_core_plugin. Plugins are built as STATIC libraries (as on Windows) so all plugins share onefirebase::Appregistry in the runner.FlValue-basedFlutterFirebasePluginRegistryinfirebase_core, mirroring the Windows/Android registry, soinitializeCoreaggregates each plugin's constants.(*)policy as Windows),linux/runners for each plugin example and for thetests/app, and a build-only Linux CI workflow (.github/workflows/linux.yaml, ubuntu-latest) that builds thefirebase_coreexample.FirebaseAppHostApi.deletedestroys thefirebase::Appinstance); where the SDK genuinely lacks the API, the Windows no-op is mirrored with the same comment.What was tested (real hardware)
All builds were verified on physical Linux hardware (CachyOS, Flutter 3.44.4 stable, CMake 4.4, GCC/Clang toolchain), not just cross-checked statically:
flutter build linuxsucceeds for all seven plugin example apps, including the full SDK zip download/extract path infirebase_core's CMake and theFIREBASE_CPP_SDK_DIRoverride path for the rest.flutter build linuxsucceeds for thetests/app, which links six FlutterFire plugins into one binary (core, auth, app_check, database, remote_config, storage) — verifying the plugins coexist and the group-link strategy holds under multi-plugin aggregation.nmon the produced binaries: every<plugin>_plugin_register_with_registrarentry point present, product SDK symbols linked (e.g. 1,166firebase::auth::*symbols in the auth example binary).flutter analyzeclean on the touched Dart surfaces.What works / known limitations
(*)footnote.setCustomSignalsresponds unimplemented, DatabasesetPersistenceCacheSizeBytes/emulator wiring no-ops, FirestoreVectorValuewire type not decoded natively, Auth MFA/TOTP host APIs generated but not registered (Dart receives channel-not-implemented, as on Windows).windows.yaml) is left as follow-up; the added CI job is build-only.font_awesome_flutter/flutter_signin_buttonpair is bumped to the latest versions (fa 10 does not compile on Flutter ≥ 3.44 whereIconDatais final). No releasedflutter_signin_buttonsupports fa 11 yet, so the workspace root carries a temporarydependency_overridesonto a patched fork; fix: support font_awesome_flutter 11 (FaIconData is no longer an IconData) ZaynJarvis/Flutter-Sign-in-Button#125 has been opened upstream to make that override removable. If maintainers prefer, this dep bump can be split into a separate PR.Related Issues
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]).This will ensure a smooth and quick review process. Updating the
pubspec.yamland changelogs is not required.tests/app on real Linux hardware; no Dart behavior changed (the Dart/Pigeon layer is shared with existing platforms and covered by existing tests). Happy to add Linux e2e wiring in a follow-up.///).melos run analyze) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?
🤖 Generated with Claude Code