Skip to content

Fix tree-sitter-typescript grammar not building on macOS

Stan Hu requested to merge sh-use-platform-prefix into main

If you ran scripts/build-tree-sitter-lib.py locally and then attempted to build a Docker container for linux/arm64, the tree-sitter-typescript grammar would fail to build because the existing node_modules directory would contain a macOS binary, which cannot be run on a Linux platform.

To avoid these platform-dependent issues, just add a platform prefix to scripts/vendor. For example, on my machine, I get:

  • scripts/vendor/macOS-13.4.1-arm64-arm-64bit for the host
  • scripts/vendor/Linux-5.15.49-linuxkit-pr-aarch64-with-glibc2.31 for Docker builds

Closes #208 (closed)

Edited by Stan Hu

Merge request reports