Files
clide/app/native/linux-x64/BUILD.md
T
jpmschweitzerandClaude ce8529e424 add tree-sitter syntax highlighting via dart:ffi
Vendor libtree-sitter.so (v0.26.8, wasmtime 44.0 statically linked)
and call its C API through dart:ffi. Grammar WASM files are loaded by
tree-sitter's embedded wasmtime engine via ts_wasm_store_load_language.

48 grammars compiled with tree-sitter build --wasm, 48 highlight
queries (42 from upstream repos, 6 written in-house for comment,
erlang, gdscript, gitignore, hcl, hlsl, swift). SQLite grammar
replaces full SQL (974K-line parser exhausted RAM at compile time).

Removes wasm_run and wasm_run_flutter — they downloaded a 22 MB
binary from GitHub at first launch, violating the no-network-on-
default-launch-path policy.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-04-22 22:08:00 +02:00

50 lines
1.4 KiB
Markdown

# libtree-sitter.so — vendored build record
## Status: PROVISIONAL — built locally, not yet CI
Built on contributor machine. CI-based reproducible build required before release.
## Source
- **Repository**: https://github.com/tree-sitter/tree-sitter
- **Version**: 0.26.8 (tag v0.26.8)
- **Commit**: cd5b087cd9f45ca6d93ab1954f6b7c8534f324d2
- **Clone**: `/var/mnt/data/projects/treesitter/tree-sitter/`
## Build command
```bash
cmake -B build \
-DTREE_SITTER_FEATURE_WASM=ON \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INCLUDE_PATH=/home/linuxbrew/.linuxbrew/include \
-DWASMTIME_LIBRARY=/home/linuxbrew/.linuxbrew/lib/libwasmtime.a
cmake --build build -j$(nproc)
```
## Dependencies (statically linked)
- **wasmtime 44.0.0** — Apache-2.0 with LLVM exception
- Source: Bytecode Alliance, installed via Homebrew
- Linked statically (`libwasmtime.a`) so we ship one `.so`
## Toolchain
- **Compiler**: GCC 15.2.1 (Fedora 43)
- **Target**: x86_64-linux-gnu
- **CMake**: system
## Binary details
- **Size**: ~24 MB
- **Exports**: `ts_wasm_store_new`, `ts_wasm_store_delete`, `ts_wasm_store_load_language`, `ts_wasm_store_language_count`, plus full tree-sitter C API
## TODO before release
- [ ] Build in CI from pinned source SHA
- [ ] Record SHA-256 of output
- [ ] Cross-compile for macOS (aarch64, x86_64)
- [ ] Cross-compile for Windows (x86_64)
- [ ] Vendor wasmtime NOTICE file per POLICY.md Apache-2.0 rules