Skip to content
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

build.rs ignores the rust_release parameter #2338

Open
codercengiz opened this issue Oct 4, 2024 · 0 comments
Open

build.rs ignores the rust_release parameter #2338

codercengiz opened this issue Oct 4, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@codercengiz
Copy link

Describe the bug

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.

The two method are generating different codes.

Steps to reproduce

  1. Download the simple app https://github.com/codercengiz/frb_test/
  2. Go to rust folder and run cargo build then you will see on generated file lib/src/rust/api/simple.dart
Future<String> greet({required String name}) =>
    RustLib.instance.api.crateApiSimpleGreet(name: name);
  1. 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
  2. run flutter_rust_bridge_codegen generate, then you will see on generated file lib/src/rust/api/simple.dart
String greet({required String name}) =>
    RustLib.instance.api.crateApiSimpleGreet(name: name);

Logs

❯ flutter_rust_bridge_codegen --version
flutter_rust_bridge_codegen 2.4.0

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

@codercengiz codercengiz added the bug Something isn't working label Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant