fzyzcjy / flutter_rust_bridge

Flutter/Dart <-> Rust binding generator, feature-rich, but seamless and simple.
https://fzyzcjy.github.io/flutter_rust_bridge/
MIT License
4.17k stars 289 forks source link

`rust_features` unknown field #2324

Open codercengiz opened 5 days ago

codercengiz commented 5 days ago

Describe the bug

According to documentation, we can use rust_features: xyz in flutter_rust_bridge.yaml, https://cjycode.com/flutter_rust_bridge/guides/custom/codegen/full-list#flutter_rust_bridge_codegen-generate but it gives error.

❯ flutter_rust_bridge_codegen generate
Error: Could not parse flutter_rust_bridge.yaml

Caused by:
    unknown field `rust_features`, expected one of `base_dir`, `rust_input`, `dart_output`, `c_output`, `duplicated_c_output`, `rust_root`, `rust_output`, `dart_entrypoint_class_name`, `dart_format_line_length`, `dart_preamble`, `rust_preamble`, `dart_enums_style`, `add_mod_to_lib`, `llvm_path`, `llvm_compiler_opts`, `dart_root`, `build_runner`, `extra_headers`, `web`, `deps_check`, `dart3`, `full_dep`, `local`, `default_external_library_loader_web_prefix`, `dart_type_rename`, `enable_lifetime`, `type_64bit_int`, `default_dart_async`, `stop_on_error`, `dump`, `dump_all` at line 4 column 1

And I checked the doc of crate codegen https://docs.rs/flutter_rust_bridge_codegen/latest/lib_flutter_rust_bridge_codegen/codegen/struct.Config.html There is no the parameter rust_features

I think the help files are not updated.

How can I set the rust feature?

Steps to reproduce

Hint: A simple way to reproduce is to clone and modify the https://github.com/fzyzcjy/flutter_rust_bridge/tree/master/frb_example/dart_minimal example package according to your needs.

  1. ...
  2. ...
  3. ...

Logs

❯ flutter_rust_bridge_codegen generate
Error: Could not parse flutter_rust_bridge.yaml

Caused by:
    unknown field `rust_features`, expected one of `base_dir`, `rust_input`, `dart_output`, `c_output`, `duplicated_c_output`, `rust_root`, `rust_output`, `dart_entrypoint_class_name`, `dart_format_line_length`, `dart_preamble`, `rust_preamble`, `dart_enums_style`, `add_mod_to_lib`, `llvm_path`, `llvm_compiler_opts`, `dart_root`, `build_runner`, `extra_headers`, `web`, `deps_check`, `dart3`, `full_dep`, `local`, `default_external_library_loader_web_prefix`, `dart_type_rename`, `enable_lifetime`, `type_64bit_int`, `default_dart_async`, `stop_on_error`, `dump`, `dump_all` at line 4 column 1

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

fzyzcjy commented 4 days ago

Firstly, could you please show flutter_rust_bridge_codegen --version to check whether it is the latest version?

codercengiz commented 4 days ago

the last version ❯ flutter_rust_bridge_codegen --version flutter_rust_bridge_codegen 2.4.0

fzyzcjy commented 4 days ago

That's weird. We even have it in tests: https://github.com/fzyzcjy/flutter_rust_bridge/blob/4f5cf68f56ed56df62264227d81891744c356403/frb_example/pure_dart/flutter_rust_bridge.yaml#L22

fzyzcjy commented 4 days ago

Oops sorry, it is in master branch, not released yet!

https://github.com/fzyzcjy/flutter_rust_bridge/pull/2284

(I originally wanted to gather more changes before releasing a version, e.g. the actively ongoing PRs)

codercengiz commented 4 days ago

Hmm, I saw Sorry my bad, I updated it to master branch, it works now.

fzyzcjy commented 4 days ago

Happy to see it works!