Skip to content

Commit 751ffd2

Browse files
committed
Use new emscripten when building with docker
1 parent b118e7d commit 751ffd2

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

cli/src/wasm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ pub fn compile_language_to_wasm(language_dir: &Path, force_docker: bool) -> Resu
5757
}
5858

5959
// Run `emcc` in a container using the `emscripten-slim` image
60-
command.args(&["trzeci/emscripten-slim", "emcc"]);
60+
command.args(&["emscripten/emsdk", "emcc"]);
6161
} else {
6262
return Error::err(
6363
"You must have either emcc or docker on your PATH to run this command".to_string(),

script/build-wasm

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ emcc=
6464
if which emcc > /dev/null && [[ "$force_docker" == "0" ]]; then
6565
emcc=emcc
6666
elif which docker > /dev/null; then
67-
emcc="docker run \
68-
--rm \
69-
-v $(pwd):/src:Z \
70-
-u $(id -u) \
71-
trzeci/emscripten-slim \
67+
emcc="docker run \
68+
--rm \
69+
-v $(pwd):/src:Z \
70+
-u $(id -u) \
71+
emscripten/emsdk \
7272
emcc"
7373
else
7474
echo 'You must have either `docker` or `emcc` on your PATH to run this script'

script/generate-fixtures-wasm

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ set -e
44

55
cargo build --release
66

7+
build_wasm_args=
8+
if [[ $1 == "--docker" ]]; then
9+
build_wasm_args="--docker"
10+
shift
11+
fi
12+
713
filter_grammar_name=$1
814

915
root_dir=$PWD
@@ -20,7 +26,7 @@ while read -r grammar_file; do
2026
fi
2127

2228
echo "Compiling ${grammar_name} parser to wasm"
23-
"$tree_sitter" build-wasm $grammar_dir
29+
"$tree_sitter" build-wasm $build_wasm_args $grammar_dir
2430
done <<< "$grammar_files"
2531

2632
mv tree-sitter-*.wasm target/release/

0 commit comments

Comments
 (0)