flatbuffers icon indicating copy to clipboard operation
flatbuffers copied to clipboard

[rust] flatc v23.5.26 generates code that doesn't match flatbuffers v23.5.26 crate.

Open nihohit opened this issue 2 years ago • 9 comments

FlatBufferBuilder in the latest crate version doesn't have a generic Allocator argument, while the autogenerated code from flatc v23.5.26 contains fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>.

As far as I can see, building with Rust is completely broken by this.

nihohit avatar Nov 06 '23 17:11 nihohit

Workaround: refer directly to github in Cargo.toml...

flatbuffers = { git = "https://github.com/google/flatbuffers", features = ["serialize"] }

bassmanitram avatar Nov 24 '23 16:11 bassmanitram

@bassmanitram I used the "23.5.9" version, but your solution also works.

nihohit avatar Nov 25 '23 17:11 nihohit

Yeah, that's probably more stable, thinking about it :)

bassmanitram avatar Nov 25 '23 18:11 bassmanitram

Hey, so I authored this PR https://github.com/google/flatbuffers/pull/8106 that would make sense to have been the culprit. I didn't run into issues but we also pull the entire flatbuffers repo together and compile flatc from source. I see the new Allocator trait when I run cargo doc from the latest master so I'm wondering why it doesn't show up on the flatbuffers crate

adsnaider avatar Feb 20 '24 14:02 adsnaider

@adsnaider Sorry, I initially thought this problem was caused by PR, but after investigation, I found out that this problem was caused by my special usage

fawdlstty avatar Feb 21 '24 01:02 fawdlstty

Just got bit by this .... any update on this issue?

sjbeskur avatar Feb 27 '24 23:02 sjbeskur

@CasperN Sorry to tag you out of the blue, but I see you merged #8106 - do you know how to update the flatbuffers crate?

nihohit avatar Feb 28 '24 07:02 nihohit

@fawdlstty what was causing your issue? I'm seeing the same error on my end and am unsure how to resolve. Thanks!

rukmal avatar Mar 27 '24 16:03 rukmal

@rukmal Can the handling methods mentioned by others earlier not solve your problem? If it cannot be solved, you may have encountered another problem. You can add some supplements to your question

fawdlstty avatar Mar 28 '24 01:03 fawdlstty