Closed flowhorn closed 2 weeks ago
Hi! Thanks for opening your first issue here! :smile:
Hmm, looks like currently frb needs no-modules
but may be relaxed - feel free to PR for this! On the other hand, maybe we can ask in zstd
repo about whether it can be compiled under no-modules mode.
In addition, it may also be some bug in wasm compile: https://github.com/rust-lang/rust/issues/93557 - could you please try that and see whether it solves the problem?
Thank you for the quick reply and telling about the limitation of no-modules. I will create in issue in the zstd-rs library for using the library with no-modules, as no trick with wasm-pack helped me actually compiling it. For now I switched to another library for zstd: ruzstd. This worked for me for now.
It's fun to integrate rust code into my app, thank you for your work!
You are welcome and happy to see it works!
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.
Describe the bug
I try to integrate the zstd library into the rust code. When doing this, I get this to compile for all targets except for wasm/web.
This is the error message I received:
My cargo.toml includes these two dependencies:
I got zstd to compile to the wasm32-unknown-unknown target, but I didn't got this to work with the no-modules restriction, do you have any solution for this? As there is no support for zstd in dart, I thought that this would be useful to use the rust_bridge for, and on other targets this worked perfectly.
Best regards.
Steps to reproduce
Add these dependencies:
[dependencies] flutter_rust_bridge = "=2.0.0-dev.32" zstd = { git = "https://github.com/jbms/zstd-rs.git", branch = "fix-wasm32-unknown-unknown" }
utils.rs (+ adding this in mod.rs):
Running flutter_rust_bridge_codegen build-web
Logs
Expected behavior
No response
Generated binding code
No response
OS
MacOS
Version of
flutter_rust_bridge_codegen
2.0.0-dev.32
Flutter info
No response
Version of
clang++
Homebrew clang version 18.1.4
Additional context
No response