fzyzcjy / flutter_rust_bridge

Flutter/Dart <-> Rust binding generator, feature-rich, but seamless and simple.
https://fzyzcjy.github.io/flutter_rust_bridge/
MIT License
4.09k stars 278 forks source link

[Bug] Example does not compile on Windows 10 #393

Closed jsvanv closed 2 years ago

jsvanv commented 2 years ago

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:


CUSTOMBUILD : error : aborting due to previous error [C:\Users\jsvanv\workspace\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : could not compile `cfg-if` [C:\Users\jsvanv\workspace\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\workspace\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : aborting due to previous error [C:\Users\jsvanv\workspace\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : aborting due to previous error [C:\Users\jsvanv\workspace\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : aborting due to previous error [C:\Users\jsvanv\workspace\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : aborting due to previous error [C:\Users\jsvanv\workspace\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : aborting due to previous error [C:\Users\jsvanv\workspace\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : aborting due to previous error [C:\Users\jsvanv\workspace\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : aborting due to previous error [C:\Users\jsvanv\workspace\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : build failed [C:\Users\jsvanv\workspace\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\workspace\flutter_rust_bridge\frb_example\with_flutter\build\windows\CMakeFiles\f6b4aecd41cdd871605c5ca941036515\cargo-build_flutter_rust_bridge_example.rule' exited with code 1. [C:\Users\jsvanv\workspace\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
Exception: Build process failed.

The error is non-deterministic; I assume it is trying to compile multiple libraries in parallel, as instead of cfg-if, it's scopeguard this time:

Launching lib\main.dart on Windows in debug mode...
Building Windows application...
CUSTOMBUILD : error : aborting due to previous error [C:\Users\jsvanv\workspace\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : aborting due to previous error [C:\Users\jsvanv\workspace\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : aborting due to previous error [C:\Users\jsvanv\workspace\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : could not compile `scopeguard` [C:\Users\jsvanv\workspace\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\workspace\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : aborting due to previous error [C:\Users\jsvanv\workspace\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : aborting due to previous error [C:\Users\jsvanv\workspace\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : aborting due to previous error [C:\Users\jsvanv\workspace\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : aborting due to previous error [C:\Users\jsvanv\workspace\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : aborting due to previous error [C:\Users\jsvanv\workspace\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
CUSTOMBUILD : error : build failed [C:\Users\jsvanv\workspace\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\workspace\flutter_rust_bridge\frb_example\with_flutter\build\windows\CMakeFiles\f6b4aecd41cdd871605c5ca941036515\cargo-build_flutter_rust_bridge_example.rule' exited with code 1. [C:\Users\jsvanv\workspace\flutter_rust_bridge\frb_example\with_flutter\build\windows\cargo-build_flutter_rust_bridge_example.vcxproj]
Exception: Build process failed.

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 variable

Not relevant; using example's pregenerated code

To 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

(Android complaint is irrelevant since I'm not trying to deploy for Android.)

[√] Flutter (Channel stable, 2.10.3, on Microsoft Windows [Version 10.0.19043.1586], locale en-US)
    • Flutter version 2.10.3 at C:\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 7e9793dee1 (3 weeks ago), 2022-03-02 11:23:12 -0600
    • Engine revision bd539267b4
    • Dart version 2.16.1
    • DevTools version 2.9.2

[!] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at C:\Users\jsvanv\AppData\Local\Android\sdk
    X cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    X Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.1.1)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.1.32228.430
    • Windows 10 SDK version 10.0.20348.0

[√] Android Studio (version 3.1)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)

[√] Android Studio (version 3.6)
    • Android Studio at C:\Users\jsvanv\android-studio
    • Flutter plugin version 44.0.2
    • Dart plugin version 192.7761
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)

[√] IntelliJ IDEA Community Edition (version 2021.3)
    • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2019.2
    • Flutter plugin version 65.2.4
    • Dart plugin version 213.7227

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.19043.1586]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 88.0.4324.182
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 93.0.961.47

[√] HTTP Host Availability
    • All required HTTP hosts are available

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

welcome[bot] commented 2 years ago

Hi! Thanks for opening your first issue here! :smile:

fzyzcjy commented 2 years ago

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

jsvanv commented 2 years ago

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.

fzyzcjy commented 2 years ago

Interesting.. Could you please find out more logs for that error? Currently the log does not seem to carry very useful information...

jsvanv commented 2 years ago

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.
fzyzcjy commented 2 years ago

Interesting... How can such macros (built-ins!) not exist? Does a search for these errors result in something useful?

jsvanv commented 2 years ago

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.

jsvanv commented 2 years ago

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.

Desdaemon commented 2 years ago

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!

jsvanv commented 2 years ago

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.

fzyzcjy commented 2 years ago

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

jsvanv commented 2 years ago

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.

stale[bot] commented 2 years ago

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.

andremeireles commented 2 years ago

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.

stale[bot] commented 2 years ago

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.

github-actions[bot] commented 2 years ago

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.