Skip to content

fix(flutter_rust_bridge): WASM compilation issue for flutter_rust_bridge #393

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Apr 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion earthly/flutter_rust_bridge/Earthfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# cspell: words Zwasm

VERSION 0.8

IMPORT ../flutter AS flutter-ci
Expand Down Expand Up @@ -31,7 +33,8 @@ CODE_GENERATOR_WEB:
FUNCTION

RUN flutter_rust_bridge_codegen generate --default-external-library-loader-web-prefix=/assets/packages/catalyst_key_derivation/assets/js/
RUN flutter_rust_bridge_codegen build-web
# resolving a WASM compilation issue https://github.com/rust-lang/rust/issues/138762
RUN flutter_rust_bridge_codegen build-web --wasm-pack-rustflags="-Zwasm-c-abi=legacy"

RUN mkdir -p assets/js && cp -rf ./web/pkg/* assets/js/
# Don't want this gitignore file.
Expand Down
2 changes: 1 addition & 1 deletion earthly/rust/tools/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,4 @@ tool-wasm-pack:
DO +CARGO_BINSTALL --package=wasm-pack --version=0.13.0

tool-flutter-rust-bridge-codegen:
DO +CARGO_BINSTALL --package=flutter_rust_bridge_codegen --version=2.5.1 --executable="flutter_rust_bridge_codegen"
DO +CARGO_BINSTALL --package=flutter_rust_bridge_codegen --version=2.9.0 --executable="flutter_rust_bridge_codegen"
6 changes: 3 additions & 3 deletions examples/flutter/example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ packages:
dependency: "direct main"
description:
name: flutter_rust_bridge
sha256: "5fe868d3cb8cbc4d83091748552e03f00ccfa41b8e44691bc382611f831d5f8b"
sha256: "5a5c7a5deeef2cc2ffe6076a33b0429f4a20ceac22a397297aed2b1eb067e611"
url: "https://pub.dev"
source: hosted
version: "2.5.1"
version: "2.9.0"
flutter_test:
dependency: "direct dev"
description: flutter
Expand Down Expand Up @@ -311,5 +311,5 @@ packages:
source: hosted
version: "3.0.4"
sdks:
dart: ">=3.5.0 <4.0.0"
dart: ">=3.7.0-0 <4.0.0"
flutter: ">=3.29.0"
2 changes: 1 addition & 1 deletion examples/flutter/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dependencies:
cupertino_icons: ^1.0.6
rust_lib_example:
path: rust_builder
flutter_rust_bridge: 2.5.1
flutter_rust_bridge: 2.9.0

dev_dependencies:
flutter_test:
Expand Down
2 changes: 1 addition & 1 deletion examples/flutter/example/rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ edition = "2021"
crate-type = ["cdylib", "staticlib"]

[dependencies]
flutter_rust_bridge = "=2.5.1"
flutter_rust_bridge = "=2.9.0"