Closed Roms1383 closed 1 year ago
I had to shorten the logs output because it was exceeding Github limit.
what is the full output log about that "failed to lookup symbol", i.e. output of execution
This output @fzyzcjy :
flutter_rust_bridge example program start (dylibPath=../../../rust/target/debug/libflutter_rust_bridge_example.dylib)
construct api
Unhandled exception:
Invalid argument(s): Failed to lookup symbol 'store_dart_post_cobject': dlsym(RTLD_DEFAULT, store_dart_post_cobject): symbol not found
#0 DynamicLibrary.lookup (dart:ffi-patch/ffi_dynamic_library_patch.dart:34:70)
#1 FlutterRustBridgeExampleSingleBlockTestWire._store_dart_post_cobjectPtr (package:flutter_rust_bridge_example/bridge_generated.io.dart:1573:76)
#2 FlutterRustBridgeExampleSingleBlockTestWire._store_dart_post_cobjectPtr (package:flutter_rust_bridge_example/bridge_generated.io.dart)
#3 FlutterRustBridgeExampleSingleBlockTestWire._store_dart_post_cobject (package:flutter_rust_bridge_example/bridge_generated.io.dart:1574:41)
#4 FlutterRustBridgeExampleSingleBlockTestWire._store_dart_post_cobject (package:flutter_rust_bridge_example/bridge_generated.io.dart)
#5 FlutterRustBridgeExampleSingleBlockTestWire.store_dart_post_cobject (package:flutter_rust_bridge_example/bridge_generated.io.dart:1567:12)
#6 StoreDartPostCObjectExt.storeDartPostCObject (package:flutter_rust_bridge/src/ffi/io.dart:16:5)
#7 FlutterRustBridgeBase._setUpRustToDartComm (package:flutter_rust_bridge/src/basic.dart:39:11)
#8 new FlutterRustBridgeBase (package:flutter_rust_bridge/src/basic.dart:22:5)
#9 new FlutterRustBridgeExampleSingleBlockTestPlatform (package:flutter_rust_bridge_example/bridge_generated.io.dart:19:9)
#10 new FlutterRustBridgeExampleSingleBlockTestImpl (package:flutter_rust_bridge_example/bridge_generated.dart:16:55)
#11 initializeExternalLibrary (package:flutter_rust_bridge_example/ffi.io.dart:8:10)
#12 main (package:flutter_rust_bridge_example/main.dart:17:15)
#13 _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:295:32)
#14 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:192:12)
I got the path messed up in my previous output, so I fixed it (dylibPath=../../../target/debug/libflutter_rust_bridge_example.dylib)
So I added a safety net to make sure in main.dart
e.g. :
if (!File(dylibPath).existsSync()) {
throw Exception('$dylibPath does not exist');
}
But the error persists ! 😅
Use some tools to see what is inside that dylib file.
For a linux .so file, we have nm
and objdump
etc. For macos IIRC there are similar things.
Then, we can know whether the symbol is really in the dylib, and if yes, what is the signature of that symbol.
I noticed that the dummy codegen doesn't appear in the bridge_generated.*
files, is this important ? It seems related :
pub const DUMMY_WIRE_CODE_FOR_BINDGEN: &str = r#"
// ----------- DUMMY CODE FOR BINDGEN ----------
// copied from: allo-isolate
pub type DartPort = i64;
pub type DartPostCObjectFnType = unsafe extern "C" fn(port_id: DartPort, message: *mut std::ffi::c_void) -> bool;
#[no_mangle] pub unsafe extern "C" fn store_dart_post_cobject(ptr: DartPostCObjectFnType) { panic!("dummy code") }
// copied from: frb_rust::support.rs
#[repr(C)]
pub struct WireSyncReturnStruct {
pub ptr: *mut u8,
pub len: i32,
pub success: bool,
}
// ---------------------------------------------
"#;
IIRC that is created and then removed later? forget the details
I'm sorry I actually don't know what is IIRC (answers on Google seemed unrelated, even with keywords). People recommended otool
on macos but ... I don't even know what I'm supposed to look for ^^'
Ah wait, here you go I guess nm -gU target/debug/libflutter_rust_bridge_example.dylib
.
Apparently the symbol is present : 0000000000128b5c T _store_dart_post_cobject
;)
the weird thing is:
void store_dart_post_cobject(
DartPostCObjectFnType ptr,
) {
return _store_dart_post_cobject(
ptr,
);
}
late final _store_dart_post_cobjectPtr =
_lookup<ffi.NativeFunction<ffi.Void Function(DartPostCObjectFnType)>>('store_dart_post_cobject');
late final _store_dart_post_cobject = _store_dart_post_cobjectPtr.asFunction<void Function(DartPostCObjectFnType)>();
typedef DartPostCObjectFnType = ffi.Pointer<ffi.NativeFunction<ffi.Bool Function(DartPort, ffi.Pointer<ffi.Void>)>>;
typedef DartPort = ffi.Int64;
that type looks correct to me
so maybe do some reduction?
for example, write some dart code:
Found it :
If I replace :
DynamicLibrary.executable()
with DynamicLibrary.open(path)
(like in non-IOS/MacOS) in frb_example/pure_dart/dart/lib/ffi.io.dart
it works.
FlutterRustBridgeExampleSingleBlockTestImpl initializeExternalLibrary(String path) {
return FlutterRustBridgeExampleSingleBlockTestImpl(
Platform.isMacOS || Platform.isIOS ? DynamicLibrary.executable() : DynamicLibrary.open(path),
);
}
I have no idea why though.
Is this MacOS ARM specific ? or is DynamicLibrary.executable()
wrong for all iOS/MacOS ?
weird... the lib works well for me, in macos intel
Should we add another check based on Platform.operatingSystemVersion to differentiate between MacOS Intel and MacOS ARM ? I checked already there's no mention of M1 in e.g. Platform.isIOS
and the other methods.
Here's what I get on my machine : Version 12.4 (Build 21F79)
really not sure what is happening here. maybe not a problem between m1 and intel, but problem elsewhere in the toolchain config?
maybe add this to doc, telling people to try changing what you have changed.
and also add a link from doc to here. if many people see same problem we will know whether it is M1 or sth else causes it
I might be a bit slow, but I'll try to do it asap 👌
I'm gonna include a quick fix in the coming PR #755 to remediate :
By changing ffi.io.dart
files from:
e.g. flutter_rust_bridge/frb_example/pure_dart/dart/lib/ffi.io.dart
// ...
FlutterRustBridgeExampleSingleBlockTestImpl initializeExternalLibrary(String path) {
return FlutterRustBridgeExampleSingleBlockTestImpl(
Platform.isMacOS || Platform.isIOS ? DynamicLibrary.executable() : DynamicLibrary.open(path),
);
}
To:
// ...
FlutterRustBridgeExampleSingleBlockTestImpl initializeExternalLibrary(String path) {
return FlutterRustBridgeExampleSingleBlockTestImpl(
(Platform.isMacOS || Platform.isIOS) &&
!const bool.fromEnvironment('SILICON', defaultValue: false)
? DynamicLibrary.executable()
: DynamicLibrary.open(path),
);
}
And updating related just
commands to accept extra CLI arg(s) + pipe it to Dart run command, one can just append --define=SILICON=true
to his/her commands to workaround this issue until Dart provide a way to clearly differentiate a MacOS Silicon from an older generation MacOS and be handled automatically by FRB.
@Roms1383 LGTM, just a few small points
could you please make it a separate PR, so it is easier to manage :)
That's a bit tedious, but can if you want.
maybe change it to DYNAMIC_LIBRARY_SOURCE which is an enum (string)
Hmmm why DYNAMIC_LIBRARY_SOURCE ? SILICON seems more explicit, doesn't it ?
That's a bit tedious, but can if you want.
According to flutter
repo suggestion, even one PR for one very tiny change :)
Hmmm why DYNAMIC_LIBRARY_SOURCE ? SILICON seems more explicit, doesn't it ?
Usage: --define DYNAMIC_LIBRARY_SOURCE=executable
, --define DYNAMIC_LIBRARY_SOURCE=path
, etc
@fzyzcjy am I allowed to upgrade Dart SDK minimum requirement from 2.14.0
to 2.17.0
? That would allow using enhanced-enums feature from Dart, and be able to write cool stuff like e.g. :
enum DylibSourceKind {
process,
executable,
open;
static DylibSourceKind? fromEnvironment(String arg) {
// ...
}
}
I think so, especially we have made min rust be 1.64.0.
Don't have an Intel Mac to test this, but I suspect DynamicLibrary.executable
for pure_dart MacOS might be bugged code. That method points to the dart
executable as the dylib source, so understandably it won't have our symbols. If this is true, it wouldn't really matter if it was on Apple Silicon or not. Also I don't think we're running unit tests on iOS so the entire conditional dylib loading can be omitted.
Interestingly, as reported in https://github.com/fzyzcjy/flutter_rust_bridge/issues/772#issuecomment-1272678708, seems another M1 person sees this problem
I had the same issue on a Flutter project. It's solved by this:
final Native api = NativeImpl(
((io.Platform.isIOS || io.Platform.isMacOS) && !const bool.fromEnvironment('SILICON', defaultValue: false))
? DynamicLibrary.executable()
: DynamicLibrary.open(_dylib));
I ran into this problem trying to write a dart test of my rust code on an m1 mac.
Here I forked the template and added one tiny unittest. When I run flutter test test/bridge_test.dart
I get the Failed to lookup symbol 'store_dart_post_cobject': dlsym(RTLD_DEFAULT, store_dart_post_cobject): symbol not found
error.
The SILICON
environment variable mentioned above doesn't work and gives this error:
Invalid argument(s): Failed to load dynamic library 'libbridge.so': dlopen(libbridge.so, 0x0001): tried: '/Users/justin/bin/flutter/bin/cache/artifacts/engine/darwin-x64/./libbridge.so' (no such file), '/Users/justin/bin/flutter/bin/cache/artifacts/engine/darwin-x64/../../../libbridge.so' (no such file), '/Users/justin/bin/flutter/bin/cache/artifacts/engine/darwin-x64/Frameworks/libbridge.so' (no such file), '/Users/justin/bin/flutter/bin/cache/artifacts/engine/darwin-x64/./libbridge.so' (no such file), '/Users/justin/bin/flutter/bin/cache/artifacts/engine/darwin-x64/../../../libbridge.so' (no such file), '/Users/justin/bin/flutter/bin/cache/artifacts/engine/darwin-x64/Frameworks/libbridge.so' (no such file), 'libbridge.so' (no such file), '/usr/lib/libbridge.so' (no such file), '/Users/justin/fedimint/mobile2/apps/fedi/libbridge.so' (no such file)
The SILICON environment variable
Could you please check whether it is in master branch. If not, you need to modify code as suggested.
@fzyzcjy @justinmoon the SILICON
workaround hasn't been merged yet, please add it manually for now.
@Roms1383 Btw for your SILICON pr - given all these reports, I now totally agree it is named "silicon" and just do it the simple way.
If I just do the following in the template, it still doesn't work with the Failed to load dynamic library 'libbridge.so'
error. So I'm not sure the SILICON
workaround will work for me, because this is what it attempts to do right?
final Native api = NativeImpl(DynamicLibrary.open(_dylib));
I am using an M1 pro machine. I am trying to run a simple rust program on my android emulator. I am getting the following runtime error:
Invalid argument(s): Failed to lookup symbol 'store_dart_post_cobject': undefined symbol: store_dart_post_cobject
My bridge_generated.dart
:
// AUTO GENERATED FILE, DO NOT EDIT.
// Generated by `flutter_rust_bridge`@ 1.49.0.
// ignore_for_file: non_constant_identifier_names, unused_element, duplicate_ignore, directives_ordering, curly_braces_in_flow_control_structures, unnecessary_lambdas, slash_for_doc_comments, prefer_const_literals_to_create_immutables, implicit_dynamic_list_literal, duplicate_import, unused_import, prefer_single_quotes, prefer_const_constructors, use_super_parameters, always_use_package_imports, annotate_overrides, invalid_use_of_protected_member, constant_identifier_names
import 'dart:convert';
import 'dart:async';
import 'package:flutter_rust_bridge/flutter_rust_bridge.dart';
import 'package:meta/meta.dart';
import 'package:meta/meta.dart';
import 'dart:ffi' as ffi;
abstract class AdderFfi {
Future<int> add({required int a, required int b, dynamic hint});
FlutterRustBridgeTaskConstMeta get kAddConstMeta;
}
class AdderFfiImpl implements AdderFfi {
final AdderFfiPlatform _platform;
factory AdderFfiImpl(ExternalLibrary dylib) =>
AdderFfiImpl.raw(AdderFfiPlatform(dylib));
/// Only valid on web/WASM platforms.
factory AdderFfiImpl.wasm(FutureOr<WasmModule> module) =>
AdderFfiImpl(module as ExternalLibrary);
AdderFfiImpl.raw(this._platform);
Future<int> add({required int a, required int b, dynamic hint}) =>
_platform.executeNormal(FlutterRustBridgeTask(
callFfi: (port_) => _platform.inner.wire_add(
port_, _platform.api2wire_i64(a), _platform.api2wire_i64(b)),
parseSuccessData: _wire2api_i64,
constMeta: kAddConstMeta,
argValues: [a, b],
hint: hint,
));
FlutterRustBridgeTaskConstMeta get kAddConstMeta =>
const FlutterRustBridgeTaskConstMeta(
debugName: "add",
argNames: ["a", "b"],
);
// Section: wire2api
int _wire2api_i64(dynamic raw) {
return castInt(raw);
}
}
// Section: api2wire
class AdderFfiPlatform extends FlutterRustBridgeBase<AdderFfiWire> {
AdderFfiPlatform(ffi.DynamicLibrary dylib) : super(AdderFfiWire(dylib));
// Section: api2wire
@protected
int api2wire_i64(int raw) {
return raw;
}
// Section: api_fill_to_wire
}
// ignore_for_file: camel_case_types, non_constant_identifier_names, avoid_positional_boolean_parameters, annotate_overrides, constant_identifier_names
// AUTO GENERATED FILE, DO NOT EDIT.
//
// Generated by `package:ffigen`.
/// generated by flutter_rust_bridge
class AdderFfiWire implements FlutterRustBridgeWireBase {
/// Holds the symbol lookup function.
final ffi.Pointer<T> Function<T extends ffi.NativeType>(String symbolName)
_lookup;
/// The symbols are looked up in [dynamicLibrary].
AdderFfiWire(ffi.DynamicLibrary dynamicLibrary)
: _lookup = dynamicLibrary.lookup;
/// The symbols are looked up with [lookup].
AdderFfiWire.fromLookup(
ffi.Pointer<T> Function<T extends ffi.NativeType>(String symbolName)
lookup)
: _lookup = lookup;
void store_dart_post_cobject(
DartPostCObjectFnType ptr,
) {
return _store_dart_post_cobject(
ptr,
);
}
late final _store_dart_post_cobjectPtr =
_lookup<ffi.NativeFunction<ffi.Void Function(DartPostCObjectFnType)>>(
'store_dart_post_cobject');
late final _store_dart_post_cobject = _store_dart_post_cobjectPtr
.asFunction<void Function(DartPostCObjectFnType)>();
void wire_add(
int port_,
int a,
int b,
) {
return _wire_add(
port_,
a,
b,
);
}
late final _wire_addPtr = _lookup<
ffi.NativeFunction<
ffi.Void Function(ffi.Int64, ffi.Int64, ffi.Int64)>>('wire_add');
late final _wire_add =
_wire_addPtr.asFunction<void Function(int, int, int)>();
void free_WireSyncReturnStruct(
WireSyncReturnStruct val,
) {
return _free_WireSyncReturnStruct(
val,
);
}
late final _free_WireSyncReturnStructPtr =
_lookup<ffi.NativeFunction<ffi.Void Function(WireSyncReturnStruct)>>(
'free_WireSyncReturnStruct');
late final _free_WireSyncReturnStruct = _free_WireSyncReturnStructPtr
.asFunction<void Function(WireSyncReturnStruct)>();
}
typedef DartPostCObjectFnType = ffi.Pointer<
ffi.NativeFunction<ffi.Bool Function(DartPort, ffi.Pointer<ffi.Void>)>>;
typedef DartPort = ffi.Int64;
@SAGARSURI please create a new issue with full info. there can be many reasons of this
Sure I will. Thanks.
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
Ok, this is the well-known bug that has been reported many times already. I got it in the past and got rid of it by following people's recommendations in
Discussions
orIssues
. This time I'm stuck with this bug for over a couple of weeks and until now it was fine because I'll just runjust test-pure-web
instead or peek at the CI worklows execution (which just works fine, contrary to my machine lol). But this time I'm testing something and I would really like to be able to runjust test-pure
locally and track my progress here.I've already tried a bunch of stuff before opening this
Issue
, also fixed paths around (now that we switched tocargo workspace
, thetarget
folder is systematically in root folder, not in each crate's folder).Codegen logs with
RUST_LOG=debug
environment variableclick to display
```shell ➜ frb_example git:(experiment) ✗ RUST_LOG=debug just refresh_all just gen-help cargo run --manifest-path frb_codegen/Cargo.toml -- --help > book/src/help.txt Compiling flutter_rust_bridge_codegen v1.48.0 (/Users/romain/Development/contributions/flutter_rust_bridge/frb_codegen) Finished dev [unoptimized + debuginfo] target(s) in 3.01s Running `target/debug/flutter_rust_bridge_codegen --help` dart run frb_dart/bin/serve.dart --help > book/src/help.serve.txt just gen-bridge cd frb_codegen && cargo build Finished dev [unoptimized + debuginfo] target(s) in 0.06s (cd frb_example/with_flutter && flutter pub get) Running "flutter pub get" in with_flutter... 2,383ms cargo run --manifest-path frb_codegen/Cargo.toml -- -r frb_example/with_flutter/rust/src/api.rs -d frb_example/with_flutter/lib/bridge_generated.dart --dart-decl-output frb_example/with_flutter/lib/bridge_definitions.dart -c frb_example/with_flutter/ios/Runner/bridge_generated.h -c frb_example/with_flutter/macos/Runner/bridge_generated.h --dart-format-line-length 120 --wasm Finished dev [unoptimized + debuginfo] target(s) in 0.05s Running `target/debug/flutter_rust_bridge_codegen -r frb_example/with_flutter/rust/src/api.rs -d frb_example/with_flutter/lib/bridge_generated.dart --dart-decl-output frb_example/with_flutter/lib/bridge_definitions.dart -c frb_example/with_flutter/ios/Runner/bridge_generated.h -c frb_example/with_flutter/macos/Runner/bridge_generated.h --dart-format-line-length 120 --wasm` [2022-09-30T09:56:29Z DEBUG flutter_rust_bridge_codegen] configs=[Opts { rust_input_path: "/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/rust/src/api.rs", dart_output_path: "/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/lib/bridge_generated.dart", dart_decl_output_path: Some("/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/lib/bridge_definitions.dart"), c_output_path: ["/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/ios/Runner/bridge_generated.h", "/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/macos/Runner/bridge_generated.h"], rust_crate_dir: "/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/rust", rust_output_path: "/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/rust/src/bridge_generated.rs", class_name: "FlutterRustBridgeExample", dart_format_line_length: 120, skip_add_mod_to_lib: false, llvm_path: ["/opt/homebrew/opt/llvm", "/usr/local/opt/llvm", "/usr/lib/llvm-9", "/usr/lib/llvm-10", "/usr/lib/llvm-11", "/usr/lib/llvm-12", "/usr/lib/llvm-13", "/usr/lib/llvm-14", "/usr/lib/", "/usr/lib64/", "C:/Program Files/llvm", "C:/msys64/mingw64"], compiler_opts: "", manifest_path: "/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/rust/Cargo.toml", dart_root: Some("/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter"), build_runner: true, block_index: BlockIndex(0), skip_deps_check: false, wasm_enabled: true, inline_rust: false, bench_extended: true }] [2022-09-30T09:56:29Z DEBUG lib_flutter_rust_bridge_codegen::source_graph] Trying to parse "/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/rust/src/api.rs" [2022-09-30T09:56:29Z DEBUG lib_flutter_rust_bridge_codegen::source_graph] Trying to parse "/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/rust/src/bridge_generated.rs" [2022-09-30T09:56:29Z WARN lib_flutter_rust_bridge_codegen::source_graph] Skipping unresolvable module web (tried /Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/rust/src/web.rs, /Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/rust/src/web/mod.rs, /Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/rust/src/bridge_generated/web.rs, /Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/rust/src/bridge_generated/web/mod.rs, ) [2022-09-30T09:56:29Z WARN lib_flutter_rust_bridge_codegen::source_graph] Skipping unresolvable module io (tried /Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/rust/src/io.rs, /Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/rust/src/io/mod.rs, /Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/rust/src/bridge_generated/io.rs, /Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/rust/src/bridge_generated/io/mod.rs, ) [2022-09-30T09:56:29Z DEBUG lib_flutter_rust_bridge_codegen::source_graph] Trying to parse "/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/rust/src/off_topic_code.rs" [2022-09-30T09:56:29Z DEBUG lib_flutter_rust_bridge_codegen::parser] parse_function function name: Ident(draw_mandelbrot) [2022-09-30T09:56:29Z DEBUG lib_flutter_rust_bridge_codegen::parser] parse_function function name: Ident(passing_complex_structs) [2022-09-30T09:56:29Z DEBUG lib_flutter_rust_bridge_codegen::parser] parse_function function name: Ident(returning_structs_with_boxed_fields) [2022-09-30T09:56:29Z DEBUG lib_flutter_rust_bridge_codegen::parser] parse_function function name: Ident(off_topic_memory_test_input_array) [2022-09-30T09:56:29Z DEBUG lib_flutter_rust_bridge_codegen::parser] parse_function function name: Ident(off_topic_memory_test_output_zero_copy_buffer) [2022-09-30T09:56:29Z DEBUG lib_flutter_rust_bridge_codegen::parser] parse_function function name: Ident(off_topic_memory_test_output_vec_u8) [2022-09-30T09:56:29Z DEBUG lib_flutter_rust_bridge_codegen::parser] parse_function function name: Ident(off_topic_memory_test_input_vec_of_object) [2022-09-30T09:56:29Z DEBUG lib_flutter_rust_bridge_codegen::parser] parse_function function name: Ident(off_topic_memory_test_output_vec_of_object) [2022-09-30T09:56:29Z DEBUG lib_flutter_rust_bridge_codegen::parser] parse_function function name: Ident(off_topic_memory_test_input_complex_struct) [2022-09-30T09:56:29Z DEBUG lib_flutter_rust_bridge_codegen::parser] parse_function function name: Ident(off_topic_memory_test_output_complex_struct) [2022-09-30T09:56:29Z DEBUG lib_flutter_rust_bridge_codegen::parser] parse_function function name: Ident(off_topic_deliberately_return_error) [2022-09-30T09:56:29Z DEBUG lib_flutter_rust_bridge_codegen::parser] parse_function function name: Ident(off_topic_deliberately_panic) [2022-09-30T09:56:29Z DEBUG lib_flutter_rust_bridge_codegen::tools] Guessing toolchain the runner is run into [2022-09-30T09:56:29Z DEBUG lib_flutter_rust_bridge_codegen::commands] execute command: bin=sh args="-c \"flutter\" \"--version\"" current_dir=None cmd="sh" "-c" "\"flutter\" \"--version\"" Flutter 3.3.3 • channel stable • https://github.com/flutter/flutter.git Framework • revision 18a827f393 (2 days ago) • 2022-09-28 10:03:14 -0700 Engine • revision 5c984c26eb Tools • Dart 2.18.2 • DevTools 2.15.0 [2022-09-30T09:56:30Z DEBUG lib_flutter_rust_bridge_codegen::commands] command="sh" "-c" "\"flutter\" \"--version\"" stdout= stderr= [2022-09-30T09:56:30Z DEBUG lib_flutter_rust_bridge_codegen::tools] Checking presence of ffi in dependencies at /Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter [2022-09-30T09:56:30Z DEBUG lib_flutter_rust_bridge_codegen::tools] Checking presence of ffi in dependencies at /Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter [2022-09-30T09:56:30Z DEBUG lib_flutter_rust_bridge_codegen::tools] Checking presence of ffigen in dev_dependencies at /Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter [2022-09-30T09:56:30Z DEBUG lib_flutter_rust_bridge_codegen::tools] Checking presence of ffigen in dev_dependencies at /Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter [2022-09-30T09:56:30Z INFO lib_flutter_rust_bridge_codegen] Picked config: Opts { rust_input_path: "/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/rust/src/api.rs", dart_output_path: "/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/lib/bridge_generated.dart", dart_decl_output_path: Some("/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/lib/bridge_definitions.dart"), c_output_path: ["/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/ios/Runner/bridge_generated.h", "/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/macos/Runner/bridge_generated.h"], rust_crate_dir: "/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/rust", rust_output_path: "/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/rust/src/bridge_generated.rs", class_name: "FlutterRustBridgeExample", dart_format_line_length: 120, skip_add_mod_to_lib: false, llvm_path: ["/opt/homebrew/opt/llvm", "/usr/local/opt/llvm", "/usr/lib/llvm-9", "/usr/lib/llvm-10", "/usr/lib/llvm-11", "/usr/lib/llvm-12", "/usr/lib/llvm-13", "/usr/lib/llvm-14", "/usr/lib/", "/usr/lib64/", "C:/Program Files/llvm", "C:/msys64/mingw64"], compiler_opts: "", manifest_path: "/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/rust/Cargo.toml", dart_root: Some("/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter"), build_runner: true, block_index: BlockIndex(0), skip_deps_check: false, wasm_enabled: true, inline_rust: false, bench_extended: true } [2022-09-30T09:56:30Z INFO lib_flutter_rust_bridge_codegen] Phase: Parse source code to AST, then to IR [2022-09-30T09:56:30Z DEBUG lib_flutter_rust_bridge_codegen::source_graph] Trying to parse "/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/rust/src/api.rs" [2022-09-30T09:56:30Z DEBUG lib_flutter_rust_bridge_codegen::source_graph] Trying to parse "/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/rust/src/bridge_generated.rs" [2022-09-30T09:56:30Z WARN lib_flutter_rust_bridge_codegen::source_graph] Skipping unresolvable module web (tried /Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/rust/src/web.rs, /Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/rust/src/web/mod.rs, /Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/rust/src/bridge_generated/web.rs, /Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/rust/src/bridge_generated/web/mod.rs, ) [2022-09-30T09:56:30Z WARN lib_flutter_rust_bridge_codegen::source_graph] Skipping unresolvable module io (tried /Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/rust/src/io.rs, /Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/rust/src/io/mod.rs, /Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/rust/src/bridge_generated/io.rs, /Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/rust/src/bridge_generated/io/mod.rs, ) [2022-09-30T09:56:30Z DEBUG lib_flutter_rust_bridge_codegen::source_graph] Trying to parse "/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/rust/src/off_topic_code.rs" [2022-09-30T09:56:30Z DEBUG lib_flutter_rust_bridge_codegen::parser] parse_function function name: Ident(draw_mandelbrot) [2022-09-30T09:56:30Z DEBUG lib_flutter_rust_bridge_codegen::parser] parse_function function name: Ident(passing_complex_structs) [2022-09-30T09:56:30Z DEBUG lib_flutter_rust_bridge_codegen::parser] parse_function function name: Ident(returning_structs_with_boxed_fields) [2022-09-30T09:56:30Z DEBUG lib_flutter_rust_bridge_codegen::parser] parse_function function name: Ident(off_topic_memory_test_input_array) [2022-09-30T09:56:30Z DEBUG lib_flutter_rust_bridge_codegen::parser] parse_function function name: Ident(off_topic_memory_test_output_zero_copy_buffer) [2022-09-30T09:56:30Z DEBUG lib_flutter_rust_bridge_codegen::parser] parse_function function name: Ident(off_topic_memory_test_output_vec_u8) [2022-09-30T09:56:30Z DEBUG lib_flutter_rust_bridge_codegen::parser] parse_function function name: Ident(off_topic_memory_test_input_vec_of_object) [2022-09-30T09:56:30Z DEBUG lib_flutter_rust_bridge_codegen::parser] parse_function function name: Ident(off_topic_memory_test_output_vec_of_object) [2022-09-30T09:56:30Z DEBUG lib_flutter_rust_bridge_codegen::parser] parse_function function name: Ident(off_topic_memory_test_input_complex_struct) [2022-09-30T09:56:30Z DEBUG lib_flutter_rust_bridge_codegen::parser] parse_function function name: Ident(off_topic_memory_test_output_complex_struct) [2022-09-30T09:56:30Z DEBUG lib_flutter_rust_bridge_codegen::parser] parse_function function name: Ident(off_topic_deliberately_return_error) [2022-09-30T09:56:30Z DEBUG lib_flutter_rust_bridge_codegen::parser] parse_function function name: Ident(off_topic_deliberately_panic) [2022-09-30T09:56:30Z INFO lib_flutter_rust_bridge_codegen] Phase: Transform IR [2022-09-30T09:56:30Z DEBUG lib_flutter_rust_bridge_codegen::transformer] transform_func_input_add_boxed wrap Boxed to field=IrField { ty: StructRef(IrTypeStructRef { name: "Size", freezed: false }), name: IrIdent { raw: "image_size" }, is_final: true, comments: [] } [2022-09-30T09:56:30Z DEBUG lib_flutter_rust_bridge_codegen::transformer] transform_func_input_add_boxed wrap Boxed to field=IrField { ty: StructRef(IrTypeStructRef { name: "Point", freezed: false }), name: IrIdent { raw: "zoom_point" }, is_final: true, comments: [] } [2022-09-30T09:56:30Z DEBUG lib_flutter_rust_bridge_codegen::transformer] transform_func_input_add_boxed wrap Boxed to field=IrField { ty: StructRef(IrTypeStructRef { name: "TreeNode", freezed: false }), name: IrIdent { raw: "root" }, is_final: true, comments: [] } [2022-09-30T09:56:30Z DEBUG lib_flutter_rust_bridge_codegen::transformer] transform_func_input_add_boxed wrap Boxed to field=IrField { ty: StructRef(IrTypeStructRef { name: "TreeNode", freezed: false }), name: IrIdent { raw: "input" }, is_final: true, comments: [] } [2022-09-30T09:56:30Z INFO lib_flutter_rust_bridge_codegen] Phase: Generate Rust code [2022-09-30T09:56:30Z INFO lib_flutter_rust_bridge_codegen] Phase: Generate Dart code [2022-09-30T09:56:30Z DEBUG lib_flutter_rust_bridge_codegen::generator::dart] distinct_input_types=[Delegate(String), Boxed(IrTypeBoxed { exist_in_real_api: false, inner: StructRef(IrTypeStructRef { name: "Point", freezed: false }) }), Boxed(IrTypeBoxed { exist_in_real_api: false, inner: StructRef(IrTypeStructRef { name: "Size", freezed: false }) }), Boxed(IrTypeBoxed { exist_in_real_api: false, inner: StructRef(IrTypeStructRef { name: "TreeNode", freezed: false }) }), Primitive(F64), Primitive(I32), GeneralList(IrTypeGeneralList { inner: StructRef(IrTypeStructRef { name: "Size", freezed: false }) }), GeneralList(IrTypeGeneralList { inner: StructRef(IrTypeStructRef { name: "TreeNode", freezed: false }) }), StructRef(IrTypeStructRef { name: "Point", freezed: false }), StructRef(IrTypeStructRef { name: "Size", freezed: false }), StructRef(IrTypeStructRef { name: "TreeNode", freezed: false }), Primitive(U8), PrimitiveList(IrTypePrimitiveList { primitive: U8 })] [2022-09-30T09:56:30Z DEBUG lib_flutter_rust_bridge_codegen::generator::dart] distinct_output_types=[Delegate(String), Delegate(ZeroCopyBufferVecPrimitive(U8)), Boxed(IrTypeBoxed { exist_in_real_api: true, inner: StructRef(IrTypeStructRef { name: "Point", freezed: false }) }), StructRef(IrTypeStructRef { name: "BoxedPoint", freezed: false }), Primitive(F64), Primitive(I32), GeneralList(IrTypeGeneralList { inner: StructRef(IrTypeStructRef { name: "Size", freezed: false }) }), GeneralList(IrTypeGeneralList { inner: StructRef(IrTypeStructRef { name: "TreeNode", freezed: false }) }), StructRef(IrTypeStructRef { name: "Point", freezed: false }), StructRef(IrTypeStructRef { name: "Size", freezed: false }), StructRef(IrTypeStructRef { name: "TreeNode", freezed: false }), Primitive(U8), PrimitiveList(IrTypePrimitiveList { primitive: U8 })] [2022-09-30T09:56:30Z DEBUG lib_flutter_rust_bridge_codegen::commands] execute format_rust path=["/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/rust/src/bridge_generated.rs", "/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/rust/src/bridge_generated.io.rs", "/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/rust/src/bridge_generated.web.rs"] [2022-09-30T09:56:30Z DEBUG lib_flutter_rust_bridge_codegen::commands] execute command: bin=rustfmt args="/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/rust/src/bridge_generated.rs /Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/rust/src/bridge_generated.io.rs /Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/rust/src/bridge_generated.web.rs" current_dir=None cmd="rustfmt" "/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/rust/src/bridge_generated.rs" "/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/rust/src/bridge_generated.io.rs" "/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/rust/src/bridge_generated.web.rs" [2022-09-30T09:56:30Z DEBUG lib_flutter_rust_bridge_codegen::commands] command="rustfmt" "/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/rust/src/bridge_generated.rs" "/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/rust/src/bridge_generated.io.rs" "/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/rust/src/bridge_generated.web.rs" stdout= stderr= [2022-09-30T09:56:30Z INFO lib_flutter_rust_bridge_codegen] Phase: Generating Dart bindings for Rust [2022-09-30T09:56:30Z DEBUG lib_flutter_rust_bridge_codegen::commands] execute cbindgen rust_crate_dir=/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/rust c_output_path=/var/folders/st/8cddrx857yj1gh8yvj0j499c0000gn/T/.tmpnaQERP.h [2022-09-30T09:56:30Z DEBUG lib_flutter_rust_bridge_codegen::commands] cbindgen config: Config { header: None, includes: [], sys_includes: [ "stdbool.h", "stdint.h", "stdlib.h", ], after_includes: None, trailer: None, include_guard: None, pragma_once: false, no_includes: true, autogen_warning: None, include_version: false, namespace: None, namespaces: None, using_namespaces: None, braces: SameLine, line_length: 100, tab_width: 2, line_endings: LF, language: C, cpp_compat: false, style: Both, sort_by: None, usize_is_size_t: false, parse: ParseConfig { parse_deps: false, include: None, exclude: [], expand: ParseExpandConfig { crates: [], all_features: false, default_features: true, features: None, profile: Debug, }, clean: false, extra_bindings: [], }, export: ExportConfig { include: [ "\"wire_BoxedPoint\"", "\"wire_Point\"", "\"wire_Size\"", "\"wire_TreeNode\"", ], exclude: [], rename: {}, pre_body: {}, body: {}, prefix: None, item_types: [], renaming_overrides_prefixing: false, mangle: MangleConfig { rename_types: None, remove_underscores: false, }, }, macro_expansion: MacroExpansionConfig { bitflags: false, }, layout: LayoutConfig { packed: None, aligned_n: None, }, function: FunctionConfig { prefix: None, postfix: None, must_use: None, args: Auto, rename_args: None, swift_name_macro: None, sort_by: None, no_return: None, }, structure: StructConfig { rename_fields: None, derive_constructor: false, derive_eq: false, derive_neq: false, derive_lt: false, derive_lte: false, derive_gt: false, derive_gte: false, derive_ostream: false, associated_constants_in_body: false, must_use: None, }, enumeration: EnumConfig { rename_variants: None, rename_variant_name_fields: SnakeCase, add_sentinel: false, prefix_with_name: false, derive_helper_methods: false, derive_const_casts: false, derive_mut_casts: false, cast_assert_name: None, must_use: None, derive_tagged_enum_destructor: false, derive_tagged_enum_copy_constructor: false, derive_tagged_enum_copy_assignment: false, derive_ostream: false, enum_class: true, private_default_tagged_enum_constructor: false, }, constant: ConstantConfig { allow_static_const: true, allow_constexpr: true, sort_by: None, }, defines: {}, documentation: true, documentation_style: Auto, documentation_length: Full, pointer: PtrConfig { non_null_attribute: None, }, only_target_dependencies: false, cython: CythonConfig { header: None, cimports: {}, }, } [2022-09-30T09:56:30Z DEBUG cbindgen::bindgen::parser] Parsing crate flutter_rust_bridge_example [2022-09-30T09:56:30Z INFO cbindgen::bindgen::parser] Take flutter_rust_bridge_example::Size - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].). [2022-09-30T09:56:30Z INFO cbindgen::bindgen::parser] Take flutter_rust_bridge_example::Point - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].). [2022-09-30T09:56:30Z INFO cbindgen::bindgen::parser] Take flutter_rust_bridge_example::TreeNode - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].). [2022-09-30T09:56:30Z INFO cbindgen::bindgen::parser] Take flutter_rust_bridge_example::BoxedPoint - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].). [2022-09-30T09:56:30Z INFO cbindgen::bindgen::parser] Take flutter_rust_bridge_example::DartPort. [2022-09-30T09:56:30Z INFO cbindgen::bindgen::parser] Take flutter_rust_bridge_example::DartPostCObjectFnType. [2022-09-30T09:56:30Z INFO cbindgen::bindgen::parser] Take flutter_rust_bridge_example::store_dart_post_cobject. [2022-09-30T09:56:30Z INFO cbindgen::bindgen::parser] Take flutter_rust_bridge_example::WireSyncReturnStruct. [2022-09-30T09:56:30Z INFO cbindgen::bindgen::parser] Take flutter_rust_bridge_example::wire_draw_mandelbrot. [2022-09-30T09:56:30Z INFO cbindgen::bindgen::parser] Take flutter_rust_bridge_example::wire_passing_complex_structs. [2022-09-30T09:56:30Z INFO cbindgen::bindgen::parser] Take flutter_rust_bridge_example::wire_returning_structs_with_boxed_fields. [2022-09-30T09:56:30Z INFO cbindgen::bindgen::parser] Take flutter_rust_bridge_example::wire_off_topic_memory_test_input_array. [2022-09-30T09:56:30Z INFO cbindgen::bindgen::parser] Take flutter_rust_bridge_example::wire_off_topic_memory_test_output_zero_copy_buffer. [2022-09-30T09:56:30Z INFO cbindgen::bindgen::parser] Take flutter_rust_bridge_example::wire_off_topic_memory_test_output_vec_u8. [2022-09-30T09:56:30Z INFO cbindgen::bindgen::parser] Take flutter_rust_bridge_example::wire_off_topic_memory_test_input_vec_of_object. [2022-09-30T09:56:30Z INFO cbindgen::bindgen::parser] Take flutter_rust_bridge_example::wire_off_topic_memory_test_output_vec_of_object. [2022-09-30T09:56:30Z INFO cbindgen::bindgen::parser] Take flutter_rust_bridge_example::wire_off_topic_memory_test_input_complex_struct. [2022-09-30T09:56:30Z INFO cbindgen::bindgen::parser] Take flutter_rust_bridge_example::wire_off_topic_memory_test_output_complex_struct. [2022-09-30T09:56:30Z INFO cbindgen::bindgen::parser] Take flutter_rust_bridge_example::wire_off_topic_deliberately_return_error. [2022-09-30T09:56:30Z INFO cbindgen::bindgen::parser] Take flutter_rust_bridge_example::wire_off_topic_deliberately_panic. [2022-09-30T09:56:30Z INFO cbindgen::bindgen::parser] Take flutter_rust_bridge_example::new_box_autoadd_point_0. [2022-09-30T09:56:30Z INFO cbindgen::bindgen::parser] Take flutter_rust_bridge_example::new_box_autoadd_size_0. [2022-09-30T09:56:30Z INFO cbindgen::bindgen::parser] Take flutter_rust_bridge_example::new_box_autoadd_tree_node_0. [2022-09-30T09:56:30Z INFO cbindgen::bindgen::parser] Take flutter_rust_bridge_example::new_list_size_0. [2022-09-30T09:56:30Z INFO cbindgen::bindgen::parser] Take flutter_rust_bridge_example::new_list_tree_node_0. [2022-09-30T09:56:30Z INFO cbindgen::bindgen::parser] Take flutter_rust_bridge_example::new_uint_8_list_0. [2022-09-30T09:56:30Z INFO cbindgen::bindgen::parser] Take flutter_rust_bridge_example::wire_list_size. [2022-09-30T09:56:30Z INFO cbindgen::bindgen::parser] Take flutter_rust_bridge_example::wire_list_tree_node. [2022-09-30T09:56:30Z INFO cbindgen::bindgen::parser] Take flutter_rust_bridge_example::wire_Point. [2022-09-30T09:56:30Z INFO cbindgen::bindgen::parser] Take flutter_rust_bridge_example::wire_Size. [2022-09-30T09:56:30Z INFO cbindgen::bindgen::parser] Take flutter_rust_bridge_example::wire_TreeNode. [2022-09-30T09:56:30Z INFO cbindgen::bindgen::parser] Take flutter_rust_bridge_example::wire_uint_8_list. [2022-09-30T09:56:30Z INFO cbindgen::bindgen::parser] Take flutter_rust_bridge_example::free_WireSyncReturnStruct. [2022-09-30T09:56:30Z WARN cbindgen::bindgen::parser] Skip flutter_rust_bridge_example::A - (not `pub`). [2022-09-30T09:56:30Z WARN cbindgen::bindgen::parser] Skip flutter_rust_bridge_example::B - (not `pub`). [2022-09-30T09:56:30Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config. [2022-09-30T09:56:30Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config. [2022-09-30T09:56:30Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config. [2022-09-30T09:56:30Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config. [2022-09-30T09:56:30Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config. [2022-09-30T09:56:30Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config. [2022-09-30T09:56:30Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config. [2022-09-30T09:56:30Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config. [2022-09-30T09:56:30Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config. [2022-09-30T09:56:30Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config. [2022-09-30T09:56:30Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config. [2022-09-30T09:56:30Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config. [2022-09-30T09:56:30Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config. [2022-09-30T09:56:30Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config. [2022-09-30T09:56:30Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config. [2022-09-30T09:56:30Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config. [2022-09-30T09:56:30Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config. [2022-09-30T09:56:30Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config. [2022-09-30T09:56:30Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config. [2022-09-30T09:56:30Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config. [2022-09-30T09:56:30Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config. [2022-09-30T09:56:30Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config. [2022-09-30T09:56:30Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config. [2022-09-30T09:56:30Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config. [2022-09-30T09:56:30Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config. [2022-09-30T09:56:30Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config. [2022-09-30T09:56:30Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config. [2022-09-30T09:56:30Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config. [2022-09-30T09:56:30Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config. [2022-09-30T09:56:30Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config. [2022-09-30T09:56:30Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config. [2022-09-30T09:56:30Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config. [2022-09-30T09:56:30Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config. [2022-09-30T09:56:30Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config. [2022-09-30T09:56:30Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config. [2022-09-30T09:56:30Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config. [2022-09-30T09:56:30Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config. [2022-09-30T09:56:30Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config. [2022-09-30T09:56:30Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config. [2022-09-30T09:56:30Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config. [2022-09-30T09:56:30Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config. [2022-09-30T09:56:30Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config. [2022-09-30T09:56:30Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config. [2022-09-30T09:56:30Z WARN cbindgen::bindgen::ir::cfg] Missing `[defines]` entry for `target_family = "wasm"` in cbindgen config. [2022-09-30T09:56:30Z DEBUG lib_flutter_rust_bridge_codegen::commands] execute ffigen c_path=/var/folders/st/8cddrx857yj1gh8yvj0j499c0000gn/T/.tmpnaQERP.h dart_path=/var/folders/st/8cddrx857yj1gh8yvj0j499c0000gn/T/.tmpdIiHAo llvm_path=["/opt/homebrew/opt/llvm", "/usr/local/opt/llvm", "/usr/lib/llvm-9", "/usr/lib/llvm-10", "/usr/lib/llvm-11", "/usr/lib/llvm-12", "/usr/lib/llvm-13", "/usr/lib/llvm-14", "/usr/lib/", "/usr/lib64/", "C:/Program Files/llvm", "C:/msys64/mingw64"] [2022-09-30T09:56:30Z DEBUG lib_flutter_rust_bridge_codegen::commands] ffigen config: output: '/var/folders/st/8cddrx857yj1gh8yvj0j499c0000gn/T/.tmpdIiHAo' name: 'FlutterRustBridgeExampleWire' description: 'generated by flutter_rust_bridge' headers: entry-points: - '/var/folders/st/8cddrx857yj1gh8yvj0j499c0000gn/T/.tmpnaQERP.h' include-directives: - '/var/folders/st/8cddrx857yj1gh8yvj0j499c0000gn/T/.tmpnaQERP.h' comments: false preamble: | // ignore_for_file: camel_case_types, non_constant_identifier_names, avoid_positional_boolean_parameters, annotate_overrides, constant_identifier_names llvm-path: - '/opt/homebrew/opt/llvm' - '/usr/local/opt/llvm' - '/usr/lib/llvm-9' - '/usr/lib/llvm-10' - '/usr/lib/llvm-11' - '/usr/lib/llvm-12' - '/usr/lib/llvm-13' - '/usr/lib/llvm-14' - '/usr/lib/' - '/usr/lib64/' - 'C:/Program Files/llvm' - 'C:/msys64/mingw64' [2022-09-30T09:56:30Z DEBUG lib_flutter_rust_bridge_codegen::commands] ffigen config_file: NamedTempFile("/var/folders/st/8cddrx857yj1gh8yvj0j499c0000gn/T/.tmpCxnKBA") [2022-09-30T09:56:30Z DEBUG lib_flutter_rust_bridge_codegen::tools] Guessing toolchain the runner is run into [2022-09-30T09:56:30Z DEBUG lib_flutter_rust_bridge_codegen::commands] execute command: bin=sh args="-c \"flutter\" \"pub\" \"run\" \"ffigen\" \"--config\" \"/var/folders/st/8cddrx857yj1gh8yvj0j499c0000gn/T/.tmpCxnKBA\"" current_dir=Some("/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter") cmd="sh" "-c" "\"flutter\" \"pub\" \"run\" \"ffigen\" \"--config\" \"/var/folders/st/8cddrx857yj1gh8yvj0j499c0000gn/T/.tmpCxnKBA\"" Running in Directory: '/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter' Input Headers: [/var/folders/st/8cddrx857yj1gh8yvj0j499c0000gn/T/.tmpnaQERP.h] [SEVERE] : Header /var/folders/st/8cddrx857yj1gh8yvj0j499c0000gn/T/.tmpnaQERP.h: Total errors/warnings: 180. [SEVERE] : /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdlib.h:134:25: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [Nullability Issue] // ... Finished, Bindings generated in /var/folders/st/8cddrx857yj1gh8yvj0j499c0000gn/T/.tmpdIiHAo [2022-09-30T09:56:32Z DEBUG lib_flutter_rust_bridge_codegen::commands] command="sh" "-c" "\"flutter\" \"pub\" \"run\" \"ffigen\" \"--config\" \"/var/folders/st/8cddrx857yj1gh8yvj0j499c0000gn/T/.tmpCxnKBA\"" stdout= stderr= [2022-09-30T09:56:32Z INFO lib_flutter_rust_bridge_codegen] Phase: Running build_runner [2022-09-30T09:56:32Z INFO lib_flutter_rust_bridge_codegen] Phase: Formatting Dart code [2022-09-30T09:56:32Z DEBUG lib_flutter_rust_bridge_codegen::commands] execute format_dart path=["/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/lib/bridge_generated.dart", "/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/lib/bridge_definitions.dart", "/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/lib/bridge_generated.web.dart", "/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/lib/bridge_generated.io.dart"] line_length=120 [2022-09-30T09:56:32Z DEBUG lib_flutter_rust_bridge_codegen::commands] execute command: bin=sh args="-c \"dart\" \"format\" \"--line-length\" \"120\" \"/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/lib/bridge_generated.dart\" \"/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/lib/bridge_definitions.dart\" \"/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/lib/bridge_generated.web.dart\" \"/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/lib/bridge_generated.io.dart\"" current_dir=None cmd="sh" "-c" "\"dart\" \"format\" \"--line-length\" \"120\" \"/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/lib/bridge_generated.dart\" \"/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/lib/bridge_definitions.dart\" \"/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/lib/bridge_generated.web.dart\" \"/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/lib/bridge_generated.io.dart\"" Formatted /Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/lib/bridge_generated.dart Formatted /Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/lib/bridge_definitions.dart Formatted /Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/lib/bridge_generated.web.dart Formatted /Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/lib/bridge_generated.io.dart Formatted 4 files (4 changed) in 0.17 seconds. [2022-09-30T09:56:33Z DEBUG lib_flutter_rust_bridge_codegen::commands] command="sh" "-c" "\"dart\" \"format\" \"--line-length\" \"120\" \"/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/lib/bridge_generated.dart\" \"/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/lib/bridge_definitions.dart\" \"/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/lib/bridge_generated.web.dart\" \"/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/lib/bridge_generated.io.dart\"" stdout= stderr= [2022-09-30T09:56:33Z INFO lib_flutter_rust_bridge_codegen] Success! [2022-09-30T09:56:33Z INFO flutter_rust_bridge_codegen] Now go and use it :) cd frb_example/pure_dart/rust && cargo clean -p flutter_rust_bridge_example_single_block_test && cargo build Compiling flutter_rust_bridge_example_single_block_test v1.0.0 (/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/pure_dart/rust) Finished dev [unoptimized + debuginfo] target(s) in 6.86s cd frb_example/pure_dart_multi/rust && cargo clean -p flutter_rust_bridge_example_multi_blocks_test && cargo build Compiling flutter_rust_bridge_codegen v1.48.0 (/Users/romain/Development/contributions/flutter_rust_bridge/frb_codegen) Compiling flutter_rust_bridge_example_multi_blocks_test v1.0.0 (/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/pure_dart_multi/rust) Finished dev [unoptimized + debuginfo] target(s) in 6.73s (cd frb_rust && cargo clippy -- -D warnings) Finished dev [unoptimized + debuginfo] target(s) in 0.14s (cd frb_macros && cargo clippy -- -D warnings) Finished dev [unoptimized + debuginfo] target(s) in 0.03s (cd frb_example/pure_dart/rust && cargo clippy -- -D warnings) Compiling flutter_rust_bridge_codegen v1.48.0 (/Users/romain/Development/contributions/flutter_rust_bridge/frb_codegen) Compiling flutter_rust_bridge_example_single_block_test v1.0.0 (/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/pure_dart/rust) Finished dev [unoptimized + debuginfo] target(s) in 8.00s (cd frb_example/pure_dart_multi/rust && cargo clippy -- -D warnings) Compiling flutter_rust_bridge_codegen v1.48.0 (/Users/romain/Development/contributions/flutter_rust_bridge/frb_codegen) Compiling flutter_rust_bridge_example_multi_blocks_test v1.0.0 (/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/pure_dart_multi/rust) Finished dev [unoptimized + debuginfo] target(s) in 6.97s (cd frb_example/with_flutter/rust && cargo clippy -- -D warnings) Checking flutter_rust_bridge_example v0.1.0 (/Users/romain/Development/contributions/flutter_rust_bridge/frb_example/with_flutter/rust) Finished dev [unoptimized + debuginfo] target(s) in 0.28s (cd frb_example/pure_dart/dart && dart pub get) Resolving dependencies... (1.8s) _fe_analyzer_shared 48.0.0 (49.0.0 available) analyzer 5.0.0 (5.1.0 available) frontend_server_client 2.1.3 (3.0.0 available) Got dependencies! (cd frb_example/pure_dart_multi/dart && dart pub get) Resolving dependencies... (1.6s) _fe_analyzer_shared 48.0.0 (49.0.0 available) analyzer 5.0.0 (5.1.0 available) coverage 1.0.3 (1.6.1 available) frontend_server_client 2.1.3 (3.0.0 available) vm_service 7.5.0 (9.4.0 available) Got dependencies! (cd frb_example/with_flutter && flutter pub get) Running "flutter pub get" in with_flutter... 1,746ms just lint dart format --fix . Formatted frb_example/pure_dart/dart/lib/bench.dart Formatted frb_example/pure_dart/dart/lib/bridge_definitions.dart Formatted frb_example/pure_dart/dart/lib/bridge_definitions.freezed.dart Formatted frb_example/pure_dart/dart/lib/bridge_generated.dart Formatted frb_example/pure_dart/dart/lib/bridge_generated.io.dart Formatted frb_example/pure_dart/dart/lib/bridge_generated.web.dart Formatted frb_example/pure_dart/dart/lib/ffi.io.dart Formatted frb_example/pure_dart/dart/lib/main.dart Formatted frb_example/pure_dart/dart/lib/utils.dart Formatted frb_example/pure_dart_multi/dart/lib/bridge_generated_api_1.dart Formatted frb_example/pure_dart_multi/dart/lib/bridge_generated_api_2.dart Formatted frb_example/with_flutter/integration_test/main.dart Formatted frb_example/with_flutter/lib/bridge_definitions.dart Formatted frb_example/with_flutter/lib/bridge_generated.dart Formatted frb_example/with_flutter/lib/bridge_generated.io.dart Formatted frb_example/with_flutter/lib/bridge_generated.web.dart Formatted frb_example/with_flutter/lib/main.dart Formatted frb_example/with_flutter/lib/off_topic_code.dart Formatted 45 files (18 changed) in 0.60 seconds. dart format --fix -l 120 frb_example/pure_dart Formatted frb_example/pure_dart/dart/lib/bench.dart Formatted frb_example/pure_dart/dart/lib/bridge_definitions.dart Formatted frb_example/pure_dart/dart/lib/bridge_definitions.freezed.dart Formatted frb_example/pure_dart/dart/lib/bridge_generated.dart Formatted frb_example/pure_dart/dart/lib/bridge_generated.io.dart Formatted frb_example/pure_dart/dart/lib/bridge_generated.web.dart Formatted frb_example/pure_dart/dart/lib/ffi.io.dart Formatted frb_example/pure_dart/dart/lib/main.dart Formatted frb_example/pure_dart/dart/lib/utils.dart Formatted 13 files (9 changed) in 0.40 seconds. dart format --fix -l 120 frb_example/pure_dart_multi Formatted frb_example/pure_dart_multi/dart/lib/bridge_generated_api_1.dart Formatted frb_example/pure_dart_multi/dart/lib/bridge_generated_api_2.dart Formatted 3 files (2 changed) in 0.14 seconds. dart format --fix -l 120 frb_example/with_flutter Formatted frb_example/with_flutter/integration_test/main.dart Formatted frb_example/with_flutter/lib/bridge_definitions.dart Formatted frb_example/with_flutter/lib/bridge_generated.dart Formatted frb_example/with_flutter/lib/bridge_generated.io.dart Formatted frb_example/with_flutter/lib/bridge_generated.web.dart Formatted frb_example/with_flutter/lib/main.dart Formatted frb_example/with_flutter/lib/off_topic_code.dart Formatted 9 files (7 changed) in 0.21 seconds. cd frb_example/pure_dart/rust && cargo fmt cd frb_example/pure_dart_multi/rust && cargo fmt cd frb_example/with_flutter/rust && cargo fmt cd frb_codegen && cargo fmt sed -i "" -e 's/pub.flutter-io.cn/pub.dartlang.org/g' frb_example/pure_dart/dart/pubspec.lock sed -i "" -e 's/pub.flutter-io.cn/pub.dartlang.org/g' frb_example/pure_dart_multi/dart/pubspec.lock sed -i "" -e 's/pub.flutter-io.cn/pub.dartlang.org/g' frb_example/with_flutter/pubspec.lock ```To Reproduce
Just build
pure_dart
example and run withoutweb
.Expected behavior
No response
Generated binding code
click to display
```shell // AUTO GENERATED FILE, DO NOT EDIT. // Generated by `flutter_rust_bridge`@ 1.48.0. // ignore_for_file: non_constant_identifier_names, unused_element, duplicate_ignore, directives_ordering, curly_braces_in_flow_control_structures, unnecessary_lambdas, slash_for_doc_comments, prefer_const_literals_to_create_immutables, implicit_dynamic_list_literal, duplicate_import, unused_import, prefer_single_quotes, prefer_const_constructors, use_super_parameters, always_use_package_imports, annotate_overrides, invalid_use_of_protected_member, constant_identifier_names import "bridge_definitions.dart"; import 'dart:convert'; import 'dart:async'; import 'package:flutter_rust_bridge/flutter_rust_bridge.dart'; import 'package:uuid/uuid.dart'; import 'bridge_generated.dart'; export 'bridge_generated.dart'; import 'dart:developer'; import 'package:meta/meta.dart'; import 'dart:ffi' as ffi; class FlutterRustBridgeExampleSingleBlockTestPlatform extends FlutterRustBridgeBaseOS
MacOS M1 Pro Monterey 12.4
Version of
flutter_rust_bridge_codegen
latest 1.48.0
Flutter info
Version of
clang++
Apple clang version 13.1.6 (clang-1316.0.21.2.5) Target: arm64-apple-darwin21.5.0
Version of
ffigen
^6.0.1
Additional context
No response