Skip to content
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 panics: system cannot find the file specified. when executing dart command using Rust's Command #81

Closed
emperor-limitless opened this issue Oct 15, 2021 · 17 comments
Labels
bug Something isn't working

Comments

@emperor-limitless
Copy link

When trying to generate using flutter_rust_bridge, The bridge_generated.rs file gets created, However, It scene to crash after doing that with a not foudn file panic.

I ran the command like this
flutter_rust_bridge_codegen --rust-input src/api.rs --dart-output fastengine.dart --c-output fastengine.h

The error is this

[2021-10-15T12:54:22Z INFO flutter_rust_bridge_codegen] Picked config: Opts { rust_input_path: "C:\Users\mohamed\projects\lom\fastengine\src/api.rs", dart_output_path: "C:\Users\mohamed\projects\lom\fastengine\fastengine.dart", c_output_path: "C:\Users\mohamed\projects\lom\fastengine\fastengine.h", rust_crate_dir: "C:\Users\mohamed\projects\lom\fastengine", rust_output_path: "C:\Users\mohamed\projects\lom\fastengine\src\bridge_generated.rs", class_name: "Fastengine", dart_format_line_length: 80 }
[2021-10-15T12:54:22Z INFO flutter_rust_bridge_codegen] Phase: Parse source code to AST
[2021-10-15T12:54:22Z INFO flutter_rust_bridge_codegen] Phase: Parse AST to IR
[2021-10-15T12:54:22Z INFO flutter_rust_bridge_codegen] Phase: Transform IR
[2021-10-15T12:54:22Z INFO flutter_rust_bridge_codegen] Phase: Generate Rust code
[2021-10-15T12:54:22Z INFO flutter_rust_bridge_codegen] Phase: Generate Dart code
[2021-10-15T12:54:22Z INFO flutter_rust_bridge_codegen] Phase: Other things
thread 'main' panicked at 'called Result::unwrap() on an Err value: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }', C:\Users\mohamed.cargo\registry\src\github.aaakk.us.kg-1ecc6299db9ec823\flutter_rust_bridge_codegen-1.1.0\src\commands.rs:20:35
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

  • OS: Windows
  • Version: 10
  • Version of flutter_rust_bridge_codegen: 1.1.0
  • Version of clang++: 11.0.0
  • Version of cbindgen: 0.2.0.0
@emperor-limitless emperor-limitless added the bug Something isn't working label Oct 15, 2021
@welcome
Copy link

welcome bot commented Oct 15, 2021

Hi! Thanks for opening your first issue here! 😄

@fzyzcjy
Copy link
Owner

fzyzcjy commented Oct 15, 2021

let me have a look

@fzyzcjy
Copy link
Owner

fzyzcjy commented Oct 15, 2021

  • please Run code generator with RUST_LOG environment variable set to debug, and paste them here.
  • please checkout code at a stable tag, e.g. https://github.com/fzyzcjy/flutter_rust_bridge/tree/v1.1.0 , instead of directly use master which can be unstable (though CI passes)
  • If possible, please paste your generated binding code, both .h (via --c-output), and .dart (via --dart-output), here.
  • please fill in following info
  • OS: [e.g. MacOS]
  • Version [e.g. 11]
  • Version of flutter_rust_bridge_codegen: [e.g. 1.0]
  • Paste output of flutter doctor -v: [paste below]
  • Version of clang++: [e.g. 12]
  • Version of cbindgen: [e.g. 0.20]
  • Version of ffigen: [e.g. 0.4]
GitHub
High-level memory-safe binding generator for Flutter/Dart <-> Rust - GitHub - fzyzcjy/flutter_rust_bridge at v1.1.0

@emperor-limitless
Copy link
Author

emperor-limitless commented Oct 15, 2021

rust_log debug outputs

[2021-10-15T14:07:38Z INFO  flutter_rust_bridge_codegen] Picked config: Opts { rust_input_path: "C:\\Users\\mohamed\\projects\\lom\\fastengine\\src\\api.rs", dart_output_path: "C:\\Users\\mohamed\\projects\\lom\\fastengine\\fastengine.dart", c_output_path: "C:\\Users\\mohamed\\projects\\lom\\fastengine\\fastengine.h", rust_crate_dir: "C:\\Users\\mohamed\\projects\\lom\\fastengine", rust_output_path: "C:\\Users\\mohamed\\projects\\lom\\fastengine\\src\\bridge_generated.rs", class_name: "Fastengine", dart_format_line_length: 80 }
[2021-10-15T14:07:38Z INFO  flutter_rust_bridge_codegen] Phase: Parse source code to AST
[2021-10-15T14:07:38Z INFO  flutter_rust_bridge_codegen] Phase: Parse AST to IR
[2021-10-15T14:07:38Z DEBUG flutter_rust_bridge_codegen::parser] parse_function function name: Ident(create_key)
[2021-10-15T14:07:38Z DEBUG flutter_rust_bridge_codegen::parser] parse_type: String
[2021-10-15T14:07:38Z DEBUG flutter_rust_bridge_codegen] parsed functions: ApiFile { funcs: [ApiFunc { name: "create_key", inputs: [], output: Delegate(String) }], struct_pool: {}, has_executor: false }
[2021-10-15T14:07:38Z INFO  flutter_rust_bridge_codegen] Phase: Transform IR
[2021-10-15T14:07:38Z DEBUG flutter_rust_bridge_codegen] transformed functions: ApiFile { funcs: [ApiFunc { name: "create_key", inputs: [], output: Delegate(String) }], struct_pool: {}, has_executor: false }
[2021-10-15T14:07:38Z INFO  flutter_rust_bridge_codegen] Phase: Generate Rust code
[2021-10-15T14:07:38Z INFO  flutter_rust_bridge_codegen] Phase: Generate Dart code
[2021-10-15T14:07:38Z DEBUG flutter_rust_bridge_codegen::generator_dart] distinct_types=[Delegate(String), PrimitiveList(ApiTypePrimitiveList { primitive: U8 }), Primitive(U8)]
[2021-10-15T14:07:38Z INFO  flutter_rust_bridge_codegen] Phase: Other things
[2021-10-15T14:07:38Z DEBUG flutter_rust_bridge_codegen::commands] execute format_rust path=C:\Users\mohamed\projects\lom\fastengine\src\bridge_generated.rs
[2021-10-15T14:07:38Z DEBUG flutter_rust_bridge_codegen::commands] execute command: "rustfmt" "C:\\Users\\mohamed\\projects\\lom\\fastengine\\src\\bridge_generated.rs"
[2021-10-15T14:07:39Z DEBUG flutter_rust_bridge_codegen::commands] command="rustfmt" "C:\\Users\\mohamed\\projects\\lom\\fastengine\\src\\bridge_generated.rs" output=Output { status: ExitStatus(ExitStatus(0)), stdout: "", stderr: "[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::missed_spans] write_snippet `\n        // AUTO GENERATED FILE, DO NOT EDIT.\n// Generated by `flutter_rust_bridge`.\n\n        `\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::missed_spans] Normal: \"\\n        \"\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::missed_spans] Comment: \"// AUTO GENERATED FILE, DO NOT EDIT.\\n// Generated by `flutter_rust_bridge`.\\n\"\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::missed_spans] Normal: \"\\n        \"\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::missed_spans] write_snippet `\n\n        // Section: wire functions\n\n        \n                `\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::missed_spans] Normal: \"\\n\\n        \"\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::missed_spans] Comment: \"// Section: wire functions\\n\"\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::missed_spans] Normal: \"\\n        \\n                \"\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::items] compute_budgets_for_params 33 Indent { block_indent: 0, alignment: 0 }, 0, SameLine\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::items] rewrite_fn_base: one_line_budget: 63, multi_line_budget: 95, param_indent: Indent { block_indent: 4, alignment: 0 }\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::visitor] visit_block: \\\\?\\C:\\Users\\mohamed\\projects\\lom\\fastengine\\src\\bridge_generated.rs:12:63: 17:18\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::visitor] visit_stmt: \\\\?\\C:\\Users\\mohamed\\projects\\lom\\fastengine\\src\\bridge_generated.rs:15:17: 15:115\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::closures] rewrite_closure Expr { id: NodeId(4294967040), kind: Call(Expr { id: NodeId(4294967040), kind: Path(None, Path { span: Span { lo: BytePos(512), hi: BytePos(522), ctxt: #0 }, segments: [PathSegment { ident: create_key#0, id: NodeId(4294967040), args: None }], tokens: None }), span: Span { lo: BytePos(512), hi: BytePos(522), ctxt: #0 }, attrs: ThinVec(None), tokens: None }, []), span: Span { lo: BytePos(512), hi: BytePos(524), ctxt: #0 }, attrs: ThinVec(None), tokens: None }\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::comment] comment::changed_comment_content: false\norig: 'support::wrap_wire_func(&*FLUTTER_RUST_BRIDGE_EXECUTOR, \"create_key\", port, move || create_key())'\nnew: 'support::wrap_wire_func(\n        &*FLUTTER_RUST_BRIDGE_EXECUTOR,\n        \"create_key\",\n        port,\n        move || create_key(),\n    )'\nraw_old: \nraw_new: \n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::comment] comment::changed_comment_content: false\norig: 'support::wrap_wire_func(&*FLUTTER_RUST_BRIDGE_EXECUTOR, \"create_key\", port, move || create_key());'\nnew: 'support::wrap_wire_func(\n        &*FLUTTER_RUST_BRIDGE_EXECUTOR,\n        \"create_key\",\n        port,\n        move || create_key(),\n    );'\nraw_old: \nraw_new: \n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::visitor] close_block: Normal 0 \"\\n                \\n                \"\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::attr] item_str: 'Clone,'\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::missed_spans] write_snippet `\n            \n\n        // Section: wire structs\n\n        \n\n\n        `\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::missed_spans] Normal: \"\\n            \\n\\n        \"\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::missed_spans] Comment: \"// Section: wire structs\\n\"\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::missed_spans] Normal: \"\\n        \\n\\n\\n        \"\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::missed_spans] write_snippet `\n        \n\n\n\n        // Section: allocate functions\n\n        \n\n\n                `\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::missed_spans] Normal: \"\\n        \\n\\n\\n\\n        \"\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::missed_spans] Comment: \"// Section: allocate functions\\n\"\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::missed_spans] Normal: \"\\n        \\n\\n\\n                \"\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::items] compute_budgets_for_params 33 Indent { block_indent: 0, alignment: 0 }, 24, SameLine\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::items] rewrite_fn_base: one_line_budget: 38, multi_line_budget: 95, param_indent: Indent { block_indent: 4, alignment: 0 }\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::visitor] visit_block: \\\\?\\C:\\Users\\mohamed\\projects\\lom\\fastengine\\src\\bridge_generated.rs:41:86: 44:18\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::visitor] visit_stmt: \\\\?\\C:\\Users\\mohamed\\projects\\lom\\fastengine\\src\\bridge_generated.rs:42:21: 42:113\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::items] Local::rewrite Local { id: NodeId(4294967040), pat: Pat { id: NodeId(4294967040), kind: Ident(ByValue(Not), ans#0, None), span: Span { lo: BytePos(951), hi: BytePos(954), ctxt: #0 }, tokens: None }, ty: None, init: Some(Expr { id: NodeId(4294967040), kind: Struct(StructExpr { qself: None, path: Path { span: Span { lo: BytePos(957), hi: BytePos(973), ctxt: #0 }, segments: [PathSegment { ident: wire_uint_8_list#0, id: NodeId(4294967040), args: None }], tokens: None }, fields: [ExprField { attrs: ThinVec(None), id: NodeId(4294967040), span: Span { lo: BytePos(976), hi: BytePos(1031), ctxt: #0 }, ident: ptr#0, expr: Expr { id: NodeId(4294967040), kind: Call(Expr { id: NodeId(4294967040), kind: Path(None, Path { span: Span { lo: BytePos(981), hi: BytePos(1006), ctxt: #0 }, segments: [PathSegment { ident: support#0, id: NodeId(4294967040), args: None }, PathSegment { ident: new_leak_vec_ptr#0, id: NodeId(4294967040), args: None }], tokens: None }), span: Span { lo: BytePos(981), hi: BytePos(1006), ctxt: #0 }, attrs: ThinVec(None), tokens: None }, [Expr { id: NodeId(4294967040), kind: Call(Expr { id: NodeId(4294967040), kind: Path(None, Path { span: Span { lo: BytePos(1007), hi: BytePos(1023), ctxt: #0 }, segments: [PathSegment { ident: Default#0, id: NodeId(4294967040), args: None }, PathSegment { ident: default#0, id: NodeId(4294967040), args: None }], tokens: None }), span: Span { lo: BytePos(1007), hi: BytePos(1023), ctxt: #0 }, attrs: ThinVec(None), tokens: None }, []), span: Span { lo: BytePos(1007), hi: BytePos(1025), ctxt: #0 }, attrs: ThinVec(None), tokens: None }, Expr { id: NodeId(4294967040), kind: Path(None, Path { span: Span { lo: BytePos(1027), hi: BytePos(1030), ctxt: #0 }, segments: [PathSegment { ident: len#0, id: NodeId(4294967040), args: None }], tokens: None }), span: Span { lo: BytePos(1027), hi: BytePos(1030), ctxt: #0 }, attrs: ThinVec(None), tokens: None }]), span: Span { lo: BytePos(981), hi: BytePos(1031), ctxt: #0 }, attrs: ThinVec(None), tokens: None }, is_shorthand: false, is_placeholder: false }, ExprField { attrs: ThinVec(None), id: NodeId(4294967040), span: Span { lo: BytePos(1033), hi: BytePos(1036), ctxt: #0 }, ident: len#0, expr: Expr { id: NodeId(4294967040), kind: Path(None, Path { span: Span { lo: BytePos(1033), hi: BytePos(1036), ctxt: #0 }, segments: [PathSegment { ident: len#0, id: NodeId(4294967040), args: None }], tokens: None }), span: Span { lo: BytePos(1033), hi: BytePos(1036), ctxt: #0 }, attrs: ThinVec(None), tokens: None }, is_shorthand: true, is_placeholder: false }], rest: None }), span: Span { lo: BytePos(957), hi: BytePos(1038), ctxt: #0 }, attrs: ThinVec(None), tokens: None }), span: Span { lo: BytePos(947), hi: BytePos(1039), ctxt: #0 }, attrs: ThinVec(None), tokens: None } 96 Indent { block_indent: 4, alignment: 0 }\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::expr] rewrite_struct_lit: shape Shape { width: 85, indent: Indent { block_indent: 4, alignment: 0 }, offset: 10 }\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::comment] comment::changed_comment_content: false\norig: 'wire_uint_8_list { ptr: support::new_leak_vec_ptr(Default::default(), len), len }'\nnew: 'wire_uint_8_list {\n        ptr: support::new_leak_vec_ptr(Default::default(), len),\n        len,\n    }'\nraw_old: \nraw_new: \n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::expr] rewrite_struct_lit: shape Shape { width: 91, indent: Indent { block_indent: 8, alignment: 0 }, offset: 0 }\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::comment] comment::changed_comment_content: false\norig: 'wire_uint_8_list { ptr: support::new_leak_vec_ptr(Default::default(), len), len }'\nnew: 'wire_uint_8_list {\n            ptr: support::new_leak_vec_ptr(Default::default(), len),\n            len,\n        }'\nraw_old: \nraw_new: \n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::comment] comment::changed_comment_content: false\norig: 'let ans = wire_uint_8_list { ptr: support::new_leak_vec_ptr(Default::default(), len), len };'\nnew: 'let ans = wire_uint_8_list {\n        ptr: support::new_leak_vec_ptr(Default::default(), len),\n        len,\n    };'\nraw_old: \nraw_new: \n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::visitor] visit_stmt: \\\\?\\C:\\Users\\mohamed\\projects\\lom\\fastengine\\src\\bridge_generated.rs:43:17: 43:47\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::visitor] close_block: Normal 0 \"\\n                \"\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::items] compute_budgets_for_params 11 Indent { block_indent: 4, alignment: 0 }, 4, None\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::items] rewrite_fn_base: one_line_budget: 77, multi_line_budget: 91, param_indent: Indent { block_indent: 8, alignment: 0 }\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::missed_spans] write_snippet `\n            \n\n\n\n        // Section: impl Wire2Api\n\n        `\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::missed_spans] Normal: \"\\n            \\n\\n\\n\\n        \"\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::missed_spans] Comment: \"// Section: impl Wire2Api\\n\"\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::missed_spans] Normal: \"\\n        \"\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::items] compute_budgets_for_params 11 Indent { block_indent: 4, alignment: 0 }, 9, SameLine\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::items] rewrite_fn_base: one_line_budget: 71, multi_line_budget: 91, param_indent: Indent { block_indent: 8, alignment: 0 }\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::visitor] visit_block: \\\\?\\C:\\Users\\mohamed\\projects\\lom\\fastengine\\src\\bridge_generated.rs:56:41: 59:14\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::visitor] visit_stmt: \\\\?\\C:\\Users\\mohamed\\projects\\lom\\fastengine\\src\\bridge_generated.rs:57:17: 57:52\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::items] Local::rewrite Local { id: NodeId(4294967040), pat: Pat { id: NodeId(4294967040), kind: Ident(ByValue(Not), vec#0, None), span: Span { lo: BytePos(1355), hi: BytePos(1358), ctxt: #0 }, tokens: None }, ty: Some(Ty { id: NodeId(4294967040), kind: Path(None, Path { span: Span { lo: BytePos(1360), hi: BytePos(1367), ctxt: #0 }, segments: [PathSegment { ident: Vec#0, id: NodeId(4294967040), args: Some(AngleBracketed(AngleBracketedArgs { span: Span { lo: BytePos(1363), hi: BytePos(1367), ctxt: #0 }, args: [Arg(Type(Ty { id: NodeId(4294967040), kind: Path(None, Path { span: Span { lo: BytePos(1364), hi: BytePos(1366), ctxt: #0 }, segments: [PathSegment { ident: u8#0, id: NodeId(4294967040), args: None }], tokens: None }), span: Span { lo: BytePos(1364), hi: BytePos(1366), ctxt: #0 }, tokens: None }))] })) }], tokens: None }), span: Span { lo: BytePos(1360), hi: BytePos(1367), ctxt: #0 }, tokens: None }), init: Some(Expr { id: NodeId(4294967040), kind: MethodCall(PathSegment { ident: wire2api#0, id: NodeId(4294967040), args: None }, [Expr { id: NodeId(4294967040), kind: Path(None, Path { span: Span { lo: BytePos(1370), hi: BytePos(1374), ctxt: #0 }, segments: [PathSegment { ident: self#0, id: NodeId(4294967040), args: None }], tokens: None }), span: Span { lo: BytePos(1370), hi: BytePos(1374), ctxt: #0 }, attrs: ThinVec(None), tokens: None }], Span { lo: BytePos(1375), hi: BytePos(1385), ctxt: #0 }), span: Span { lo: BytePos(1370), hi: BytePos(1385), ctxt: #0 }, attrs: ThinVec(None), tokens: None }), span: Span { lo: BytePos(1351), hi: BytePos(1386), ctxt: #0 }, attrs: ThinVec(None), tokens: None } 92 Indent { block_indent: 8, alignment: 0 }\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::chains] rewrite_chain Chain { parent: ChainItem { kind: Parent(Expr { id: NodeId(4294967040), kind: Path(None, Path { span: Span { lo: BytePos(1370), hi: BytePos(1374), ctxt: #0 }, segments: [PathSegment { ident: self#0, id: NodeId(4294967040), args: None }], tokens: None }), span: Span { lo: BytePos(1370), hi: BytePos(1374), ctxt: #0 }, attrs: ThinVec(None), tokens: None }), tries: 0, span: Span { lo: BytePos(1370), hi: BytePos(1374), ctxt: #0 } }, children: [ChainItem { kind: MethodCall(PathSegment { ident: wire2api#0, id: NodeId(4294967040), args: None }, [], [Expr { id: NodeId(4294967040), kind: Path(None, Path { span: Span { lo: BytePos(1370), hi: BytePos(1374), ctxt: #0 }, segments: [PathSegment { ident: self#0, id: NodeId(4294967040), args: None }], tokens: None }), span: Span { lo: BytePos(1370), hi: BytePos(1374), ctxt: #0 }, attrs: ThinVec(None), tokens: None }]), tries: 0, span: Span { lo: BytePos(1374), hi: BytePos(1385), ctxt: #0 } }] } Shape { width: 72, indent: Indent { block_indent: 8, alignment: 0 }, offset: 19 }\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::chains] rewrite chain Chain { parent: ChainItem { kind: Parent(Expr { id: NodeId(4294967040), kind: Path(None, Path { span: Span { lo: BytePos(1370), hi: BytePos(1374), ctxt: #0 }, segments: [PathSegment { ident: self#0, id: NodeId(4294967040), args: None }], tokens: None }), span: Span { lo: BytePos(1370), hi: BytePos(1374), ctxt: #0 }, attrs: ThinVec(None), tokens: None }), tries: 0, span: Span { lo: BytePos(1370), hi: BytePos(1374), ctxt: #0 } }, children: [ChainItem { kind: MethodCall(PathSegment { ident: wire2api#0, id: NodeId(4294967040), args: None }, [], [Expr { id: NodeId(4294967040), kind: Path(None, Path { span: Span { lo: BytePos(1370), hi: BytePos(1374), ctxt: #0 }, segments: [PathSegment { ident: self#0, id: NodeId(4294967040), args: None }], tokens: None }), span: Span { lo: BytePos(1370), hi: BytePos(1374), ctxt: #0 }, attrs: ThinVec(None), tokens: None }]), tries: 0, span: Span { lo: BytePos(1374), hi: BytePos(1385), ctxt: #0 } }] } Shape { width: 72, indent: Indent { block_indent: 8, alignment: 0 }, offset: 19 }\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::visitor] visit_stmt: \\\\?\\C:\\Users\\mohamed\\projects\\lom\\fastengine\\src\\bridge_generated.rs:58:17: 58:59\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::chains] rewrite_chain Chain { parent: ChainItem { kind: Parent(Expr { id: NodeId(4294967040), kind: Call(Expr { id: NodeId(4294967040), kind: Path(None, Path { span: Span { lo: BytePos(1403), hi: BytePos(1426), ctxt: #0 }, segments: [PathSegment { ident: String#0, id: NodeId(4294967040), args: None }, PathSegment { ident: from_utf8_lossy#0, id: NodeId(4294967040), args: None }], tokens: None }), span: Span { lo: BytePos(1403), hi: BytePos(1426), ctxt: #0 }, attrs: ThinVec(None), tokens: None }, [Expr { id: NodeId(4294967040), kind: AddrOf(Ref, Not, Expr { id: NodeId(4294967040), kind: Path(None, Path { span: Span { lo: BytePos(1428), hi: BytePos(1431), ctxt: #0 }, segments: [PathSegment { ident: vec#0, id: NodeId(4294967040), args: None }], tokens: None }), span: Span { lo: BytePos(1428), hi: BytePos(1431), ctxt: #0 }, attrs: ThinVec(None), tokens: None }), span: Span { lo: BytePos(1427), hi: BytePos(1431), ctxt: #0 }, attrs: ThinVec(None), tokens: None }]), span: Span { lo: BytePos(1403), hi: BytePos(1432), ctxt: #0 }, attrs: ThinVec(None), tokens: None }), tries: 0, span: Span { lo: BytePos(1403), hi: BytePos(1432), ctxt: #0 } }, children: [ChainItem { kind: MethodCall(PathSegment { ident: into_owned#0, id: NodeId(4294967040), args: None }, [], [Expr { id: NodeId(4294967040), kind: Call(Expr { id: NodeId(4294967040), kind: Path(None, Path { span: Span { lo: BytePos(1403), hi: BytePos(1426), ctxt: #0 }, segments: [PathSegment { ident: String#0, id: NodeId(4294967040), args: None }, PathSegment { ident: from_utf8_lossy#0, id: NodeId(4294967040), args: None }], tokens: None }), span: Span { lo: BytePos(1403), hi: BytePos(1426), ctxt: #0 }, attrs: ThinVec(None), tokens: None }, [Expr { id: NodeId(4294967040), kind: AddrOf(Ref, Not, Expr { id: NodeId(4294967040), kind: Path(None, Path { span: Span { lo: BytePos(1428), hi: BytePos(1431), ctxt: #0 }, segments: [PathSegment { ident: vec#0, id: NodeId(4294967040), args: None }], tokens: None }), span: Span { lo: BytePos(1428), hi: BytePos(1431), ctxt: #0 }, attrs: ThinVec(None), tokens: None }), span: Span { lo: BytePos(1427), hi: BytePos(1431), ctxt: #0 }, attrs: ThinVec(None), tokens: None }]), span: Span { lo: BytePos(1403), hi: BytePos(1432), ctxt: #0 }, attrs: ThinVec(None), tokens: None }]), tries: 0, span: Span { lo: BytePos(1432), hi: BytePos(1445), ctxt: #0 } }] } Shape { width: 92, indent: Indent { block_indent: 8, alignment: 0 }, offset: 0 }\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::chains] rewrite chain Chain { parent: ChainItem { kind: Parent(Expr { id: NodeId(4294967040), kind: Call(Expr { id: NodeId(4294967040), kind: Path(None, Path { span: Span { lo: BytePos(1403), hi: BytePos(1426), ctxt: #0 }, segments: [PathSegment { ident: String#0, id: NodeId(4294967040), args: None }, PathSegment { ident: from_utf8_lossy#0, id: NodeId(4294967040), args: None }], tokens: None }), span: Span { lo: BytePos(1403), hi: BytePos(1426), ctxt: #0 }, attrs: ThinVec(None), tokens: None }, [Expr { id: NodeId(4294967040), kind: AddrOf(Ref, Not, Expr { id: NodeId(4294967040), kind: Path(None, Path { span: Span { lo: BytePos(1428), hi: BytePos(1431), ctxt: #0 }, segments: [PathSegment { ident: vec#0, id: NodeId(4294967040), args: None }], tokens: None }), span: Span { lo: BytePos(1428), hi: BytePos(1431), ctxt: #0 }, attrs: ThinVec(None), tokens: None }), span: Span { lo: BytePos(1427), hi: BytePos(1431), ctxt: #0 }, attrs: ThinVec(None), tokens: None }]), span: Span { lo: BytePos(1403), hi: BytePos(1432), ctxt: #0 }, attrs: ThinVec(None), tokens: None }), tries: 0, span: Span { lo: BytePos(1403), hi: BytePos(1432), ctxt: #0 } }, children: [ChainItem { kind: MethodCall(PathSegment { ident: into_owned#0, id: NodeId(4294967040), args: None }, [], [Expr { id: NodeId(4294967040), kind: Call(Expr { id: NodeId(4294967040), kind: Path(None, Path { span: Span { lo: BytePos(1403), hi: BytePos(1426), ctxt: #0 }, segments: [PathSegment { ident: String#0, id: NodeId(4294967040), args: None }, PathSegment { ident: from_utf8_lossy#0, id: NodeId(4294967040), args: None }], tokens: None }), span: Span { lo: BytePos(1403), hi: BytePos(1426), ctxt: #0 }, attrs: ThinVec(None), tokens: None }, [Expr { id: NodeId(4294967040), kind: AddrOf(Ref, Not, Expr { id: NodeId(4294967040), kind: Path(None, Path { span: Span { lo: BytePos(1428), hi: BytePos(1431), ctxt: #0 }, segments: [PathSegment { ident: vec#0, id: NodeId(4294967040), args: None }], tokens: None }), span: Span { lo: BytePos(1428), hi: BytePos(1431), ctxt: #0 }, attrs: ThinVec(None), tokens: None }), span: Span { lo: BytePos(1427), hi: BytePos(1431), ctxt: #0 }, attrs: ThinVec(None), tokens: None }]), span: Span { lo: BytePos(1403), hi: BytePos(1432), ctxt: #0 }, attrs: ThinVec(None), tokens: None }]), tries: 0, span: Span { lo: BytePos(1432), hi: BytePos(1445), ctxt: #0 } }] } Shape { width: 92, indent: Indent { block_indent: 8, alignment: 0 }, offset: 0 }\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::visitor] close_block: Normal 0 \"\\n            \"\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::items] compute_budgets_for_params 11 Indent { block_indent: 4, alignment: 0 }, 10, SameLine\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::items] rewrite_fn_base: one_line_budget: 70, multi_line_budget: 91, param_indent: Indent { block_indent: 8, alignment: 0 }\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::visitor] visit_block: \\\\?\\C:\\Users\\mohamed\\projects\\lom\\fastengine\\src\\bridge_generated.rs:64:42: 70:14\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::visitor] visit_stmt: \\\\?\\C:\\Users\\mohamed\\projects\\lom\\fastengine\\src\\bridge_generated.rs:65:17: 68:14\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::visitor] visit_block: \\\\?\\C:\\Users\\mohamed\\projects\\lom\\fastengine\\src\\bridge_generated.rs:65:17: 68:14\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::visitor] visit_stmt: \\\\?\\C:\\Users\\mohamed\\projects\\lom\\fastengine\\src\\bridge_generated.rs:66:17: 66:61\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::items] Local::rewrite Local { id: NodeId(4294967040), pat: Pat { id: NodeId(4294967040), kind: Ident(ByValue(Not), wrap#0, None), span: Span { lo: BytePos(1619), hi: BytePos(1623), ctxt: #0 }, tokens: None }, ty: None, init: Some(Expr { id: NodeId(4294967040), kind: Call(Expr { id: NodeId(4294967040), kind: Path(None, Path { span: Span { lo: BytePos(1626), hi: BytePos(1652), ctxt: #0 }, segments: [PathSegment { ident: support#0, id: NodeId(4294967040), args: None }, PathSegment { ident: box_from_leak_ptr#0, id: NodeId(4294967040), args: None }], tokens: None }), span: Span { lo: BytePos(1626), hi: BytePos(1652), ctxt: #0 }, attrs: ThinVec(None), tokens: None }, [Expr { id: NodeId(4294967040), kind: Path(None, Path { span: Span { lo: BytePos(1653), hi: BytePos(1657), ctxt: #0 }, segments: [PathSegment { ident: self#0, id: NodeId(4294967040), args: None }], tokens: None }), span: Span { lo: BytePos(1653), hi: BytePos(1657), ctxt: #0 }, attrs: ThinVec(None), tokens: None }]), span: Span { lo: BytePos(1626), hi: BytePos(1658), ctxt: #0 }, attrs: ThinVec(None), tokens: None }), span: Span { lo: BytePos(1615), hi: BytePos(1659), ctxt: #0 }, attrs: ThinVec(None), tokens: None } 88 Indent { block_indent: 12, alignment: 0 }\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::visitor] visit_stmt: \\\\?\\C:\\Users\\mohamed\\projects\\lom\\fastengine\\src\\bridge_generated.rs:67:17: 67:63\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::chains] rewrite_chain Chain { parent: ChainItem { kind: Parent(Expr { id: NodeId(4294967040), kind: Path(None, Path { span: Span { lo: BytePos(1703), hi: BytePos(1707), ctxt: #0 }, segments: [PathSegment { ident: wrap#0, id: NodeId(4294967040), args: None }], tokens: None }), span: Span { lo: BytePos(1703), hi: BytePos(1707), ctxt: #0 }, attrs: ThinVec(None), tokens: None }), tries: 0, span: Span { lo: BytePos(1703), hi: BytePos(1707), ctxt: #0 } }, children: [ChainItem { kind: StructField(ptr#0), tries: 0, span: Span { lo: BytePos(1707), hi: BytePos(1711), ctxt: #0 } }] } Shape { width: 83, indent: Indent { block_indent: 16, alignment: 0 }, offset: 0 }\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::chains] rewrite chain Chain { parent: ChainItem { kind: Parent(Expr { id: NodeId(4294967040), kind: Path(None, Path { span: Span { lo: BytePos(1703), hi: BytePos(1707), ctxt: #0 }, segments: [PathSegment { ident: wrap#0, id: NodeId(4294967040), args: None }], tokens: None }), span: Span { lo: BytePos(1703), hi: BytePos(1707), ctxt: #0 }, attrs: ThinVec(None), tokens: None }), tries: 0, span: Span { lo: BytePos(1703), hi: BytePos(1707), ctxt: #0 } }, children: [ChainItem { kind: StructField(ptr#0), tries: 0, span: Span { lo: BytePos(1707), hi: BytePos(1711), ctxt: #0 } }] } Shape { width: 83, indent: Indent { block_indent: 16, alignment: 0 }, offset: 0 }\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::chains] rewrite_chain Chain { parent: ChainItem { kind: Parent(Expr { id: NodeId(4294967040), kind: Path(None, Path { span: Span { lo: BytePos(1713), hi: BytePos(1717), ctxt: #0 }, segments: [PathSegment { ident: wrap#0, id: NodeId(4294967040), args: None }], tokens: None }), span: Span { lo: BytePos(1713), hi: BytePos(1717), ctxt: #0 }, attrs: ThinVec(None), tokens: None }), tries: 0, span: Span { lo: BytePos(1713), hi: BytePos(1717), ctxt: #0 } }, children: [ChainItem { kind: StructField(len#0), tries: 0, span: Span { lo: BytePos(1717), hi: BytePos(1721), ctxt: #0 } }] } Shape { width: 83, indent: Indent { block_indent: 16, alignment: 0 }, offset: 0 }\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::chains] rewrite chain Chain { parent: ChainItem { kind: Parent(Expr { id: NodeId(4294967040), kind: Path(None, Path { span: Span { lo: BytePos(1713), hi: BytePos(1717), ctxt: #0 }, segments: [PathSegment { ident: wrap#0, id: NodeId(4294967040), args: None }], tokens: None }), span: Span { lo: BytePos(1713), hi: BytePos(1717), ctxt: #0 }, attrs: ThinVec(None), tokens: None }), tries: 0, span: Span { lo: BytePos(1713), hi: BytePos(1717), ctxt: #0 } }, children: [ChainItem { kind: StructField(len#0), tries: 0, span: Span { lo: BytePos(1717), hi: BytePos(1721), ctxt: #0 } }] } Shape { width: 83, indent: Indent { block_indent: 16, alignment: 0 }, offset: 0 }\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::visitor] close_block: Normal 0 \"\\n            \"\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::comment] comment::changed_comment_content: false\norig: 'unsafe {\n                let wrap = support::box_from_leak_ptr(self);\n                support::vec_from_leak_ptr(wrap.ptr, wrap.len)\n            }'\nnew: 'unsafe {\n            let wrap = support::box_from_leak_ptr(self);\n            support::vec_from_leak_ptr(wrap.ptr, wrap.len)\n        }'\nraw_old: \nraw_new: \n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::comment] comment::changed_comment_content: false\norig: 'unsafe {\n                let wrap = support::box_from_leak_ptr(self);\n                support::vec_from_leak_ptr(wrap.ptr, wrap.len)\n            }'\nnew: 'unsafe {\n            let wrap = support::box_from_leak_ptr(self);\n            support::vec_from_leak_ptr(wrap.ptr, wrap.len)\n        }'\nraw_old: \nraw_new: \n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::visitor] close_block: Normal 0 \"\\n            \\n            \"\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::items] compute_budgets_for_params 11 Indent { block_indent: 4, alignment: 0 }, 5, SameLine\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::items] rewrite_fn_base: one_line_budget: 75, multi_line_budget: 91, param_indent: Indent { block_indent: 8, alignment: 0 }\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::visitor] visit_block: \\\\?\\C:\\Users\\mohamed\\projects\\lom\\fastengine\\src\\bridge_generated.rs:75:37: 77:14\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::visitor] visit_stmt: \\\\?\\C:\\Users\\mohamed\\projects\\lom\\fastengine\\src\\bridge_generated.rs:76:17: 76:21\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::visitor] close_block: Normal 0 \"\\n            \"\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::items] compute_budgets_for_params 20 Indent { block_indent: 4, alignment: 0 }, 7, None\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::items] rewrite_fn_base: one_line_budget: 65, multi_line_budget: 91, param_indent: Indent { block_indent: 8, alignment: 0 }\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::missed_spans] write_snippet `\n        \n\n        // Section: impl NewWithNullPtr\n\n        `\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::missed_spans] Normal: \"\\n        \\n\\n        \"\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::missed_spans] Comment: \"// Section: impl NewWithNullPtr\\n\"\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::missed_spans] Normal: \"\\n        \"\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::missed_spans] write_snippet `\n\n        \n\n\n\n\n\n        // Section: impl IntoDart\n        \n\n\n\n\n\n        // Section: executor\n        `\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::missed_spans] Normal: \"\\n\\n        \\n\\n\\n\\n\\n\\n        \"\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::missed_spans] Comment: \"// Section: impl IntoDart\\n\"\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::missed_spans] Normal: \"        \\n\\n\\n\\n\\n\\n        \"\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::missed_spans] Comment: \"// Section: executor\\n\"\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::missed_spans] Normal: \"        \"\n[2021-10-15T14:07:39Z DEBUG rustfmt_nightly::formatting] track truncate: 1714 3\n" }
[2021-10-15T14:07:39Z DEBUG flutter_rust_bridge_codegen::commands] execute cbindgen rust_crate_dir=C:\Users\mohamed\projects\lom\fastengine c_output_path=C:\Users\mohamed\AppData\Local\Temp\.tmpI4YNaO.h
[2021-10-15T14:07:39Z DEBUG flutter_rust_bridge_codegen::commands] cbindgen config: language = "C"
[2021-10-15T14:07:39Z DEBUG flutter_rust_bridge_codegen::commands] cbindgen config_file: NamedTempFile("C:\\Users\\mohamed\\AppData\\Local\\Temp\\.tmpmvaKw8")
[2021-10-15T14:07:39Z DEBUG flutter_rust_bridge_codegen::commands] execute command: "cbindgen" "-v" "--config" "C:\\Users\\mohamed\\AppData\\Local\\Temp\\.tmpmvaKw8" "--output" "C:\\Users\\mohamed\\AppData\\Local\\Temp\\.tmpI4YNaO.h"
[2021-10-15T14:07:40Z DEBUG flutter_rust_bridge_codegen::commands] command="cbindgen" "-v" "--config" "C:\\Users\\mohamed\\AppData\\Local\\Temp\\.tmpmvaKw8" "--output" "C:\\Users\\mohamed\\AppData\\Local\\Temp\\.tmpI4YNaO.h" output=Output { status: ExitStatus(ExitStatus(0)), stdout: "", stderr: "INFO: Take fastengine::wire_create_key.\nINFO: Take fastengine::wire_uint_8_list.\nINFO: Take fastengine::new_uint_8_list.\nINFO: Take fastengine::DartPort.\nINFO: Take fastengine::DartPostCObjectFnType.\nINFO: Take fastengine::store_dart_post_cobject.\nINFO: Take fastengine::Dm - opaque (Struct is not marked #[repr(C)] or #[repr(transparent)].).\n" }
[2021-10-15T14:07:40Z DEBUG flutter_rust_bridge_codegen::commands] execute ffigen c_path=C:\Users\mohamed\AppData\Local\Temp\.tmpI4YNaO.h dart_path=C:\Users\mohamed\AppData\Local\Temp\.tmpdHEFkq
[2021-10-15T14:07:40Z DEBUG flutter_rust_bridge_codegen::commands] ffigen config:
            output: 'C:\Users\mohamed\AppData\Local\Temp\.tmpdHEFkq'
            name: 'FastengineWire'
            description: 'generated by flutter_rust_bridge'
            headers:
              entry-points:
                - 'C:\Users\mohamed\AppData\Local\Temp\.tmpI4YNaO.h'
              include-directives:
                - 'C:\Users\mohamed\AppData\Local\Temp\.tmpI4YNaO.h'
            comments: false
            preamble: |
              // ignore_for_file: camel_case_types, non_constant_identifier_names, avoid_positional_boolean_parameters, annotate_overrides

[2021-10-15T14:07:40Z DEBUG flutter_rust_bridge_codegen::commands] ffigen config_file: NamedTempFile("C:\\Users\\mohamed\\AppData\\Local\\Temp\\.tmpeRPQIg")
[2021-10-15T14:07:40Z DEBUG flutter_rust_bridge_codegen::commands] execute command: "dart" "pub" "global" "run" "ffigen" "--config" "C:\\Users\\mohamed\\AppData\\Local\\Temp\\.tmpeRPQIg"
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }', C:\Users\mohamed\.cargo\registry\src\github.aaakk.us.kg-1ecc6299db9ec823\flutter_rust_bridge_codegen-1.1.0\src\commands.rs:20:35
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

@emperor-limitless
Copy link
Author

emperor-limitless commented Oct 15, 2021

  • OS: Windows
  • Version: 10
  • flutter_rust_bridge_codegen Version: 1.1.0
  • clang++ Version: 11.0.0
  • cbindgen Version: 0.20.0
  • Generated binding code: the codegen didn't generate them for some reason
  • flutter doctor -v: Although using pure dart not flutter for this, But pasting anyway {[√] Flutter (Channel stable, 2.5.2, on Microsoft Windows [Version 10.0.19042.867], locale en-AE)
    • Flutter version 2.5.2 at C:\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 3595343e20 (2 weeks ago), 2021-09-30 12:58:18 -0700
    • Engine revision 6ac856380f
    • Dart version 2.14.3

[!] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at C:\Android
• Platform android-29, build-tools 28.0.3
• ANDROID_HOME = C:\Android
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
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\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.11.0)
• Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
• Visual Studio Community 2019 version 16.11.31605.320
• Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 4.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_242-release-1644-b01)

[√] VS Code (version 1.53.2)
• VS Code at C:\Users\mohamed\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.19.0

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

! Doctor found issues in 1 category.

  • ffigen Version: 4.1.0
GitHub
Flutter makes it easy and fast to build beautiful apps for mobile and beyond - GitHub - flutter/flutter: Flutter makes it easy and fast to build beautiful apps for mobile and beyond
How to install on Windows.
JetBrains Marketplace
Support for developing Flutter applications.
JetBrains Marketplace
Support for Dart Features

Smart coding assistance for Dart that includes code completion, formatting, navigation, intentions, refactorings, and more
Integration with...

@fzyzcjy
Copy link
Owner

fzyzcjy commented Oct 15, 2021

let me have a look

@fzyzcjy fzyzcjy changed the title flutter_rust_bridge_codegen panics system cannot find the file specified. flutter_rust_bridge_codegen panics: system cannot find the file specified. Oct 15, 2021
@fzyzcjy
Copy link
Owner

fzyzcjy commented Oct 15, 2021

Sounds like you do not have dart when executing shell commands using Rust's Command? Can you run, say, dart pub global run ffigen in shell? Moreover, could you please compile and run the following program to see whether it runs on your machine or not (paste the output)?

use std::fs;
use std::io::Write;
use std::process::Command;

fn main() {
    execute_command(
        Command::new("dart")
            .arg("pub")
            .arg("global")
            .arg("run")
            .arg("ffigen");
    );
}

fn execute_command(command: &mut Command) {
    println!("execute command: {:?}", command);

    let result = command.output().unwrap();

    if result.status.success() {
        println!("command={:?} output={:?}", command, result);
    } else if String::from_utf8_lossy(&result.stdout).contains("fatal error") {
        println!(
            "See keywords such as `error` in command output. Maybe there is a problem? command={:?} output={:?}",
            command, result
        );
        // only warn, do not panic
    } else {
        println!("command={:?} output={:?}", command, result);
        panic!("command execution failed. command={:?}", command);
    }
}

@fzyzcjy
Copy link
Owner

fzyzcjy commented Oct 15, 2021

I am using Rust's Command to execute commands - that should be quite standard

@fzyzcjy fzyzcjy changed the title flutter_rust_bridge_codegen panics: system cannot find the file specified. flutter_rust_bridge_codegen panics: system cannot find the file specified. when executing dart command using Rust's Command Oct 15, 2021
@emperor-limitless
Copy link
Author

Yes, I did the steps on the main github page, And running dart pub global run ffigen gives

Running in Directory: 'C:\Users\mohamed\projects\lom'
[SEVERE] : Couldn't find an entry for 'ffigen' in pubspec.yaml.

Tried the rust code, And

execute command: "dart" "pub" "global" "run" "ffigen"
thread 'main' panicked at 'called Result::unwrap() on an Err value: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }', rusttest.rs:18:35
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

@fzyzcjy
Copy link
Owner

fzyzcjy commented Oct 16, 2021

Aha, so that is problem of Rust's builtin Command.

Running in Directory: 'C:\Users\mohamed\projects\lom'
[SEVERE] : Couldn't find an entry for 'ffigen' in pubspec.yaml.

This means the dart command can be found (ignore the "SEVERE" since we really do not give it a yaml).

thread 'main' panicked at 'called Result::unwrap() on an Err value: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }', rusttest.rs:18:35

This means Rust's builtin Command fails to work.

It seems to be the setup problem of your computer.

@emperor-limitless
Copy link
Author

So what should I do? Reinstall rust?

@fzyzcjy
Copy link
Owner

fzyzcjy commented Oct 16, 2021

No. I guess it is problem of environment variables. Search for things like, e.g., Rust's Command says `The system cannot find the file specified.

@fzyzcjy
Copy link
Owner

fzyzcjy commented Oct 16, 2021

I do not have a windows computer at my hand. You may also look at the CI: https://github.com/fzyzcjy/flutter_rust_bridge/blob/master/.github/workflows/codegen.yml it runs code generator on windows (as well as mac and linux) and it works

GitHub
High-level memory-safe binding generator for Flutter/Dart <-> Rust - flutter_rust_bridge/codegen.yml at master · fzyzcjy/flutter_rust_bridge

@fzyzcjy
Copy link
Owner

fzyzcjy commented Oct 16, 2021

I suspect how you install dart command. Maybe you need to consider PATH environment variable as well.

@emperor-limitless
Copy link
Author

Alright, I see now, It seems since I was using the dart installation used with flutter, It was erroring for some reason, So I replaced the flutter dart with the dart from the official site and it works, Thanks for the help.

@fzyzcjy
Copy link
Owner

fzyzcjy commented Oct 16, 2021

You are welcome! Glad you find out the solution.

@github-actions
Copy link
Contributor

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants