Failed to run flutter_rust_bridge_codegen due to outdated dependency version #2173

Closed
opened 2026-02-21 00:15:11 -05:00 by deekerman · 2 comments
Owner

Originally created by @ShellWen on GitHub (Oct 3, 2023).

Bug Description

When I clone the repo, following build steps in GitHub Actions Workflows (BTW, build in README can't work). I got errors.

Here is the output:

❯ ~/.cargo/bin/flutter_rust_bridge_codegen --rust-input ./src/flutter_ffi.rs --dart-output ./flutter/lib/generated_bridge.dart
2023/10/03 16:01:12 [WARN] Skipping unresolvable module io (tried /<REDACTED>/rustdesk/src/io.rs, /<REDACTED>/rustdesk/src/io/mod.rs, /<REDACTED>/rustdesk/src/bridge_generated/io.rs, /<REDACTED>/rustdesk/src/bridge_generated/io/mod.rs, )
2023/10/03 16:01:12 [INFO] Phase: Validate config(s)
2023/10/03 16:01:12 [INFO] Picked config: Opts { rust_input_path: "/<REDACTED>/rustdesk/./src/flutter_ffi.rs", dart_output_path: "/<REDACTED>/rustdesk/./flutter/lib/generated_bridge.dart", dart_decl_output_path: None, c_output_path: ["/tmp/.tmp4sOTW6.h"], rust_crate_dir: "/<REDACTED>/rustdesk", rust_output_path: "/<REDACTED>/rustdesk/./src/bridge_generated.rs", class_name: "Rustdesk", dart_format_line_length: 80, dart_enums_style: false, 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"], llvm_compiler_opts: "", manifest_path: "/<REDACTED>/rustdesk/Cargo.toml", dart_root: Some("/<REDACTED>/rustdesk/./flutter"), build_runner: true, block_index: BlockIndex(0), skip_deps_check: false, wasm_enabled: false, inline_rust: false, bridge_in_method: true, extra_headers: "" }
2023/10/03 16:01:12 [INFO] Phase: Parse source code to AST, then to IR
2023/10/03 16:01:13 [WARN] Skipping unresolvable module io (tried /<REDACTED>/rustdesk/src/io.rs, /<REDACTED>/rustdesk/src/io/mod.rs, /<REDACTED>/rustdesk/src/bridge_generated/io.rs, /<REDACTED>/rustdesk/src/bridge_generated/io/mod.rs, )
2023/10/03 16:01:13 [INFO] Phase: Transform IR
2023/10/03 16:01:13 [INFO] Phase: Generate Rust code
2023/10/03 16:01:13 [INFO] Phase: Generate Dart code
Flutter 3.13.6 • channel stable • https://github.com/flutter/flutter.git
Framework • revision ead455963c (6 天前) • 2023-09-26 18:28:17 -0700
Engine • revision a794cf2681
Tools • Dart 3.1.3 • DevTools 2.25.0
2023/10/03 16:01:13 [INFO] Phase: Generating Dart bindings for Rust
Deprecated. Use `dart run` instead.
Resolving dependencies... (2.0s)
Got dependencies.
Building package executable... (2.2s)
Built ffigen:ffigen.
Running in Directory: '/<REDACTED>/rustdesk/flutter'
Input Headers: [/tmp/.tmpfZ3U2n.h]
[SEVERE] : Header /tmp/.tmpfZ3U2n.h: Total errors/warnings: 1.
[SEVERE] :     /tmp/.tmpfZ3U2n.h:1:10: fatal error: 'stdbool.h' file not found [Lexical or Preprocessor Issue]
[WARNING]: No definition found for declaration - (Cursor) spelling: _Dart_Handle, kind: 2, kindSpelling: StructDecl, type: 105, typeSpelling: struct _Dart_Handle, usr: c:@S@_Dart_Handle
[WARNING]: No definition found for declaration - (Cursor) spelling: _Dart_Handle, kind: 2, kindSpelling: StructDecl, type: 105, typeSpelling: struct _Dart_Handle, usr: c:@S@_Dart_Handle
[WARNING]: No definition found for declaration - (Cursor) spelling: DartCObject, kind: 2, kindSpelling: StructDecl, type: 105, typeSpelling: struct DartCObject, usr: c:@S@DartCObject
[WARNING]: No definition found for declaration - (Cursor) spelling: DartCObject, kind: 2, kindSpelling: StructDecl, type: 105, typeSpelling: struct DartCObject, usr: c:@S@DartCObject
[WARNING]: No definition found for declaration - (Cursor) spelling: _Dart_Handle, kind: 2, kindSpelling: StructDecl, type: 105, typeSpelling: struct _Dart_Handle, usr: c:@S@_Dart_Handle
[WARNING]: No definition found for declaration - (Cursor) spelling: _Dart_Handle, kind: 2, kindSpelling: StructDecl, type: 105, typeSpelling: struct _Dart_Handle, usr: c:@S@_Dart_Handle
[WARNING]: No definition found for declaration - (Cursor) spelling: _Dart_Handle, kind: 2, kindSpelling: StructDecl, type: 105, typeSpelling: struct _Dart_Handle, usr: c:@S@_Dart_Handle
[WARNING]: No definition found for declaration - (Cursor) spelling: _Dart_Handle, kind: 2, kindSpelling: StructDecl, type: 105, typeSpelling: struct _Dart_Handle, usr: c:@S@_Dart_Handle
[WARNING]: No definition found for declaration - (Cursor) spelling: DartCObject, kind: 2, kindSpelling: StructDecl, type: 105, typeSpelling: struct DartCObject, usr: c:@S@DartCObject
[WARNING]: Generated declaration '_Dart_Handle' start's with '_' and therefore will be private.
Finished, Bindings generated in /tmp/.tmpHvV26W
the path is "/tmp/.tmp4sOTW6.h"
2023/10/03 16:01:24 [INFO] Phase: Running build_runner
2023/10/03 16:01:24 [INFO] Running build_runner at /<REDACTED>/rustdesk/./flutter
Deprecated. Use `dart run` instead.
Building package executable... (1.2s)
Failed to build build_runner:build_runner:
../../../../.pub-cache/hosted/pub.dev/watcher-1.0.2/lib/src/constructable_file_system_event.dart:7:57: Error: The class 'FileSystemEvent' can't be extended, implemented, or mixed in outside of its library because it's a sealed class.
abstract class _ConstructableFileSystemEvent implements FileSystemEvent {
                                                        ^
2023/10/03 16:01:26 [WARN] command=cd "/<REDACTED>/rustdesk/./flutter" && "sh" "-c" "\"flutter\" \"pub\" \"run\" \"build_runner\" \"build\" \"--delete-conflicting-outputs\"" stdout= stderr=
2023/10/03 16:01:26 [ERROR] fatal: Failed to run build_runner for /<REDACTED>/rustdesk/./flutter:

To resolve the problem, just upgrade watcher to 1.2.0+. It will works like a charm again.

How to Reproduce

Writen in Bug Description

Expected Behavior

Writen in Bug Description

Operating system(s) on local side and remote side

Build on Linux <REDACTED> 6.5.5-zen1-1-zen #1 ZEN SMP PREEMPT_DYNAMIC Sat, 23 Sep 2023 22:54:46 +0000 x86_64 GNU/Linux. With latest packages from Arch.

RustDesk Version(s) on local side and remote side

Git Master

Screenshots

.

Additional Context

No response

Originally created by @ShellWen on GitHub (Oct 3, 2023). ### Bug Description When I clone the repo, following build steps in GitHub Actions Workflows (BTW, [build in README](https://github.com/rustdesk/rustdesk#build-1) can't work). I got errors. Here is the output: ``` ❯ ~/.cargo/bin/flutter_rust_bridge_codegen --rust-input ./src/flutter_ffi.rs --dart-output ./flutter/lib/generated_bridge.dart 2023/10/03 16:01:12 [WARN] Skipping unresolvable module io (tried /<REDACTED>/rustdesk/src/io.rs, /<REDACTED>/rustdesk/src/io/mod.rs, /<REDACTED>/rustdesk/src/bridge_generated/io.rs, /<REDACTED>/rustdesk/src/bridge_generated/io/mod.rs, ) 2023/10/03 16:01:12 [INFO] Phase: Validate config(s) 2023/10/03 16:01:12 [INFO] Picked config: Opts { rust_input_path: "/<REDACTED>/rustdesk/./src/flutter_ffi.rs", dart_output_path: "/<REDACTED>/rustdesk/./flutter/lib/generated_bridge.dart", dart_decl_output_path: None, c_output_path: ["/tmp/.tmp4sOTW6.h"], rust_crate_dir: "/<REDACTED>/rustdesk", rust_output_path: "/<REDACTED>/rustdesk/./src/bridge_generated.rs", class_name: "Rustdesk", dart_format_line_length: 80, dart_enums_style: false, 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"], llvm_compiler_opts: "", manifest_path: "/<REDACTED>/rustdesk/Cargo.toml", dart_root: Some("/<REDACTED>/rustdesk/./flutter"), build_runner: true, block_index: BlockIndex(0), skip_deps_check: false, wasm_enabled: false, inline_rust: false, bridge_in_method: true, extra_headers: "" } 2023/10/03 16:01:12 [INFO] Phase: Parse source code to AST, then to IR 2023/10/03 16:01:13 [WARN] Skipping unresolvable module io (tried /<REDACTED>/rustdesk/src/io.rs, /<REDACTED>/rustdesk/src/io/mod.rs, /<REDACTED>/rustdesk/src/bridge_generated/io.rs, /<REDACTED>/rustdesk/src/bridge_generated/io/mod.rs, ) 2023/10/03 16:01:13 [INFO] Phase: Transform IR 2023/10/03 16:01:13 [INFO] Phase: Generate Rust code 2023/10/03 16:01:13 [INFO] Phase: Generate Dart code Flutter 3.13.6 • channel stable • https://github.com/flutter/flutter.git Framework • revision ead455963c (6 天前) • 2023-09-26 18:28:17 -0700 Engine • revision a794cf2681 Tools • Dart 3.1.3 • DevTools 2.25.0 2023/10/03 16:01:13 [INFO] Phase: Generating Dart bindings for Rust Deprecated. Use `dart run` instead. Resolving dependencies... (2.0s) Got dependencies. Building package executable... (2.2s) Built ffigen:ffigen. Running in Directory: '/<REDACTED>/rustdesk/flutter' Input Headers: [/tmp/.tmpfZ3U2n.h] [SEVERE] : Header /tmp/.tmpfZ3U2n.h: Total errors/warnings: 1. [SEVERE] : /tmp/.tmpfZ3U2n.h:1:10: fatal error: 'stdbool.h' file not found [Lexical or Preprocessor Issue] [WARNING]: No definition found for declaration - (Cursor) spelling: _Dart_Handle, kind: 2, kindSpelling: StructDecl, type: 105, typeSpelling: struct _Dart_Handle, usr: c:@S@_Dart_Handle [WARNING]: No definition found for declaration - (Cursor) spelling: _Dart_Handle, kind: 2, kindSpelling: StructDecl, type: 105, typeSpelling: struct _Dart_Handle, usr: c:@S@_Dart_Handle [WARNING]: No definition found for declaration - (Cursor) spelling: DartCObject, kind: 2, kindSpelling: StructDecl, type: 105, typeSpelling: struct DartCObject, usr: c:@S@DartCObject [WARNING]: No definition found for declaration - (Cursor) spelling: DartCObject, kind: 2, kindSpelling: StructDecl, type: 105, typeSpelling: struct DartCObject, usr: c:@S@DartCObject [WARNING]: No definition found for declaration - (Cursor) spelling: _Dart_Handle, kind: 2, kindSpelling: StructDecl, type: 105, typeSpelling: struct _Dart_Handle, usr: c:@S@_Dart_Handle [WARNING]: No definition found for declaration - (Cursor) spelling: _Dart_Handle, kind: 2, kindSpelling: StructDecl, type: 105, typeSpelling: struct _Dart_Handle, usr: c:@S@_Dart_Handle [WARNING]: No definition found for declaration - (Cursor) spelling: _Dart_Handle, kind: 2, kindSpelling: StructDecl, type: 105, typeSpelling: struct _Dart_Handle, usr: c:@S@_Dart_Handle [WARNING]: No definition found for declaration - (Cursor) spelling: _Dart_Handle, kind: 2, kindSpelling: StructDecl, type: 105, typeSpelling: struct _Dart_Handle, usr: c:@S@_Dart_Handle [WARNING]: No definition found for declaration - (Cursor) spelling: DartCObject, kind: 2, kindSpelling: StructDecl, type: 105, typeSpelling: struct DartCObject, usr: c:@S@DartCObject [WARNING]: Generated declaration '_Dart_Handle' start's with '_' and therefore will be private. Finished, Bindings generated in /tmp/.tmpHvV26W the path is "/tmp/.tmp4sOTW6.h" 2023/10/03 16:01:24 [INFO] Phase: Running build_runner 2023/10/03 16:01:24 [INFO] Running build_runner at /<REDACTED>/rustdesk/./flutter Deprecated. Use `dart run` instead. Building package executable... (1.2s) Failed to build build_runner:build_runner: ../../../../.pub-cache/hosted/pub.dev/watcher-1.0.2/lib/src/constructable_file_system_event.dart:7:57: Error: The class 'FileSystemEvent' can't be extended, implemented, or mixed in outside of its library because it's a sealed class. abstract class _ConstructableFileSystemEvent implements FileSystemEvent { ^ 2023/10/03 16:01:26 [WARN] command=cd "/<REDACTED>/rustdesk/./flutter" && "sh" "-c" "\"flutter\" \"pub\" \"run\" \"build_runner\" \"build\" \"--delete-conflicting-outputs\"" stdout= stderr= 2023/10/03 16:01:26 [ERROR] fatal: Failed to run build_runner for /<REDACTED>/rustdesk/./flutter: ``` To resolve the problem, just upgrade `watcher` to 1.2.0+. It will works like a charm again. ### How to Reproduce Writen in `Bug Description` ### Expected Behavior Writen in `Bug Description` ### Operating system(s) on local side and remote side Build on `Linux <REDACTED> 6.5.5-zen1-1-zen #1 ZEN SMP PREEMPT_DYNAMIC Sat, 23 Sep 2023 22:54:46 +0000 x86_64 GNU/Linux`. With latest packages from Arch. ### RustDesk Version(s) on local side and remote side Git Master ### Screenshots . ### Additional Context _No response_
deekerman 2026-02-21 00:15:11 -05:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@rustdesk commented on GitHub (Oct 3, 2023):

#763

@rustdesk commented on GitHub (Oct 3, 2023): #763
Author
Owner

@xubingyan commented on GitHub (Apr 18, 2024):

I run flutter_rust_bridge_codegen ,it occurs [SEVERE] : Couldn't find dynamic library in default locations.
[SEVERE] : Please supply one or more path/to/llvm in ffigen's config under the key 'llvm-path'.

@xubingyan commented on GitHub (Apr 18, 2024): I run flutter_rust_bridge_codegen ,it occurs [SEVERE] : Couldn't find dynamic library in default locations. [SEVERE] : Please supply one or more path/to/llvm in ffigen's config under the key 'llvm-path'.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/rustdesk-rustdesk#2173
No description provided.