Skip to content

Commit 5062e34

Browse files
committed
ci(migration-assistant): fix smoke-parse invocation for tree-sitter-cli 0.25
The `--paths` flag was repurposed in tree-sitter-cli >= 0.25 to point at a *file* listing input source paths, not a directory containing the grammar. Under the resolved 0.25.10, the step fails with `Failed to read paths file ... Is a directory (os error 21)`. Run the parser from within the vendored grammar tree instead, which is the documented 0.25.x lookup mechanism. https://claude.ai/code/session_01HZ3i2wX5R5rbY8Ycmug4Ao
1 parent f45afa1 commit 5062e34

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

.github/workflows/ci.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -183,16 +183,22 @@ jobs:
183183
# ReScript source. Picks the existing res-to-affine test fixture
184184
# so any drift in the pinned commit's syntactic surface area
185185
# surfaces here rather than at walker-rule writing time.
186+
#
187+
# NOTE: tree-sitter-cli >= 0.25 repurposed `--paths` to mean "a
188+
# file listing input source paths", not "a directory containing
189+
# a grammar". Grammar lookup is now driven by the current
190+
# working directory (the CLI walks up looking for grammar.js /
191+
# src/parser.c), so we cd into the vendored grammar tree and
192+
# pass an absolute path to the fixture. Without this, the step
193+
# fails with `Failed to read paths file ... Is a directory`.
186194
run: |
187195
shopt -s nullglob
188196
fixtures=(tools/res-to-affine/test/fixtures/*.res)
189197
if [ ${#fixtures[@]} -eq 0 ]; then
190198
echo "no .res fixtures to smoke-parse; skipping"
191199
exit 0
192200
fi
193-
tree-sitter parse \
194-
--quiet \
195-
"${fixtures[0]}" \
196-
--paths tools/vendor/tree-sitter-rescript \
197-
> /dev/null
201+
fixture_abs="$(realpath "${fixtures[0]}")"
202+
( cd tools/vendor/tree-sitter-rescript \
203+
&& tree-sitter parse --quiet "${fixture_abs}" > /dev/null )
198204
echo "smoke-parsed: ${fixtures[0]}"

0 commit comments

Comments
 (0)