Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FreeBSD Support #155

Open
ItsNilDev opened this issue Jan 3, 2023 · 4 comments
Open

FreeBSD Support #155

ItsNilDev opened this issue Jan 3, 2023 · 4 comments

Comments

@ItsNilDev
Copy link

ItsNilDev commented Jan 3, 2023

Is there anyway to make tree-sitter work with FreeBSD?
The package itself is ported in the FreeBSD repository, but can't make emacs work it.
I get the unsupported system-type error that's raised by

(defconst tree-sitter-langs--os
  (pcase system-type
    ('darwin "macos")
    ('gnu/linux "linux")
    ('windows-nt "windows")
    (_ (error "Unsupported system-type %s" system-type))))

in the tree-sitter-langs-build.el

@0x6d6e647a
Copy link
Contributor

Seems to be mostly fixed by #95.

In my experimentation everything works except the node based grammars that try to fetch tree-sitter via npm. If they published FreeBSD binaries it would all be seamless. For what it's worth, tree-sitter builds and works fine on FreeBSD.

In additional, the same applies to NetBSD and OpenBSD as well.

@0x6d6e647a
Copy link
Contributor

Note the target needs to be set to x86_64-unknown-netbsd and x86_64-unknown-openbsd respectively for the other two BSDs to work. I'm accomplishing that with a call to uname to determine which BSD is being used.

@jcs090218
Copy link
Member

#95 is now merged. Can you test to see if it works? 🤔

@0x6d6e647a
Copy link
Contributor

I test using the following configuration:

  • The latest mater of tree-sitter-langs (a7b51c9)
  • FreeBSD v14.0
  • Emacs 29.3 (from FreeBSD pkg)
  • Rust v1.78.0 (from rustup)
  • Node v20.12.2 (from FreeBSD pkg)
  • tree-sitter v0.19.5 (build from source)

The following language grammars built with no issues.

  • ada
  • agda
  • asm
  • bash
  • beancount
  • bibtex
  • c
  • c-sharp
  • clojure
  • cmake
  • css
  • csv
  • d
  • dart
  • dockerfile
  • elisp
  • elixir
  • elm
  • erlang
  • fennel
  • fish
  • fluent
  • fortran
  • gdscript
  • git-rebase
  • gitattributes
  • gitcommit
  • gitignore
  • gleam
  • groovy
  • haskell
  • hcl
  • heex
  • html
  • jai
  • janet-simple
  • java
  • javascript
  • jsdoc
  • json
  • jsonnet
  • julia
  • kotlin
  • latex
  • lua
  • make
  • markdown
  • ocaml
  • ocaml-interface
  • xml

The following language grammars failed to build because they are marked to not build on FreeBSD. Please note in my private testing if the node build configuration is changed to allow FreeBSD or OpenBSD they build and work with no issue. At some point when I have tested these on FreeBSD, NetBSD, and OpenBSD I'll submit pull requests to them to resolve this issue and link to these issues and pull requests to a relevant open bug here for tracking. I plan on adding support eventually for those three major BSD operating systems.

  • arduino
  • astro
  • commonlisp
  • cpp
  • glsl
  • go
  • hlsl

The following throw errors during build. I have manually fixed some of these privately but they will not work out of the box. The problem is usually some fringe test case that makes Linux assumptions that don't work on BSD operating systems.

  • matlab
  • mermaid
  • meson
  • nix
  • noir
  • org
  • pascal
  • perl
  • pgn
  • php
  • prisma
  • r
  • rst
  • ruby
  • rust
  • scala
  • scheme
  • smithy
  • solidity
  • sql
  • swift
  • tcl
  • toml
  • twig
  • typescript
  • typst
  • verilog
  • vhdl
  • yaml
  • zig

The following appear in the repos directory but are not invoked by scripts/compile all.

  • actionscript
  • comment
  • doxygen
  • haxe
  • llvm
  • llvm-mir
  • magik
  • markdown-inline
  • ninja
  • purescript
  • python
  • racket
  • svelte
  • tablegen

I plan to make pull requests in the future to add OpenBSD and NetBSD support which will change some things from #95. Otherwise there isn't much to fix on tree-sitter-langs since the problems with BSD operating systems are mostly due to issues in the grammars.

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

No branches or pull requests

3 participants