Skip to content

Commit 0bd26e3

Browse files
authored
chore: bump build image and rust version, include memory features (#4)
* chore: bump build image and rust version * chore: bump versions again * fix: use proper rustflags to include memory allocation info * chore: bump versions, update config.toml * fix: expose `commit_pages` to test * fix: `commit_pages` in the `wasm_snapshot_preview1` namespace
1 parent 4388d15 commit 0bd26e3

File tree

5 files changed

+23
-8
lines changed

5 files changed

+23
-8
lines changed

.cargo/config.toml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,24 @@
11
[target.wasm32-wasi]
22
rustflags = [
3+
"-Ctarget-feature=-crt-static,+bulk-memory",
4+
"-Clink-self-contained=no",
5+
"-Clink-arg=-l",
6+
"-Clink-arg=c",
7+
"-Clink-arg=/workdir/MSFS_SDK/WASM/wasi-sysroot/lib/wasm32-wasi/libclang_rt.builtins-wasm32.a",
8+
"-Clink-arg=-L",
9+
"-Clink-arg=/workdir/MSFS_SDK/WASM/wasi-sysroot/lib/wasm32-wasi",
310
"-Clink-arg=--export-table",
11+
"-Clink-arg=--allow-undefined",
12+
"-Clink-arg=--export-dynamic",
13+
"-Clink-arg=--export=__wasm_call_ctors",
414
"-Clink-arg=--export=malloc",
515
"-Clink-arg=--export=free",
6-
"-Clink-arg=-L/usr/lib/llvm-15/lib/clang/15.0.7/lib/wasi",
7-
"-Clink-arg=-lclang_rt.builtins-wasm32"
16+
"-Clink-arg=--export=mark_decommit_pages",
17+
"-Clink-arg=--export=mallinfo",
18+
"-Clink-arg=--export=mchunkit_begin",
19+
"-Clink-arg=--export=mchunkit_next",
20+
"-Clink-arg=--export=get_pages_state",
821
]
922

1023
[build]
11-
target = "wasm32-wasi"
24+
target = "wasm32-wasi"

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
22
profile = "default"
3-
channel = "1.72.1"
3+
channel = "1.79.0"

scripts/run_docker_cmd.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@echo off
22

3-
set image="ghcr.io/flybywiresim/dev-env@sha256:528f8e1ca9063b9346c7d4f684d7aadbcb58ca1fba2b1a3c2cdd9c820c4236f4"
3+
set image="ghcr.io/flybywiresim/dev-env@sha256:aa36c0e4b8c66c2ec0195a104f8ae04a8ffbf45e8ddb6a8aca4f7237436bd876"
44

55
cd %~dp0
66

scripts/run_docker_cmd.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
IMAGE="ghcr.io/flybywiresim/dev-env@sha256:528f8e1ca9063b9346c7d4f684d7aadbcb58ca1fba2b1a3c2cdd9c820c4236f4"
3+
IMAGE="ghcr.io/flybywiresim/dev-env@sha256:aa36c0e4b8c66c2ec0195a104f8ae04a8ffbf45e8ddb6a8aca4f7237436bd876"
44

55
cd "$(dirname "$0")"
66

src/test/setup.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,9 @@ const promiseResults = new Map<bigint, [number, number]>()
160160
const failedRequests: bigint[] = []
161161

162162
wasmInstance = new WebAssembly.Instance(wasmModule, {
163-
wasi_snapshot_preview1: wasiSystem.wasiImport,
163+
wasi_snapshot_preview1: Object.assign(wasiSystem.wasiImport, {
164+
commit_pages: () => { }, // Empty implementation of this function as it is needed for the WASM module to properly load
165+
}),
164166
env: {
165167
fsCommBusCall: (eventNamePointer: number, args: number) => {
166168
const eventName = readString(eventNamePointer)
@@ -236,7 +238,7 @@ wasmInstance = new WebAssembly.Instance(wasmModule, {
236238
return 3 // FS_NETWORK_HTTP_REQUEST_STATE_DATA_READY
237239
}
238240
return 2 // FS_NETWORK_HTTP_REQUEST_STATE_WAITING_FOR_DATA
239-
},
241+
}
240242
},
241243
}) as WasmInstance
242244

0 commit comments

Comments
 (0)