irondash / cargokit

Integrate cargo build with flutter plugins and applications.
Other
51 stars 16 forks source link

Rust compiler errors hidden in `flutter run` #48

Open AlienKevin opened 6 months ago

AlienKevin commented 6 months ago

Hi, I'm using flutter_rust_bridge V2 which uses cargokit under the hood. I noticed that when I have a compiler error in my Rust code, it's not showing up when executing flutter run. Instead, there's only a mysterious one-liner error message: Could not build the precompiled application for the device.

I had to do flutter run -v, browse through the massive trace, and finally find out that the rust library is messed up due to the overwrite. So currently as a workaround, I've been manually running cargo build to see if my Rust is free of any compiler errors, before executing flutter run.

I think it'd be nice to show the compiler errors at the default log level when executing flutter run, so that the user is aware of why the build failed.

knopp commented 6 months ago

This unfortunately seems more like a problem with flutter tool. In case of exception or build failure, anything with SEVERE level in cargokit gets logged to stderr. I can't really do anything about flutter tool not always logging this.

Hopefully this will change once cargokit can be migrated to native assets.