Skip to content

Commit f78eb87

Browse files
committed
Update tooling, dependencies, and RUSTFLAGS to support latest nightlies
1 parent 2dd8590 commit f78eb87

File tree

6 files changed

+102
-64
lines changed

6 files changed

+102
-64
lines changed

.cargo/config.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,16 @@ rustflags = []
33

44
[target.aarch64-apple-darwin]
55
rustflags = ["-C", "link-args=-Wl,-undefined,dynamic_lookup"]
6+
7+
[target.wasm32-unknown-unknown]
8+
rustflags = [
9+
"-C", "target-feature=+atomics,+bulk-memory",
10+
"-C", "link-args=--shared-memory",
11+
"-C", "link-args=--import-memory",
12+
"-C", "link-args=--export-memory",
13+
"-C", "link-args=--max-memory=4294967296",
14+
"-C", "link-args=--export=__wasm_init_tls",
15+
"-C", "link-args=--export=__tls_size",
16+
"-C", "link-args=--export=__tls_align",
17+
"-C", "link-args=--export=__tls_base",
18+
]

Cargo.lock

Lines changed: 76 additions & 58 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -237,10 +237,10 @@ vergen = { version = "8.2.4", features = [
237237
] }
238238
vrf = { path = "vrf" }
239239
warp = "0.3"
240-
wasm-bindgen = "0.2"
241-
wasm-bindgen-futures = "0.4"
242-
wasm-bindgen-test = "0.3.33"
243-
wasm_thread = { version = "0.3", features = ["es_modules"] }
240+
wasm-bindgen = "^0.2.106"
241+
wasm-bindgen-futures = "^0.4.56"
242+
wasm-bindgen-test = "^0.3.56"
243+
wasm_thread = { version = "^0.3.3", features = ["es_modules"] }
244244
web-sys = { version = "0.3.64" }
245245
webrtc = { git = "https://github.com/openmina/webrtc.git", rev = "aeaa62682b97f6984627bedd6e6811fe17af18eb" }
246246
x25519-dalek = { version = "2.0.1", features = ["static_secrets"] }

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ NIGHTLY_RUST_VERSION = "nightly"
1010
NODE_VERSION := $(shell cat .nvmrc)
1111

1212
# WebAssembly
13-
WASM_BINDGEN_CLI_VERSION = "0.2.99"
13+
WASM_BINDGEN_CLI_VERSION = "0.2.106"
1414

1515
# TOML formatter
1616
TAPLO_CLI_VERSION = "0.9.3"

frontend/src/app/core/services/web-node.service.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,13 @@ export class WebNodeService {
144144
return of(any(window).webnode).pipe(
145145
switchMap((wasm: any) => {
146146
this.wasm$.next(wasm);
147+
148+
// nb: this is RUSTFLAGS "-Clink-args=--max-memory=4294967296" (4GiB)
149+
// nb: in .cargo/config.toml for the wasm32 target the div by 65536
150+
// nb: is because the WASM web API requires memory size to be specified
151+
// nb: in terms of 64KiB *pages*
152+
// todo: move to wherever angular injects `this.memory`
153+
this.memory.maximum = 4294967296 / 65536;
147154
return from(
148155
wasm.default(undefined, new WebAssembly.Memory(this.memory)),
149156
).pipe(map(() => wasm));

website/docs/developers/scripts/setup/install-wasm-tools.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
cargo install wasm-pack
33

44
# Install wasm-bindgen CLI tool for generating WebAssembly bindings
5-
cargo install -f wasm-bindgen-cli --version 0.2.99
5+
cargo install --force wasm-bindgen-cli --version 0.2.106 --force
66

77
# Add WebAssembly target
88
rustup target add wasm32-unknown-unknown

0 commit comments

Comments
 (0)