make Dockerfile compatible with fce 0.1.11

This commit is contained in:
vms 2020-11-08 18:30:24 +03:00
parent 43bd1080a2
commit df5cbd0b0f
5 changed files with 27 additions and 31 deletions

View File

@ -4,10 +4,13 @@ RUN apt-get update \
&& apt-get install -y ca-certificates \ && apt-get install -y ca-certificates \
curl \ curl \
git \ git \
make make \
cargo
RUN curl -L https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-11/wasi-sdk-11.0-linux.tar.gz | tar xz --strip-components=1 -C / RUN curl -L https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-11/wasi-sdk-11.0-linux.tar.gz | tar xz --strip-components=1 -C /
RUN cargo install fcli
VOLUME /code VOLUME /code
WORKDIR /code WORKDIR /code
CMD make CMD make

View File

@ -160,6 +160,7 @@ all: default
$(TARGET): $(SQLITE_SRC) $(WRAPPER_SRC) $(TARGET): $(SQLITE_SRC) $(WRAPPER_SRC)
$(CC) -O3 --sysroot=$(SYSROOT) --target=$(TARGET_TRIPLE) $(SQLITE_FLAGS) $(CFLAGS) $(LDFLAGS) -Wl,$(EXPORT_FUNCS) $^ -o $@.wasm $(CC) -O3 --sysroot=$(SYSROOT) --target=$(TARGET_TRIPLE) $(SQLITE_FLAGS) $(CFLAGS) $(LDFLAGS) -Wl,$(EXPORT_FUNCS) $^ -o $@.wasm
/root/.cargo/bin/fce embed -i sqlite3.wasm -w sqlite3.wit
.PRECIOUS: $(TARGET) .PRECIOUS: $(TARGET)

View File

@ -1,5 +1,3 @@
;; Fluence SQLite fork Wasm Interface Types
;; Types ;; Types
(@interface type (func (@interface type (func
(param $size: i32) (param $size: i32)
@ -53,10 +51,10 @@
(result s32))) ;; 16 (result s32))) ;; 16
(@interface type (func (@interface type (func
(param $filename: string $flags: s32 $vfs: string) (param $filename: string $flags: s32 $vfs: string)
)) ;; 17 (result record 8))) ;; 17
(@interface type (func (@interface type (func
(param $filename: string $flags: s32 $vfs: string) (param $filename: string $flags: s32 $vfs: string)
)) ;; 18 (result record 8))) ;; 18
(@interface type (func (@interface type (func
(param $db_handle: u32) (param $db_handle: u32)
(result s32))) ;; 19 (result s32))) ;; 19
@ -113,27 +111,27 @@
(result s32))) ;; 36 (result s32))) ;; 36
(@interface type (func (@interface type (func
(param $db_handle: u32 $sql: string) (param $db_handle: u32 $sql: string)
)) ;; 37 (result record 7))) ;; 37
(@interface type (func (@interface type (func
(param $db_handle: u32 $sql: string) (param $db_handle: u32 $sql: string)
)) ;; 38 (result record 7))) ;; 38
(@interface type (func (@interface type (func
(param $stmt_handle: u32 $pos: s32) (param $stmt_handle: u32)
(result s32))) ;; 39 (result s32))) ;; 39
(@interface type (func (@interface type (func
(param $stmt_handle: u32 $pos: s32) (param $stmt_handle: u32)
(result s32))) ;; 40 (result s32))) ;; 40
(@interface type (func (@interface type (func
(param $stmt_handle: u32) (param $stmt_handle: u32 $pos: s32)
(result s32))) ;; 41 (result s32))) ;; 41
(@interface type (func (@interface type (func
(param $stmt_handle: u32) (param $stmt_handle: u32 $pos: s32)
(result s32))) ;; 42 (result s32))) ;; 42
(@interface type (func (@interface type (func
(param $stmt_handle: u32 $pos: s32 $blob: byte_array $xDel: s32) (param $stmt_handle: u32 $pos: s32 $blob: array (u8) $xDel: s32)
(result s32))) ;; 43 (result s32))) ;; 43
(@interface type (func (@interface type (func
(param $stmt_handle: u32 $pos: s32 $blob: byte_array $xDel: s32) (param $stmt_handle: u32 $pos: s32 $blob: array (u8) $xDel: s32)
(result s32))) ;; 44 (result s32))) ;; 44
(@interface type (func (@interface type (func
(param $db_handle: u32) (param $db_handle: u32)
@ -155,20 +153,20 @@
(result s32))) ;; 50 (result s32))) ;; 50
(@interface type (func (@interface type (func
(param $db_handle: u32 $sql: string $callback_id: s32 $callback_arg: s32) (param $db_handle: u32 $sql: string $callback_id: s32 $callback_arg: s32)
)) ;; 51 (result record 6))) ;; 51
(@interface type (func (@interface type (func
(param $db_handle: u32 $sql: string $callback_id: s32 $callback_arg: s32) (param $db_handle: u32 $sql: string $callback_id: s32 $callback_arg: s32)
)) ;; 52 (result record 6))) ;; 52
(@interface type (func (@interface type (func
(result s32))) ;; 53 (result s32))) ;; 53
(@interface type (func (@interface type (func
(result s32))) ;; 54 (result s32))) ;; 54
(@interface type (func (@interface type (func
(param $stmt_handle: u32 $icol: s32) (param $stmt_handle: u32 $icol: s32)
(result byte_array))) ;; 55 (result array (u8)))) ;; 55
(@interface type (func (@interface type (func
(param $stmt_handle: u32 $icol: s32) (param $stmt_handle: u32 $icol: s32)
(result byte_array))) ;; 56 (result array (u8)))) ;; 56
(@interface type (func (@interface type (func
(param $stmt_handle: u32 $N: u32) (param $stmt_handle: u32 $N: u32)
(result string))) ;; 57 (result string))) ;; 57
@ -306,13 +304,13 @@
(@interface func (type 39) (@interface func (type 39)
arg.get 0 arg.get 0
i32.from_u32 i32.from_u32
arg.get 1
i32.from_s32
call-core 21 call-core 21
s32.from_i32) s32.from_i32)
(@interface func (type 41) (@interface func (type 41)
arg.get 0 arg.get 0
i32.from_u32 i32.from_u32
arg.get 1
i32.from_s32
call-core 22 call-core 22
s32.from_i32) s32.from_i32)
(@interface func (type 43) (@interface func (type 43)
@ -321,10 +319,7 @@
arg.get 1 arg.get 1
i32.from_s32 i32.from_s32
arg.get 2 arg.get 2
byte_array.size array.lower_memory u8
call-core 0
arg.get 2
byte_array.lower_memory
arg.get 3 arg.get 3
i32.from_s32 i32.from_s32
call-core 23 call-core 23
@ -379,10 +374,7 @@
call-core 29 call-core 29
call-core 3 call-core 3
call-core 2 call-core 2
byte_array.lift_memory array.lift_memory u8)
call-core 3
call-core 2
call-core 1)
(@interface func (type 57) (@interface func (type 57)
arg.get 0 arg.get 0
i32.from_u32 i32.from_u32
@ -425,8 +417,8 @@
(@interface export "sqlite3_bind_int64" (func 34)) (@interface export "sqlite3_bind_int64" (func 34))
(@interface export "sqlite3_finalize" (func 36)) (@interface export "sqlite3_finalize" (func 36))
(@interface export "sqlite3_prepare_v2" (func 38)) (@interface export "sqlite3_prepare_v2" (func 38))
(@interface export "sqlite3_bind_null" (func 40)) (@interface export "sqlite3_column_count" (func 40))
(@interface export "sqlite3_column_count" (func 42)) (@interface export "sqlite3_bind_null" (func 42))
(@interface export "sqlite3_bind_blob" (func 44)) (@interface export "sqlite3_bind_blob" (func 44))
(@interface export "sqlite3_total_changes" (func 46)) (@interface export "sqlite3_total_changes" (func 46))
(@interface export "sqlite3_bind_text" (func 48)) (@interface export "sqlite3_bind_text" (func 48))

View File

@ -792,7 +792,7 @@ void sqlite3_prepare_v2_(
const char *pzTail; const char *pzTail;
const int ret_code = sqlite3_prepare_v2(db, zSql, nBytes, &ppStmt, &pzTail); const int ret_code = sqlite3_prepare_v2(db, zSql, nBytes, &ppStmt, &pzTail);
free(zSql); free((void *)zSql);
int *result = (int *)malloc(3*8); int *result = (int *)malloc(3*8);
result[0] = ret_code; result[0] = ret_code;

View File

@ -1157,7 +1157,7 @@ void sqlite3_column_text_(sqlite3_stmt *pStmt, int i) __EXPORT_NAME(sqlite3_colu
const unsigned char *result = sqlite3_column_text(pStmt, i); const unsigned char *result = sqlite3_column_text(pStmt, i);
set_result_ptr((char *)result); set_result_ptr((char *)result);
set_result_size(strlen(result)); set_result_size(strlen((const char *)result));
} }
const unsigned char *sqlite3_column_text(sqlite3_stmt *pStmt, int i){ const unsigned char *sqlite3_column_text(sqlite3_stmt *pStmt, int i){