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

rust_features unknown field #2324

Closed
codercengiz opened this issue Sep 27, 2024 · 7 comments
Closed

rust_features unknown field #2324

codercengiz opened this issue Sep 27, 2024 · 7 comments
Labels
awaiting Waiting for responses, PR, further discussions, upstream release, etc bug Something isn't working

Comments

@codercengiz
Copy link

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

@codercengiz codercengiz added the bug Something isn't working label Sep 27, 2024
@fzyzcjy
Copy link
Owner

fzyzcjy commented Sep 27, 2024

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

@fzyzcjy fzyzcjy added the awaiting Waiting for responses, PR, further discussions, upstream release, etc label Sep 27, 2024
@codercengiz
Copy link
Author

the last version
❯ flutter_rust_bridge_codegen --version
flutter_rust_bridge_codegen 2.4.0

@fzyzcjy
Copy link
Owner

fzyzcjy commented Sep 27, 2024

That's weird. We even have it in tests:

@fzyzcjy
Copy link
Owner

fzyzcjy commented Sep 27, 2024

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

#2284

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

@codercengiz
Copy link
Author

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

@fzyzcjy
Copy link
Owner

fzyzcjy commented Sep 27, 2024

Happy to see it works!

Copy link
Contributor

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
awaiting Waiting for responses, PR, further discussions, upstream release, etc bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants