diff --git a/.github/workflows/codelens-benchmark.yml b/.github/workflows/codelens-benchmark.yml index 3b1c3a4..40f9a17 100644 --- a/.github/workflows/codelens-benchmark.yml +++ b/.github/workflows/codelens-benchmark.yml @@ -15,7 +15,7 @@ jobs: with: python-version: '3.12' - name: Install dependencies - run: pip install pyyaml tree-sitter pytest + run: pip install pyyaml "tree-sitter>=0.21.0,<0.26" pytest - name: Run full benchmarks run: python3 benchmarks/run_benchmarks.py - name: Check regression diff --git a/.github/workflows/codelens-ci.yml b/.github/workflows/codelens-ci.yml index 81ea5e7..5cffd26 100644 --- a/.github/workflows/codelens-ci.yml +++ b/.github/workflows/codelens-ci.yml @@ -33,16 +33,17 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install tree-sitter pyyaml pytest pytest-cov pygls lsprotocol + # tree-sitter pinned <0.26: core 0.26.0 changed Node lifetime handling + # and causes a native use-after-free SIGSEGV in tree_sitter_python._binding + # even on shallow files (issue #235). python_parser.py's keep_alive + # mitigation is insufficient for 0.26; 0.25.x is known-safe. + pip install "tree-sitter>=0.21.0,<0.26" pyyaml pytest pytest-cov pygls lsprotocol # Install optional grammar packages for full parser coverage pip install tree-sitter-python tree-sitter-javascript tree-sitter-html tree-sitter-css || true pip install tree-sitter-typescript tree-sitter-rust || true - name: Run test suite run: | - # ulimit -s unlimited prevents SIGSEGV from tree-sitter's internal C - # recursion on deeply-nested ASTs (issue #235, test_large_file_parsing.py) - ulimit -s unlimited cd scripts && python -m pytest ../tests/ -v --tb=short \ --ignore=../tests/test_integration.py @@ -68,7 +69,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install tree-sitter pyyaml + pip install "tree-sitter>=0.21.0,<0.26" pyyaml pip install tree-sitter-python tree-sitter-javascript tree-sitter-html tree-sitter-css || true pip install tree-sitter-typescript tree-sitter-rust || true @@ -98,7 +99,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install tree-sitter pyyaml + pip install "tree-sitter>=0.21.0,<0.26" pyyaml pip install tree-sitter-python tree-sitter-javascript tree-sitter-html tree-sitter-css || true pip install tree-sitter-typescript tree-sitter-rust || true diff --git a/.github/workflows/codelens-sarif.yml b/.github/workflows/codelens-sarif.yml index 9eba6c0..cb6103c 100644 --- a/.github/workflows/codelens-sarif.yml +++ b/.github/workflows/codelens-sarif.yml @@ -33,7 +33,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install tree-sitter pyyaml + pip install "tree-sitter>=0.21.0,<0.26" pyyaml pip install tree-sitter-python tree-sitter-javascript tree-sitter-html tree-sitter-css || true pip install tree-sitter-typescript tree-sitter-rust || true diff --git a/pyproject.toml b/pyproject.toml index 5805a2b..75021ae 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,7 +39,11 @@ classifiers = [ ] dependencies = [ - "tree-sitter>=0.21.0", + # Upper-bound <0.26: tree-sitter core 0.26.0 changed Node lifetime handling, + # causing a native use-after-free SIGSEGV in the grammar bindings even on + # shallow files (issue #235). Remove the cap once python_parser.py's + # keep_alive strategy is made 0.26-safe. + "tree-sitter>=0.21.0,<0.26", ] [project.optional-dependencies]