smacker / go-tree-sitter

Golang bindings for tree-sitter https://github.com/tree-sitter/tree-sitter
MIT License
444 stars 123 forks source link

build fail with error msg : undefined: Node #167

Open SunrhLeo opened 3 months ago

SunrhLeo commented 3 months ago

hi ,here is my env:

go version go1.22.5 linux/amd64

go env
  GO111MODULE='on'
  GOARCH='amd64'
  GOBIN=''
  GOCACHE='/home/runner/.cache/go-build'
  GOENV='/home/runner/.config/go/env'
  GOEXE=''
  GOEXPERIMENT=''
  GOFLAGS=''
  GOHOSTARCH='amd64'
  GOHOSTOS='linux'
  GOINSECURE=''
  GOMODCACHE='/home/runner/go/pkg/mod'
  GONOPROXY=''
  GONOSUMDB=''
  GOOS='linux'
  GOPATH='/home/runner/go'
  GOPRIVATE=''
  GOPROXY='https://proxy.golang.org,direct'
  GOROOT='/opt/hostedtoolcache/go/1.[22](https://github.com/xxx/actions/runs/10046156/job/27168771#step:3:23).5/x64'
  GOSUMDB='sum.golang.org'
  GOTMPDIR=''
  GOTOOLCHAIN='auto'
  GOTOOLDIR='/opt/hostedtoolcache/go/1.22.5/x64/pkg/tool/linux_amd64'
  GOVCS=''
  GOVERSION='go1.22.5'
  GCCGO='gccgo'
  GOAMD64='v1'
  AR='ar'
  CC='gcc'
  CXX='g++'
  CGO_ENABLED='1'
  GOMOD='/home/runner/work/xxx/go.mod'
  GOWORK=''
  CGO_CFLAGS='-O2 -g'
  CGO_CPPFLAGS=''
  CGO_CXXFLAGS='-O2 -g'
  CGO_FFLAGS='-O2 -g'
  CGO_LDFLAGS='-O2 -g'
  PKG_CONFIG='pkg-config'
  GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build649706[36](https://github.com/xxx/actions/runs/10046156/job/27168771#step:3:37)1=/tmp/go-build -gno-record-gcc-switches'

github workflow go.yml

name: ci

on: [push, pull_request]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      -
        name: Checkout
        uses: actions/checkout@v4
      -
        name: Set up Go
        uses: actions/setup-go@v5
        with:
          go-version: '1.22'
        env:
          GO111MODULE: 'on'
          CGO_ENABLED: '1'
      -
        name: Test Build
        run: make

the error below:

Run make
fatal: No names found, cannot describe anything.
go: downloading golang.org/x/exp v0.0.0-20230810033253-352e893a[4](https://github.com/xxx/actions/runs/10046156/job/27168771#step:4:5)cad
go: downloading github.com/pkg/errors v0.9.1
go: downloading gopkg.in/yaml.v3 v3.0.1
go: downloading github.com/creack/pty v1.1.17
go: downloading github.com/dao42/go-dap v0.6.9-0.20231121110032-ff7acb037ff3
go: downloading github.com/deckarep/golang-set/v2 v2.3.0
go: downloading github.com/oawu/Golang-cli-xterm v0.0.10
go: downloading golang.org/x/time v0.0.0-20220922220347-f3bd1da661af
go: downloading github.com/sashabaranov/go-openai v1.26.3
go: downloading github.com/fsnotify/fsnotify v1.6.0
go: downloading github.com/karrick/godirwalk v1.17.0
go: downloading github.com/a-wing/lightcable v0.1.0
go: downloading github.com/google/uuid v1.3.0
go: downloading github.com/sourcegraph/go-lsp v0.0.0-20181009131[5](https://github.com/xxx/runs/10046156/job/27168771#step:4:6)10-4631ffd93a18
go: downloading github.com/sourcegraph/jsonrpc2 v0.1.0
go: downloading github.com/rabbitmq/amqp091-go v1.3.0
go: downloading github.com/golang-infrastructure/go-cosine-similarity v0.0.0-2022120515545[6](https://github.com/xxx/actions/runs/10088046156/job/27168771#step:4:7)-73f48d3288b0
go: downloading golang.org/x/tools v0.2.0
go: downloading golang.org/x/sys v0.1.0
go: downloading github.com/gorilla/websocket v1.4.2
go: downloading github.com/dlclark/regexp2 v1.9.0
go: downloading github.com/golang-infrastructure/go-gtypes v0.0.1
go: downloading github.com/tjfoc/gmsm v1.4.1
go: downloading github.com/smacker/go-tree-sitter v0.0.0-2024062505015[7](https://github.com//actions/runs/10046156/job/27168771#step:4:8)-a31a98a7c0f6
github.com/smacker/go-tree-sitter/bash: build constraints exclude all Go files in /home/runner/go/pkg/mod/github.com/smacker/go-tree-sitter@v0.0.0-20240625050157-a31a9[8](https://github.com/xxx/actions/runs/10046156/job/27168771#step:4:9)a7c0f6/bash
github.com/smacker/go-tree-sitter/c: build constraints exclude all Go files in /home/runner/go/pkg/mod/github.com/smacker/go-tree-sitter@v0.0.0-20240625050157-a31a[9](https://github.com/xxx/actions/runs/10046156/job/27168771#step:4:10)8a7c0f6/c
github.com/smacker/go-tree-sitter/cpp: build constraints exclude all Go files in /home/runner/go/pkg/mod/github.com/smacker/go-tree-sitter@v0.0.0-20240625050157-a31a98a7c0f6/cpp
github.com/smacker/go-tree-sitter/csharp: build constraints exclude all Go files in /home/runner/go/pkg/mod/github.com/smacker/go-tree-sitter@v0.0.0-20240625050157-a31a98a7c0f6/csharp
github.com/smacker/go-tree-sitter/css: build constraints exclude all Go files in /home/runner/go/pkg/mod/github.com/smacker/go-tree-sitter@v0.0.0-20240625050[15](https://github.com/xxx/actions/runs/10046156/job/27168771#step:4:16)7-a31a98a7c0f6/css
github.com/smacker/go-tree-sitter/cue: build constraints exclude all Go files in /home/runner/go/pkg/mod/github.com/smacker/go-tree-sitter@v0.0.0-20240625050157-a31a98a7c0f6/cue
github.com/smacker/go-tree-sitter/dockerfile: build constraints exclude all Go files in /home/runner/go/pkg/mod/github.com/smacker/go-tree-sitter@v0.0.0-20240625050157-a31a98a7c0f6/dockerfile
github.com/smacker/go-tree-sitter/elixir: build constraints exclude all Go files in /home/runner/go/pkg/mod/github.com/smacker/go-tree-sitter@v0.0.0-20240625050157-a31a98a7c0f6/elixir
github.com/smacker/go-tree-sitter/elm: build constraints exclude all Go files in /home/runner/go/pkg/mod/github.com/smacker/go-tree-sitter@v0.0.0-20240625050157-a31a98a7c0f6/elm
github.com/smacker/go-tree-sitter/golang: build constraints exclude all Go files in /home/runner/go/pkg/mod/github.com/smacker/go-tree-sitter@v0.0.0-20240625050157-a31a98a7c0f6/golang
github.com/smacker/go-tree-sitter/groovy: build constraints exclude all Go files in /home/runner/go/pkg/mod/github.com/smacker/go-tree-sitter@v0.0.0-20240625050157-a31a98a7c0f6/groovy
github.com/smacker/go-tree-sitter/hcl: build constraints exclude all Go files in /home/runner/go/pkg/mod/github.com/smacker/go-tree-sitter@v0.0.0-20240625050157-a31a98a7c0f6/hcl
github.com/smacker/go-tree-sitter/html: build constraints exclude all Go files in /home/runner/go/pkg/mod/github.com/smacker/go-tree-sitter@v0.0.0-20240625050157-a31a98a7c0f6/html
github.com/smacker/go-tree-sitter/java: build constraints exclude all Go files in /home/runner/go/pkg/mod/github.com/smacker/go-tree-sitter@v0.0.0-20240625050157-a31a98a7c0f6/java
github.com/smacker/go-tree-sitter/javascript: build constraints exclude all Go files in /home/runner/go/pkg/mod/github.com/smacker/go-tree-sitter@v0.0.0-20240625050157-a31a98a7c0f6/javascript
github.com/smacker/go-tree-sitter/kotlin: build constraints exclude all Go files in /home/runner/go/pkg/mod/github.com/smacker/go-tree-sitter@v0.0.0-20240625050157-a31a98a7c0f6/kotlin
github.com/smacker/go-tree-sitter/markdown/tree-sitter-markdown: build constraints exclude all Go files in /home/runner/go/pkg/mod/github.com/smacker/go-tree-sitter@v0.0.0-20240625050157-a31a98a7c0f6/markdown/tree-sitter-markdown
github.com/smacker/go-tree-sitter/php: build constraints exclude all Go files in /home/runner/go/pkg/mod/github.com/smacker/go-tree-sitter@v0.0.0-20240625050157-a31a98a7c0f6/php
github.com/smacker/go-tree-sitter/protobuf: build constraints exclude all Go files in /home/runner/go/pkg/mod/github.com/smacker/go-tree-sitter@v0.0.0-20240625050157-a31a98a7c0f6/protobuf
github.com/smacker/go-tree-sitter/python: build constraints exclude all Go files in /home/runner/go/pkg/mod/github.com/smacker/go-tree-sitter@v0.0.0-20240625050157-a31a98a7c0f6/python
github.com/smacker/go-tree-sitter/ruby: build constraints exclude all Go files in /home/runner/go/pkg/mod/github.com/smacker/go-tree-sitter@v0.0.0-20240625050157-a31a98a7c0f6/ruby
github.com/smacker/go-tree-sitter/rust: build constraints exclude all Go files in /home/runner/go/pkg/mod/github.com/smacker/go-tree-sitter@v0.0.0-20240625050157-a31a98a7c0f6/rust
github.com/smacker/go-tree-sitter/scala: build constraints exclude all Go files in /home/runner/go/pkg/mod/github.com/smacker/go-tree-sitter@v0.0.0-20240625050157-a31a98a7c0f6/scala
github.com/smacker/go-tree-sitter/sql: build constraints exclude all Go files in /home/runner/go/pkg/mod/github.com/smacker/go-tree-sitter@v0.0.0-20240625050157-a31a98a7c0f6/sql
github.com/smacker/go-tree-sitter/svelte: build constraints exclude all Go files in /home/runner/go/pkg/mod/github.com/smacker/go-tree-sitter@v0.0.0-20240625050157-a31a98a7c0f6/svelte
github.com/smacker/go-tree-sitter/swift: build constraints exclude all Go files in /home/runner/go/pkg/mod/github.com/smacker/go-tree-sitter@v0.0.0-20240625050157-a31a98a7c0f6/swift
github.com/smacker/go-tree-sitter/toml: build constraints exclude all Go files in /home/runner/go/pkg/mod/github.com/smacker/go-tree-sitter@v0.0.0-20240625050157-a31a98a7c0f6/toml
github.com/smacker/go-tree-sitter/typescript/typescript: build constraints exclude all Go files in /home/runner/go/pkg/mod/github.com/smacker/go-tree-sitter@v0.0.0-20240625050157-a31a98a7c0f6/typescript/typescript
github.com/smacker/go-tree-sitter/yaml: build constraints exclude all Go files in /home/runner/go/pkg/mod/github.com/smacker/go-tree-sitter@v0.0.0-20240625050157-a31a98a7c0f6/yaml
# github.com/smacker/go-tree-sitter
Error: ../../../go/pkg/mod/github.com/smacker/go-tree-sitter@v0.0.0-20240625050157-a31a98a7c0f6/iter.go:[17](https://github.com/xxxactions/runs/10046156/job/27168771#step:4:18):18: undefined: Node
Error: ../../../go/pkg/mod/github.com/smacker/go-tree-sitter@v0.0.0-20240625050157-a31a98a7c0f6/iter.go:21:21: undefined: Node
Error: ../../../go/pkg/mod/github.com/smacker/go-tree-sitter@v0.0.0-20240625050157-a31a98a7c0f6/iter.go:25:20: undefined: Node
Error: ../../../go/pkg/mod/github.com/smacker/go-tree-sitter@v0.0.0-20240625050157-a31a98a7c0f6/iter.go:30:26: undefined: Node
Error: ../../../go/pkg/mod/github.com/smacker/go-tree-sitter@v0.0.0-20240625050157-a31a98a7c0f6/iter.go:34:20: undefined: Node
Error: ../../../go/pkg/mod/github.com/smacker/go-tree-sitter@v0.0.0-20240625050157-a31a98a7c0f6/iter.go:38:32: undefined: Node
Error: ../../../go/pkg/mod/github.com/smacker/go-tree-sitter@v0.0.0-20240625050157-a31a98a7c0f6/iter.go:43:9: undefined: Node
Error: ../../../go/pkg/mod/github.com/smacker/go-tree-sitter@v0.0.0-20240625050157-a31a98a7c0f6/iter.go:46:[18](https://github.com/xxx/actions/runs/10046156/job/27168771#step:4:19): undefined: Node
Error: ../../../go/pkg/mod/github.com/smacker/go-tree-sitter@v0.0.0-20240625050157-a31a98a7c0f6/iter.go:68:40: undefined: Node
make: *** [Makefile:29: build] Error 1
Error: Process completed with exit code 2.

is anyone has same problem and how to fix this, thanks

KulikovaDarya commented 3 months ago

Same problem

Termina1 commented 3 months ago

Same for me, but only when building for amd64, when building for OS X everything works fine

fantzorro commented 1 month ago

Same problem