-
Notifications
You must be signed in to change notification settings - Fork 300
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
Error when running third-party scanner #2198
Comments
Hi! Thanks for opening your first issue here! 😄 |
Hmm, feel free to PR to support that, which may not be super hard (since we already support For workaround, you can always fallback to the manual mode. In other words, just write down a simple wrapper of the API. |
I actually don't believe that turned out to be the issue; the verbose logging created too much noise around unit structs, and after forking the
I forked the frb repo, added I wish I could be more useful here, but I'm not familiar enough with Rust to debug this further myself! I'm going to try to use the package with manual bindings in the mean time :) |
Ok I see. IIRC that error can happen when the package has too fancy |
Thanks so much for looking into the issue! The manual bindings have been working well, though the process is slow for such a large package. I think it would be very helpful to be able to configure globs/types to include in the parsing process (similar to Please feel free to re-word the description/title for the "fancy use/mod statements", or close if there's an existing issue. I can keep that repository alive so that you have something to test against. |
I think so, that is why I made the automatic way - to save time especially for large packages.
What about
No worries, maybe we can keep it like that for a bit of time, since I have not checked it and cannot guarantee causes Again, also feel free to PR! |
Filtering doesn't work on third-party packages. No matter what combination of submodules you put there, the entire third-party crate seems to be parsed. So there's no work around when there's any compilation errors, besides manually writing ALL third-party package code (which has turned out to be too much manually work for such a large package). If filtering were to work, then this would be a lot less impactful of an issue. |
I see. Again, feel free to PR for this! Alternatively I may work on it but again not very soon, since that feature is considered experimental and I do not have a lot of time implementing more now. Another hacky workaround: Maybe fork the yrs package, and modify its content like:
By doing so, iirc that mod is not parsed at all. |
Yeah that seems to prevent the modules from being parsed, but then the module isn't imported into the generated "frb_generated.rs" module and therefore the rust program fails to compile. It seems like
As stated in the docs, having the ability to ignore individual structs/enums would be helpful to circumvent errors. I realize that it's hard to cover all edge cases for parsing/code-gen, and altogether I think the automatic scanning / code-gen works very well for 90% of the cases - some improved error logging and further work on ignoring structs/enums would go a long way in making the feature "good enough" IMO :) |
Totally agree, that's partially why the "scan whole 3rd patry crate" feature is marked as "experimental"! |
Hey, @pattobrien. Did you get any bright ideas on how to parse the yrs lib? |
Did someone get it working? |
Sorry for the delayed response! Unfortunately no, I wasn't able to get Sorry I couldn't have been of more help! |
I guess yrs itself is too complex to be auto parsed by this experimental feature today. But if many people are interested in it, one way is to collaborate to manually handle the yrs, just like how people make a (semi-manual) binding from one language to another language. |
Describe the bug
I'm not able to run the third party scanner on package
yrs
, due to the below error.Further in the debug logs, I see the message "struct with unit fields are not supported yet, what about using
struct DefaultProtocol {}
or#[frb(opaque)] struct DefaultProtocol;
instead" - but the struct in question cannot be modified, since it's a part of third party code.Steps to reproduce
yrs
as a dependency.flutter_rust_bridge.yaml
withrust_input: crate::api,yrs
.flutter_rust_bridge_codegen generate
Logs
Expected behavior
I would've expected two different outcomes:
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: