Closed jsvanv closed 2 years ago
Hi! Thanks for opening your first issue here! :smile:
Hmm have you followed the book https://fzyzcjy.github.io/flutter_rust_bridge/ ? And what about https://github.com/fzyzcjy/flutter_rust_bridge/blob/d886dc968d6e1661400e987655d953130cdbf401/.github/workflows/ci.yaml the CI as a hint
Yeah, I followed the book first and was reviewing it to make sure there was nothing I missed before posting.
The only noticeable difference between my setup and what the CI is doing is that the CI is installing Corrosion. But isn't that for generating the code? I'm trying to use the pregenerated stuff.
At any rate, I installed Corrosion on my desktop and nothing changed. I'll try on my laptop later in case there's any subtle configuration differences causing a problem, but it's probably not the answer.
Interesting.. Could you please find out more logs for that error? Currently the log does not seem to carry very useful information...
Maybe this will help. My desktop logs have a more specific complaint: they can't find specific macros, and that's why it won't compile. Hopefully it's the same problem. Not sure why my laptop isn't reporting this though.
EDIT: Whoops, posted the log for the wrong project. Not that it matters much since they are both doing the same thing, but the context for this issue is the example project.
Building Windows application...
CUSTOMBUILD : error : cannot find macro `stringify` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find attribute `derive` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find attribute `derive` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find attribute `derive` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : could not compile `cfg-if` due to 2 previous errors [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : warning : build failed, waiting for other jobs to finish... [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find macro `debug_assert` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find attribute `derive` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find macro `panic` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find macro `panic` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find macro `panic` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find macro `panic` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find attribute `test` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find macro `assert_eq` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find macro `assert_eq` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find macro `assert_eq` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find macro `assert_eq` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find macro `assert_eq` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find macro `assert_eq` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find attribute `test` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find macro `assert_eq` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find macro `assert_eq` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find attribute `test` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find attribute `test` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find macro `assert_eq` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find macro `assert_eq` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find attribute `test` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find macro `assert_eq` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find macro `assert_eq` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find macro `assert_eq` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find attribute `test` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find macro `assert` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find attribute `derive` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find macro `unreachable` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find macro `unreachable` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find macro `matches` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find attribute `derive` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find attribute `derive` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find macro `write` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find macro `write` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find attribute `derive` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find attribute `derive` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find macro `write` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find macro `panic` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find macro `cfg` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find macro `panic` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find macro `cfg` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find macro `panic` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find macro `cfg` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find macro `panic` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find macro `cfg` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find macro `panic` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find macro `cfg` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find macro `panic` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find macro `assert` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find macro `assert` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find macro `assert` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find macro `assert` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find macro `assert` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find macro `debug_assert` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find macro `assert` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find macro `assert` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find macro `assert` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find macro `assert` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find macro `assert` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find macro `assert` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find macro `assert` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find macro `vec` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find attribute `derive` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find attribute `derive` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : cannot find attribute `derive` in this scope [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
...
CUSTOMBUILD : error : build failed [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(245,5): error MSB8066: Custom build for 'C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\CMakeFiles\2258dd40b3bafcd9f50f73c9c828a516\cargo-build_flutter_rust_bridge_example.rule' exited with code 1. [C:\Users\jsvanv\IdeaProjects\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
Exception: Build process failed.
Interesting... How can such macros (built-ins!) not exist? Does a search for these errors result in something useful?
Googling around for these errors doesn't seem to reveal much so far, but I'll have some more time to dig later in the day.
Alright, I have an idea.
std
is being excluded somehow.
You said that the built-ins somehow don't exist, but it looks like they can be told to go away. In this issue, people noted that the wasm-builder
crate excludes std
by default.
Something in the build process is telling std
that it can't hang out.
I think we might be venturing into no_std
territory here, which definitely isn't supported yet by this library and all of our dependencies. We would definitely appreciate any insights into the viability of this target however!
I'm a little confused by your comment. I'm not trying to make no_std
possible, if that's what you are suggesting. I'm trying to figure out why std
is leaving the compiling process, and I think it's a dependency doing it. My apologizes if I'm misunderstanding.
Interesting... Are you using intel x64 win10, or some other architecture like ARM? Since it works pretty well on most people's windows.
In addition, maybe search how to debug which crate deliberately remove std
Yeah, it's x64 Win10.
I was looking around in the code for something that could be removing std but I don't really have any leads so far.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hi everybody. I found myself with the same problem and debugging the VC++ project through Visual Studio, the solution was to install a target for the rustup toolchain.
For me, rustup target add x86_64-pc-windows-msvc
did the trick.
There is four available. Pick the one most suitable for your setup.
rustup target add x86_64-pc-windows-msvc
rustup target add x86_64-pc-windows-gnu
rustup target add i686-pc-windows-msvc
rustup target add i686-pc-windows-gnu
I can say this is not windows 10 related because i am using windows 7 right now.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
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 was having problems compiling a project using flutter_rust_bridge, so I decided to see if I could compile the example project to run on Windows.
Turns out, no, I can't even compile that. The following error occurs:
The error is non-deterministic; I assume it is trying to compile multiple libraries in parallel, as instead of
cfg-if
, it'sscopeguard
this time:Since it was a Visual Studio error, I went and installed most of the Desktop Development with C++ and Universal Windows Platform Development libraries to see if that would resolve it. Nope.
I'm also getting the same error on both my laptop and my desktop.
Any suggestions would be greatly appreciated. I'm assuming the problem is on my end and I missed something small.
Codegen logs with
RUST_LOG=debug
env variableTo Reproduce
No response
Expected behavior
No response
Generated binding code
No response
OS
Windows 10
Version of
flutter_rust_bridge_codegen
1.23.0
Flutter info
Version of
clang++
13.0.0 via Visual Studio 2022 Installer
Version of
cbindgen
0.20.0
Version of
ffigen
4.1.3
Additional context
No response