You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If we want to use rust_release parameter with build.rs , cargo build generates without considering frb attributes. For example, even if you specify #[cfg_attr(feature = "mobile",frb(sync))], it generates async function. However, flutter_rust_bridge_codegen generate generates as expected.
To compare this generated code with the generated codes by codegen
Install the codegen from git on master branch cargo install --git https://github.com/fzyzcjy/flutter_rust_bridge --branch master flutter_rust_bridge_codegen
run flutter_rust_bridge_codegen generate, then you will see on generated file lib/src/rust/api/simple.dart
Yes, build.rs currently has some limitations such as not able to parse macros to avoid deadlock (you know, when build.rs is executed, you are already running a Rust build, so if you further call cargo expand you will trigger a nested Rust build). Thus I suggest to use the normal generate command.
fzyzcjy
added
the
awaiting
Waiting for responses, PR, further discussions, upstream release, etc
label
Oct 4, 2024
Describe the bug
If we want to use
rust_release
parameter withbuild.rs
,cargo build
generates without considering frb attributes. For example, even if you specify#[cfg_attr(feature = "mobile",frb(sync))]
, it generates async function. However,flutter_rust_bridge_codegen generate
generates as expected.The two method are generating different codes.
Steps to reproduce
cargo build
then you will see on generated filelib/src/rust/api/simple.dart
Install the
codegen
from git on master branchcargo install --git https://github.com/fzyzcjy/flutter_rust_bridge --branch master flutter_rust_bridge_codegen
flutter_rust_bridge_codegen generate
, then you will see on generated filelib/src/rust/api/simple.dart
Logs
Expected behavior
No response
Generated binding code
No response
OS
No response
Version of
flutter_rust_bridge_codegen
No response
Flutter info
No response
Version of
clang++
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: