Skip to content

Commit

Permalink
Unpin tree-sitter-bash
Browse files Browse the repository at this point in the history
There is some (unknown) problem with building the rev of
tree-sitter-bash that we want; so we unpin it so we can actually
proceed. (Thanks to @ErinvanderVeen for debugging help 🙏)

* Unpinned tree-sitter-bash and updated Cargo.lock
* Updated flake.lock
* Updated update-wasm-grammars.sh to include tree-sitter-bash
* Rebuild Tree-sitter WASM grammars

NOTE The Bash formatting queries will fail to work with this rev of
tree-sitter-bash... That's fine for the purpose of trying to reproduce
the error which this branch is meant for, but it shouldn't be merged
into main without reverting those changes.
  • Loading branch information
Xophmeister committed Jan 30, 2024
1 parent 7b6a3f1 commit f13ff39
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 37 deletions.
34 changes: 17 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ tokio = "1.32"
tokio-test = "0.4"
toml = "0.8"
tree-sitter = "0.20"
tree-sitter-bash = { git = "https://github.com/tree-sitter/tree-sitter-bash", rev = "1b0321ee85701d5036c334a6f04761cdc672e64c" }
tree-sitter-bash = { git = "https://github.com/tree-sitter/tree-sitter-bash" }
tree-sitter-json = { git = "https://github.com/tree-sitter/tree-sitter-json.git" }
tree-sitter-nickel = { git = "https://github.com/nickel-lang/tree-sitter-nickel", rev = "091b5dcc7d138901bcc162da9409c0bb626c0d27" }
tree-sitter-ocaml = { git = "https://github.com/tree-sitter/tree-sitter-ocaml.git" }
Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ ENV PATH="/root/.nix-profile/bin:${PATH}"
WORKDIR /topiary

RUN git clone https://github.com/tweag/topiary.git /topiary \
&& git checkout chris/playground/fix-frontend-test \
&& nix build .#topiary-playground \
&& mkdir -p web-playground/src/wasm-app web-playground/src/samples \
&& cp -r result/* web-playground/src/wasm-app \
Expand Down
36 changes: 18 additions & 18 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 13 additions & 1 deletion update-wasm-grammars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,18 @@ ocamllex() {
echo -e "${GREEN}Ocamllex: Done${NC}"
}

bash() {
echo -e "${BLUE}Bash: Fetching${NC}"
git clone --depth=1 https://github.com/tree-sitter/tree-sitter-bash.git "${WORKDIR}/tree-sitter-bash" &> /dev/null
REV=$(ref_for_language "bash")
pushd "${WORKDIR}/tree-sitter-bash" &> /dev/null
git checkout "$REV" &> /dev/null
popd &> /dev/null
echo -e "${ORANGE}Bash: Building${NC}"
tree-sitter build-wasm "${WORKDIR}/tree-sitter-bash"
echo -e "${GREEN}Bash: Done${NC}"
}

rust() {
echo -e "${BLUE}Rust: Fetching${NC}"
git clone --depth=1 https://github.com/tree-sitter/tree-sitter-rust.git "${WORKDIR}/tree-sitter-rust" &> /dev/null
Expand Down Expand Up @@ -112,6 +124,6 @@ tree-sitter-query() {
echo -e "${GREEN}Query: Done${NC}"
}

(trap 'kill 0' SIGINT; json & nickel & ocaml & ocamllex & rust & toml & tree-sitter-query & wait)
(trap 'kill 0' SIGINT; json & nickel & ocaml & ocamllex & bash & rust & toml & tree-sitter-query & wait)

echo -e "${GREEN}Done! All grammars have been updated${NC}"
Binary file modified web-playground/public/scripts/tree-sitter-bash.wasm
Binary file not shown.
Binary file modified web-playground/public/scripts/tree-sitter-json.wasm
Binary file not shown.
Binary file modified web-playground/public/scripts/tree-sitter-query.wasm
Binary file not shown.
Binary file modified web-playground/public/scripts/tree-sitter-rust.wasm
Binary file not shown.

0 comments on commit f13ff39

Please sign in to comment.