Skip to content

Commit

Permalink
fix: no implementation of WireSyncRust build error
Browse files Browse the repository at this point in the history
  • Loading branch information
KRTirtho committed Jan 5, 2023
1 parent d4eaf97 commit 0c755e2
Show file tree
Hide file tree
Showing 9 changed files with 1,067 additions and 448 deletions.
156 changes: 155 additions & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
archive:
dependency: transitive
description:
name: archive
url: "https://pub.dartlang.org"
source: hosted
version: "3.3.5"
args:
dependency: transitive
description:
name: args
url: "https://pub.dartlang.org"
source: hosted
version: "2.3.1"
async:
dependency: transitive
description:
Expand All @@ -15,6 +29,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
build_cli_annotations:
dependency: transitive
description:
name: build_cli_annotations
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
characters:
dependency: transitive
description:
Expand All @@ -36,6 +57,27 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.16.0"
colorize:
dependency: transitive
description:
name: colorize
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.0"
convert:
dependency: transitive
description:
name: convert
url: "https://pub.dartlang.org"
source: hosted
version: "3.1.1"
crypto:
dependency: transitive
description:
name: crypto
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.2"
cupertino_icons:
dependency: "direct main"
description:
Expand Down Expand Up @@ -75,7 +117,7 @@ packages:
name: flutter_rust_bridge
url: "https://pub.dartlang.org"
source: hosted
version: "1.41.3"
version: "1.59.0"
flutter_test:
dependency: "direct dev"
description: flutter
Expand All @@ -86,6 +128,20 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
http:
dependency: transitive
description:
name: http
url: "https://pub.dartlang.org"
source: hosted
version: "0.13.5"
http_parser:
dependency: transitive
description:
name: http_parser
url: "https://pub.dartlang.org"
source: hosted
version: "4.0.2"
js:
dependency: transitive
description:
Expand All @@ -100,6 +156,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
logging:
dependency: transitive
description:
name: logging
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
matcher:
dependency: transitive
description:
Expand Down Expand Up @@ -128,6 +191,13 @@ packages:
relative: true
source: path
version: "0.3.1"
mime:
dependency: transitive
description:
name: mime
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.3"
path:
dependency: transitive
description:
Expand Down Expand Up @@ -170,13 +240,62 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.0"
petitparser:
dependency: transitive
description:
name: petitparser
url: "https://pub.dartlang.org"
source: hosted
version: "5.1.0"
plugin_platform_interface:
dependency: transitive
description:
name: plugin_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.2"
pointycastle:
dependency: transitive
description:
name: pointycastle
url: "https://pub.dartlang.org"
source: hosted
version: "3.6.2"
pool:
dependency: transitive
description:
name: pool
url: "https://pub.dartlang.org"
source: hosted
version: "1.5.1"
puppeteer:
dependency: transitive
description:
name: puppeteer
url: "https://pub.dartlang.org"
source: hosted
version: "2.20.0"
shelf:
dependency: transitive
description:
name: shelf
url: "https://pub.dartlang.org"
source: hosted
version: "1.4.0"
shelf_static:
dependency: transitive
description:
name: shelf_static
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.1"
shelf_web_socket:
dependency: transitive
description:
name: shelf_web_socket
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.3"
sky_engine:
dependency: transitive
description: flutter
Expand Down Expand Up @@ -224,13 +343,48 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.12"
tuple:
dependency: transitive
description:
name: tuple
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.1"
uuid:
dependency: transitive
description:
name: uuid
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.7"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.2"
web_socket_channel:
dependency: transitive
description:
name: web_socket_channel
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.0"
yaml:
dependency: transitive
description:
name: yaml
url: "https://pub.dartlang.org"
source: hosted
version: "3.1.1"
sdks:
dart: ">=2.18.0 <3.0.0"
flutter: ">=2.8.0"
34 changes: 22 additions & 12 deletions frameworks/rust_crate/rust_crate/bridge_generated.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
typedef struct _Dart_Handle* Dart_Handle;

typedef struct DartCObject DartCObject;

typedef int64_t DartPort;

typedef bool (*DartPostCObjectFnType)(DartPort port_id, void *message);

typedef struct wire_uint_8_list {
uint8_t *ptr;
Expand Down Expand Up @@ -28,15 +35,17 @@ typedef struct wire_Metadata {
uint64_t *file_size;
} wire_Metadata;

typedef struct WireSyncReturnStruct {
uint8_t *ptr;
int32_t len;
bool success;
} WireSyncReturnStruct;
typedef struct DartCObject *WireSyncReturn;

typedef int64_t DartPort;
void store_dart_post_cobject(DartPostCObjectFnType ptr);

typedef bool (*DartPostCObjectFnType)(DartPort port_id, void *message);
Dart_Handle get_dart_object(uintptr_t ptr);

void drop_dart_object(uintptr_t ptr);

uintptr_t new_dart_opaque(Dart_Handle handle);

intptr_t init_frb_dart_api_dl(void *obj);

void wire_ping(int64_t port_);

Expand All @@ -60,9 +69,7 @@ uint64_t *new_box_autoadd_u64_0(uint64_t value);

struct wire_uint_8_list *new_uint_8_list_0(int32_t len);

void free_WireSyncReturnStruct(struct WireSyncReturnStruct val);

void store_dart_post_cobject(DartPostCObjectFnType ptr);
void free_WireSyncReturn(WireSyncReturn ptr);

static int64_t dummy_method_to_enforce_bundling(void) {
int64_t dummy_var = 0;
Expand All @@ -76,7 +83,10 @@ static int64_t dummy_method_to_enforce_bundling(void) {
dummy_var ^= ((int64_t) (void*) new_box_autoadd_u16_0);
dummy_var ^= ((int64_t) (void*) new_box_autoadd_u64_0);
dummy_var ^= ((int64_t) (void*) new_uint_8_list_0);
dummy_var ^= ((int64_t) (void*) free_WireSyncReturnStruct);
dummy_var ^= ((int64_t) (void*) free_WireSyncReturn);
dummy_var ^= ((int64_t) (void*) store_dart_post_cobject);
dummy_var ^= ((int64_t) (void*) get_dart_object);
dummy_var ^= ((int64_t) (void*) drop_dart_object);
dummy_var ^= ((int64_t) (void*) new_dart_opaque);
return dummy_var;
}
}
6 changes: 3 additions & 3 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ gen:
--c-output "$REPO_DIR/frameworks/rust_crate/rust_crate/bridge_generated.h"

build-linux:
export REPO_DIR="$PWD"; cd "$PWD/rust"; cargo build --release; cp "$REPO_DIR/rust/target/release/librust.a" "$REPO_DIR/linux/rust"
export REPO_DIR="$PWD"; cd "$PWD/rust"; cargo build --release; cp "$REPO_DIR/rust/target/release/librust.so" "$REPO_DIR/linux/rust"

build-windows:
export REPO_DIR="$PWD"; cd "$PWD/rust"; cargo build --release; cp "$REPO_DIR/rust/target/release/rust.dll" "$REPO_DIR/rust/target/release/rust.lib" "$REPO_DIR/windows/rust"
export REPO_DIR="$PWD"; cd "$PWD/rust"; cargo build --release; cp "$REPO_DIR/rust/target/release/rust.dll" "$REPO_DIR/windows/rust"

build-macos:
export REPO_DIR="$PWD"; cd "$PWD/rust"; cargo build --release; cp "$REPO_DIR/rust/target/release/librust.a" "$REPO_DIR/macos/Libs"
export REPO_DIR="$PWD"; cd "$PWD/rust"; cargo build --release; cp "$REPO_DIR/rust/target/release/librust.dylib" "$REPO_DIR/macos/Libs"

build-android:
cd rust; cargo ndk -t armeabi-v7a -t arm64-v8a -t x86_64 -t x86 -o ../android/src/main/jniLibs build --release
Expand Down
Loading

0 comments on commit 0c755e2

Please sign in to comment.