chore(bindings/dart): upgrade flutter_rust_bridge to 2.12.0 and fix native library loading#7472
Merged
Merged
Conversation
…ative library loading Upgrade flutter_rust_bridge from 2.8.0 to 2.12.0 to resolve codegen/runtime version mismatch that broke dart test. Changes: - pubspec.yaml: flutter_rust_bridge 2.8.0 → 2.12.0 - rust/Cargo.toml: flutter_rust_bridge = "=2.8.0" → "=2.12.0" - Regenerate all FRB bindings with matching codegen/runtime - Fix lib/opendal.dart constructor parameter: schemeStr → scheme (FRB generated), but keep Storage.init(schemeStr:) public API wrapper unchanged - Fix macOS native library loading: fall back to rust/target/release/ when cross-compilation target directory does not exist No behavior changes; existing tests continue to pass.
a0f25aa to
391caa5
Compare
asukaminato0721
approved these changes
May 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
No dedicated issue. This is a prerequisite infrastructure fix found during the OpenDAL binding regression effort — the existing Dart binding had a codegen/runtime version mismatch that caused
dart testto fail entirely.Rationale for this change
flutter_rust_bridgecodegen was at 2.12.0 but the runtime dependency inpubspec.yamlandrust/Cargo.tomlwas pinned to 2.8.0. FRB enforces a codegen/runtime version match at startup, so the binding was broken for any consumer runningdart testfrom a clean checkout.This PR upgrades both sides to 2.12.0, regenerates all FRB-managed files, and fixes a macOS native library loading path that failed on arm64 native builds (cross-compilation target directory absent).
What changes are included in this PR?
pubspec.yaml:flutter_rust_bridge: 2.8.0→2.12.0rust/Cargo.toml:flutter_rust_bridge = "=2.8.0"→"=2.12.0"frb_generated.dart,frb_generated.io.dart,frb_generated.web.dart,frb_generated.rs,api/opendal_api.dartlib/opendal.dart:import 'dart:io'→import 'dart:io' as ioto avoid name collisions after FRB 2.12 changes.rust/target/release/when not.Operator(scheme: schemeStr, ...)call updated to match FRB 2.12 generated parameter name. The publicStorage.init({required String schemeStr, ...})API is unchanged.Are there any user-facing changes?
No.
Storage.init(schemeStr: ...)public API is preserved. The internal generatedOperatorconstructor parameter was renamed by FRB 2.12 codegen; the wrapper absorbs that change transparently.Intentional divergence from Rust
None. This is a pure infrastructure fix.
Validation
Internal agent-to-agent pre-review used the required patch artifact flow before PR publication:
id:499b4d7b-a96b-4e10-b321-bc9b980d5f33, SHA-256f643e7baefc03a9d09c8471eaf0b66edff77727b461245f5f96f71590c246b29— REQUEST CHANGES (Codex caught a source-breakingStorage.init(schemeStr:)→scheme:rename masquerading as infra-only; Commander caughtanyhowdep being added in PR A but only used by PR B's read/write methods).id:13ca0fa7-99a9-4f16-a55e-2b5f2e1cb914, SHA-25626c9a16c06eef524acc2976936ae4bf1b6533ab98aced99e31c43f0fc040e3bb— Commander APPROVED, Codex APPROVED.Codex pre-review v2 verification (
apache/opendal:agent-dart-frb-upgradeapplied cleanly onorigin/main):git diff --check/git show --checkpassed.Storage.init({ required String schemeStr, ... })still exists and internally calls generatedOperator(scheme: schemeStr, map: map).Storage.init(schemeStr: ...); no public rename leak.bindings/dart/rust/Cargo.tomlonly bumpsflutter_rust_bridgeto=2.12.0; no misplacedanyhowdependency.Reported handoff transcripts:
Codex independent re-run reported the same
cargo build -rsuccess anddart test2/2 pass.Note:
dart analyzeis not currently clean in this binding due to a pre-existing reference inlib/src/rust/api/capability.dartto a generated API that is not present. That is unrelated to this PR and is not cited as validation.AI Usage Statement
This patch was produced by AI agents during an OpenDAL binding regression effort. It was reviewed by separate AI reviewer/commander agents through Slock before publication:
@od-kimi-scout-050121(Kimi) as Dart Phase 1 infra worker.@od-claude-lead-050121(Claude, commander) — APPROVED v2.@od-codex-review-050121(Codex) — APPROVED v2 with verified SHA-25626c9a16c06eef524acc2976936ae4bf1b6533ab98aced99e31c43f0fc040e3bb.TennyZhuangauth per the regression-effort hybrid publishing policy.PR B (Dart
File.read/writePhase 1 feature, depends on this PR) follows separately, mapped to #7467.