-
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
flutter_rust_bridge_codegen
crashes - When Rust's Command
executes a shell command, system complains can not find the stated file
#112
Comments
Hi! Thanks for opening your first issue here! 😄 |
Hi let me have a look |
Look at Google translate says that sentence means Thus, it seems that the command cannot be found. It may be caused by wrong environment settings. Indeed I simply use Rust's builtin Possibly related: #81 Could you please have a try on what is mentioned there? By the way, please paste logs with RUST_LOG=debug environment variable set, such that we can see more details. |
flutter_rust_bridge_codegen
crashes - When Rust's Command
executes a shell command, system complains can not find the stated file
THX for your fast response. Ok I see, I didn't realize it is the dart command, that is not found. I thought something with /,\ or \ This seems a wired thing, on the command line, all fine, dart is executed:
Sure it missed the yaml file, but dart is found. Your test code
fails also:
same error... with spaning first the windows shell all is fine:
now all is fine, dart is found, the same error about the yaml
There seems some wired search things happening on windows, or it mus be an exe, in the flutter install, the dart command is a bat file... Anyway, a handling of the command like in the rust docs seems fixing it for me:
|
Sounds reasonable! Let me add your suggestion ("cmd /C", and "sh -c") and push to master branch. You may try this after I push the new code and it passes CI. |
Some more investigations of the problem, it seems it is the exe / bat thing in my case. Command on windows only spawns exe correct, not bat, like the flutter install of the dart.bat. There is a fix in the rust pipeline, there seems also security problems in the actual behaviour: This will hopefully fix the problem in rust, but if you can change it, fantastic, I will try it. THX!!! |
You are welcome! Let me change the code. |
Well I gave up. I do not have a windows computer with Rust/Dart, so I have to use the GitHub CI to see whether a fix works. Thus it is very time-consuming, and I cannot figure out what is happening (since I cannot use the shell in the CI). The code is in this branch: https://github.com/fzyzcjy/flutter_rust_bridge/tree/rust-command . Could you please checkout this branch and try to fix it on your own machine? I have added the
|
Feel free to make a PR if you find out the minor change to make it work, and I will add you to the |
Close since #119 is merged. Feel free to open issue if the problem is still not solved! |
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
Running the command
flutter_rust_bridge_codegen --rust-input rust\src\api.rs --dart-output rust\src\bridge_generated.dart
crashes on my system, the C headerfile is emptyCodegen logs
Development environment (please complete the following information):
flutter_rust_bridge_codegen
: 1.2.0flutter doctor -v
:• Flutter version 2.5.3 at E:\projects\smarwag\env\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 18116933e7 (7 days ago), 2021-10-15 10:46:35 -0700
• Engine revision d3ea636dc5
• Dart version 2.14.4
[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at C:\Users\mw.EFC\AppData\Local\Android\sdk
• Platform android-31, build-tools 31.0.0
• Java binary at: E:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.11.5)
• Visual Studio at E:\Program Files\Microsoft Visual Studio\2019\Community
• Visual Studio Community 2019 version 16.11.31729.503
• Windows 10 SDK version 10.0.19041.0
[√] Android Studio (version 2020.3)
• Android Studio at E:\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 11.0.10+0-b96-7249189)
[√] VS Code (version 1.61.2)
• VS Code at C:\Users\mw.EFC\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.27.0
[√] Connected device (3 available)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19043.1288]
• Chrome (web) • chrome • web-javascript • Google Chrome 94.0.4606.81
• Edge (web) • edge • web-javascript • Microsoft Edge 91.0.864.48
• No issues found!
clang++
: 13cbindgen
:0.20ffigen
: 4.1.0Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: