Skip to content

fix(portable): bundle tree-sitter grammars next to the exe and load them from there - #110

Merged
spelech merged 1 commit into
mainfrom
fix/portable-bundled-grammars
Nov 11, 2026
Merged

spelech merged 1 commit into
mainfrom
fix/portable-bundled-grammars

Conversation

@spelech

@spelech spelech commented Nov 11, 2026

Copy link
Copy Markdown
Owner

Summary

Pre-fetches and bundles Tree-sitter grammar DLLs directly inside <bundle>/grammars so the Windows x64 portable bundle operates offline and avoids Endpoint Protection (Carbon Black) blocking DLL loads from %LOCALAPPDATA%\tree-sitter-language-pack:

  1. Build-Time Grammar Pre-Fetch (scripts/build_portable_windows.ps1): Pre-fetches all 20 grammars in EXTENSION_TO_LANGUAGE into <bundle>/grammars using the build Python environment and verifies each parser loads via get_parser().
  2. Frozen Bundle Cache Path (main.py): Defaults TREE_SITTER_LANGUAGE_PACK_CACHE_DIR to <exe_dir>/grammars when running frozen (os.environ.setdefault, preserving any explicit override in .env).
  3. CI Artifact Verification (build-portable-windows.yml): Verifies tree_sitter_python.dll is present under /grammars before running the runtime smoke test and zipping.
  4. Configuration & Documentation (scripts/portable/.env.example, docs/guide/getting-started.md): Documents TREE_SITTER_LANGUAGE_PACK_CACHE_DIR, Windows Mark-of-the-Web Unblock-File instructions under RemoteSigned Group Policy, and Endpoint Protection guidance.

@spelech
spelech merged commit a352cde into main Nov 11, 2026
16 checks passed
@spelech
spelech deleted the fix/portable-bundled-grammars branch November 11, 2026 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant