-
Notifications
You must be signed in to change notification settings - Fork 303
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
Unable to translate third-party package tantivy #2254
Comments
Hi! Thanks for opening your first issue here! 😄 |
Firstly, try to run with stacktrace enabled and paste it here to know what is happening. Secondly, as is mentioned in the doc, scanning whole third party crate is experimental, thus for complex scenarios it may be needed to fall back to manually write a thin wrapper and use the classical features of frb. |
thank you for the fast response. here is the logging, with the backtrace:
meanwhile i will try to create wrappers, while simplifing the use of the library. i got some inspiration for the architacture from these two projects (although they are using FRB v1 and have not been maintained recerntly): |
Hmm, try |
Oh, I am sorry for that. this is with RUST_BACKTRACE=1
and this is with
|
Get it. Since this is experimental feature, I may not have time recently to have a deeper look at it, but feel free to PR for it (and I am happy to provide hints and suggestions)! And if there are bugs in non-experimental feature also feel free to ping me. |
I guess I'm having the same problem with the (c) Microsoft Corporation. Todos os direitos reservados.
C:\Users\Wdest\Desktop\mayhttp>flutter_rust_bridge_codegen generate --watch
[2024-09-16T22:08:43.064Z INFO C:\Users\Wdest\.cargo\registry\src\index.crates.io-6f17d22bba15001f\flutter_rust_bridge_codegen-2.4.0\src\library\codegen\parser\hir\flat\transformer\merge_duplicate_transformer\mod.rs:72] There are still multiple objects with same key after merging, thus randomly pick one. This is an issue only if the object is indeed used. (key=("HttpService", "call"), objects={"namespace":"may_minihttp","owner":{"TraitDef":{"trait_def_name":"may_minihttp/HttpService"}},"sources":["Normal"],"item_fn":"GeneralizedItemFn(name=call, vis=None, attrs=[])"}, {"namespace":"may_minihttp","owner":{"TraitDef":{"trait_def_name":"may_minihttp/HttpService"}},"sources":["Normal"],"item_fn":"GeneralizedItemFn(name=call, vis=None, attrs=[])"})
[2024-09-16T22:08:43.065Z INFO C:\Users\Wdest\.cargo\registry\src\index.crates.io-6f17d22bba15001f\flutter_rust_bridge_codegen-2.4.0\src\library\codegen\parser\hir\flat\transformer\merge_duplicate_transformer\mod.rs:72] There are still multiple objects with same key after merging, thus randomly pick one. This is an issue only if the object is indeed used. (key="HttpService", objects={"name":"may_minihttp/HttpService","attrs":["# [doc = \" the http service trait\"]","# [doc = \" user code should supply a type that impl the `call` method for the http server\"]","# [doc = \"\"]"],"sources":["Normal"]}, {"name":"may_minihttp/HttpService","attrs":["# [doc = \" the http service trait\"]","# [doc = \" user code should supply a type that impl the `call` method for the http server\"]","# [doc = \"\"]"],"sources":["Normal"]})
[2024-09-16T22:08:43.068Z INFO C:\Users\Wdest\.cargo\registry\src\index.crates.io-6f17d22bba15001f\flutter_rust_bridge_codegen-2.4.0\src\library\codegen\parser\mir\parser\ty\enum_or_struct.rs:73] Skip parsing enum_or_struct `NamespacedName { namespace: Namespace { joined_path: "may_minihttp" }, name: "Response" }` because of error (e=Cannot parse array length)
[5.9s] Parse ⠄
└── [5.9s] Cargo expand & syn parse
└── [0.0s] Parse HIR ⠂ [2024-09-16T22:08:43.070Z ERROR C:\Users\Wdest\.cargo\registry\src\index.crates.io-6f17d22bba15001f\flutter_rust_bridge_codegen-2.4.0\src\library\utils\logs.rs:55] panicked at C:\Users\Wdest\.cargo\registry\src\index.crates.io-6f17d22bba15001f\flutter_rust_bridge_codegen-2.4.0\src\library\codegen\ir\mir\ty\structure.rs:36:32:
no entry found for key=MirStructIdent(NamespacedName { namespace: Namespace { joined_path: "may_minihttp" }, name: "Response" })
thread 'main' panicked at C:\Users\Wdest\.cargo\registry\src\index.crates.io-6f17d22bba15001f\flutter_rust_bridge_codegen-2.4.0\src\library\codegen\ir\mir\ty\structure.rs:36:32:
no entry found for key=MirStructIdent(NamespacedName { namespace: Namespace { joined_path: "may_minihttp" }, name: "Response" })
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
C:\Users\Wdest\Desktop\mayhttp> In the pub struct Response<'a> {
headers: [&'static str; MAX_HEADERS],
headers_len: usize,
status_message: StatusMessage,
body: Body,
rsp_buf: &'a mut BytesMut,
}
impl<'a> Response<'a> {
...
} |
I have the same issue with
Here is the related code from the library: /// A default implementation of y-sync [Protocol].
#[derive(Debug, Copy, Clone, Default)]
pub struct DefaultProtocol;
impl Protocol for DefaultProtocol {}
#[cfg_attr(not(feature = "sync"), async_trait(?Send))]
#[cfg_attr(feature = "sync", async_trait)]
impl AsyncProtocol for DefaultProtocol {}
/// Trait implementing a y-sync protocol. The default implementation can be found in
/// [DefaultProtocol], but its implementation steps can be potentially changed by the user if
/// necessary.
pub trait Protocol {
/// To be called whenever a new connection has been accepted. Returns an encoded list of
/// messages to be sent back to initiator. This binary may contain multiple messages inside,
/// stored one after another.
fn start<E>(&self, awareness: &Awareness, encoder: &mut E) -> Result<(), Error>
....
} Not trying to span here, just though it could come usefull when looking into it. |
I found that it's also linked here: #2198 |
(I replied there) |
Describe the bug
i am willing to use tantivy in my Dart/Flutter code.
when adding tantivy to flutter_rust_bridge.yaml and running
flutter_rust_bridge_codegen generate
it returnes an error.Steps to reproduce
just add the line
rust_input: tantivy
to your flutter_rust_bridge.yaml file and runflutter_rust_bridge_codegen generate
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: