Skip to content

Commit e8f00fd

Browse files
ci(migration-assistant): fix smoke-parse for tree-sitter-cli 0.25 (#342)
## Summary - `migration-assistant` has been failing on `main` and every PR (incl. docs-only #333, #336) at the "Smoke-parse a sample .res file" step with `Failed to read paths file tools/vendor/tree-sitter-rescript / Caused by: Is a directory (os error 21)`. - Root cause: tree-sitter-cli >= 0.25 repurposed `--paths` to mean "a file listing input source paths", not "a directory containing the grammar". The `^0.25.0` range in `editors/tree-sitter-rescript/package.json` resolves to 0.25.10, where the flag's strict file requirement breaks the invocation introduced in #321. - Fix: cd into the vendored grammar tree (the documented 0.25.x grammar-lookup mechanism) and pass an absolute path to the fixture. Drops the misused `--paths` flag entirely. The pinned grammar commit `990214a` is unchanged, the install script is unchanged, and the failure is not diff-induced. ## Test plan - [x] Reproduced the failure locally with tree-sitter-cli 0.25.10 + the pinned grammar commit. - [x] Verified the new invocation exits 0 on the existing `tools/res-to-affine/test/fixtures/sample.res` fixture. - [ ] CI run on this PR turns the `migration-assistant` job green. Strict scope per request: only `.github/workflows/ci.yml` migration-assistant block touched. No changes to `editors/tree-sitter-rescript/` or `tools/res-to-affine/vendor/` were required. https://claude.ai/code/session_01HZ3i2wX5R5rbY8Ycmug4Ao --- _Generated by [Claude Code](https://claude.ai/code/session_01HZ3i2wX5R5rbY8Ycmug4Ao)_ Co-authored-by: Claude <noreply@anthropic.com>
1 parent 4114947 commit e8f00fd

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)