* chore(vendor): update tree-sitter-kotlin to 0.4.0-gd6af96d * fix(kotlin): enable C11 Windows builds MSVS ignores cflags_c, leaving _Static_assert in legacy C mode. Assert parser behavior so stale prebuilds fail the vendor update. Refs #3801 * fix(kotlin): scope MSVC standards by language Use MSBuild language properties and remove Node headers raw C++20 flag. Preserve inherited C++ exception handling while compiling scanner C as C11. * chore(vendor): rebuild native prebuilds (tree-sitter-kotlin) Built by https://github.com/abhigyanpatwari/GitNexus/actions/runs/41414632633 * chore(vendor): rebuild native prebuilds (tree-sitter-kotlin) Built by https://github.com/abhigyanpatwari/GitNexus/actions/runs/41418217222 * chore(vendor): rebuild native prebuilds (tree-sitter-kotlin) Built by https://github.com/abhigyanpatwari/GitNexus/actions/runs/41433953854 --------- Co-authored-by: gitnexus-release-bot[bot] <gitnexus-release-bot[bot]@users.noreply.github.com> Co-authored-by: Gergo Magyar <gergomagyar0@gmail.com> Co-authored-by: Gergő Magyar <gergomagyar@icloud.com> |
||
|---|---|---|
| .. | ||
| bindings/node | ||
| prebuilds | ||
| src | ||
| binding.gyp | ||
| LICENSE | ||
| package.json | ||
| README.md | ||
GitNexus vendor notice
This directory is a GitNexus-managed minimal runtime package derived from
tree-sitter-kotlin (fwcd), pinned to the unreleased main commit
d6af96d2
(package.json version 0.4.0-gd6af96d). It is pinned to main rather than
a tagged release because the latest release, 0.3.8 (tagged 2024-08-03),
predates fun interface (functional/SAM interface) support: it parsed
fun interface Foo as an ERROR node and dropped the declaration. That fix
landed in PR #169
(closing issue #87),
merged into main 2025-04-25 but not yet in any npm release.
It carries bindings/node/, LICENSE, the native prebuilds/, and the full C
source — src/parser.c, src/scanner.c, src/node-types.json,
src/tree_sitter/, and binding.gyp. The source IS vendored (despite the
~33 MB generated parser.c) for two reasons: it lets build-tree-sitter-grammars.cjs
source-build the binding on a toolchain host when no prebuild matches, and —
because the pinned commit is unreleased on npm — it is the source the prebuild
workflow itself compiles from (see below).
Why this is vendored (unlike the npm grammars)
Upstream tree-sitter-kotlin ships source only — its npm tarball has no
prebuilds/ — so a plain npm install compiles the native binding from source
and requires a C/C++ toolchain (python3/make/g++). To make Kotlin parsing
toolchain-free on every host (Swift parity), GitNexus builds the platform
prebuilds itself and vendors them here. node-gyp-build selects the correct
binary at require time; build-tree-sitter-grammars.cjs activates the binding
(prefer prebuild, else source-build) at install time.
tree-sitter-swift is handled the same way: its source is vendored and its
prebuilds are GitNexus-cross-built from that vendored source. Kotlin now
uses this exact path too (workflow registry kind: 'vendored', switched from
'npm' when this pin moved to an unreleased commit), so all of
Dart/Proto/Swift/Kotlin go through one uniform kind: 'vendored' build.
Updating this vendor package
- Bump the pin: update
versioninpackage.json(this is the value thebuild-tree-sitter-prebuildsworkflow diffs to decide whether to rebuild) and refresh_vendoredBywith the new ref. - Refresh
bindings/node/binding.cc,src/parser.c,src/scanner.c,src/node-types.json, andsrc/tree_sitter/*from the new upstream ref (a release tag, or — as now — a pinnedmaincommit). For a pinned commit the generatedparser.cis committed upstream, so copy it directly; if you re-pin to a ref that does not commitparser.c, regenerate it withtree-sitter generatefirst. Preserve the GitNexus CommonJS loader andbinding.gyp: its MSVC settings enable C11 for the scanner's static assertions on Windows (cflags_calone does not reach MSBuild). - Regenerate the six native prebuilds by running the
build-tree-sitter-prebuildsGitHub Actions workflow (it builds{linux,darwin,win32}-{x64,arm64}from this vendored source and opens a PR committing them underprebuilds/). Whilekind: 'vendored', the workflow does NOT touch npm for kotlin. - Verify the packed GitNexus tarball can
require('tree-sitter-kotlin')and parse a Kotlin snippet (including afun interface) on each target platform-arch (the workflow's validate step does this in CI).
Note:
darwin-x64prebuilds depend on GitHub'smacos-15-intelimage, whose x86_64 macOS runners sunset ~Aug 2027. After that, darwin-x64 needs cross-compilation or dropping.