Skip to content

Commit 2c2ef4d

Browse files
Merge pull request #508 from gridaco/canary
Daily RC
2 parents 0b91c34 + ec61fdb commit 2c2ef4d

File tree

16 files changed

+581
-652
lines changed

16 files changed

+581
-652
lines changed

CONTRIBUTING.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,25 @@ corepack enable pnpm
1717
brew install just
1818
```
1919

20+
## Rust / Canvas (Skia) prerequisites
21+
22+
Some Rust crates (e.g. the canvas backend) build Skia via `skia-bindings`, which requires `ninja` to be available on your system.
23+
24+
**macOS**
25+
26+
```bash
27+
brew install ninja
28+
ninja --version
29+
```
30+
31+
**Ubuntu/Debian**
32+
33+
```bash
34+
sudo apt-get update
35+
sudo apt-get install -y ninja-build
36+
ninja --version
37+
```
38+
2039
Then, install the dependencies and run the development server:
2140

2241
```bash

crates/grida-canvas-wasm/justfile

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Grida Canvas WASM Build System
22
# Unified build system for all WASM build configurations
33

4+
# Shared snippet used by debug/release builds.
5+
# Keep this inline (vs. a separate recipe) so the sourced `emsdk_env.sh` affects the same shell.
6+
_wasm32_unknown_emscripten_env := "rustup target add wasm32-unknown-emscripten; (cd ../.. && ./bin/activate-emsdk); . ../../third_party/externals/emsdk/emsdk_env.sh; command -v emcc >/dev/null 2>&1; export CC=emcc CXX=em++ AR=emar"
7+
48
# Default recipe - shows available commands
59
default:
610
@echo "🚀 Grida Canvas WASM Build System"
@@ -81,10 +85,9 @@ info:
8185
# Internal recipe: Build WASM (debug mode)
8286
_build_wasm32_unknown_emscripten_debug:
8387
@echo "🔨 Building for wasm32-unknown-emscripten target..."
84-
@bash -c '. ../../third_party/externals/emsdk/emsdk_env.sh && \
85-
export CC=emcc && \
86-
export CXX=em++ && \
87-
export AR=emar && \
88+
@bash -c 'set -euo pipefail; \
89+
{{_wasm32_unknown_emscripten_env}}; \
90+
echo "🧰 $(emcc --version | { IFS= read -r l; echo "$l"; })"; \
8891
time cargo build --target wasm32-unknown-emscripten'
8992
@echo "✅ Build completed successfully!"
9093
@echo "📁 Output file: ../../target/wasm32-unknown-emscripten/debug/grida_canvas_wasm.wasm"
@@ -93,10 +96,9 @@ _build_wasm32_unknown_emscripten_debug:
9396
# Internal recipe: Build WASM (release mode)
9497
_build_wasm32_unknown_emscripten_release:
9598
@echo "🔨 Building for wasm32-unknown-emscripten target (Production Mode)..."
96-
@bash -c '. ../../third_party/externals/emsdk/emsdk_env.sh && \
97-
export CC=emcc && \
98-
export CXX=em++ && \
99-
export AR=emar && \
99+
@bash -c 'set -euo pipefail; \
100+
{{_wasm32_unknown_emscripten_env}}; \
101+
echo "🧰 $(emcc --version | { IFS= read -r l; echo "$l"; })"; \
100102
time cargo build --release --target wasm32-unknown-emscripten'
101103
@echo "✅ Production build completed successfully!"
102104
@echo "📁 Output file: ../../target/wasm32-unknown-emscripten/release/grida_canvas_wasm.wasm"

0 commit comments

Comments
 (0)