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

Build with tree-sitter as a dependency fails, but works in Docker container #4721

Closed
kohlerm opened this issue Dec 9, 2023 · 3 comments
Closed
Labels
stale marks stale issues and pull requests

Comments

@kohlerm
Copy link

kohlerm commented Dec 9, 2023

I trying to build a project which uses the tree-sitter module which does depend on native libraries.

it says

info  golangBuild - github.com/smacker/go-tree-sitter/bash
info  golangBuild - github.com/smacker/go-tree-sitter/bash: build constraints exclude all Go files in /go/pkg/mod/github.com/smacker/go-tree-sitter@v0.0.0-20230720070738-0d0a9f78d8f8/bash
info  golangBuild - github.com/smacker/go-tree-sitter/c
info  golangBuild - github.com/smacker/go-tree-sitter/c: build constraints exclude all Go files in /go/pkg/mod/github.com/smacker/go-tree-sitter@v0.0.0-20230720070738-0d0a9f78d8f8/c
info  golangBuild - github.com/smacker/go-tree-sitter/cpp
info  golangBuild - github.com/smacker/go-tree-sitter/cpp: build constraints exclude all Go files in /go/pkg/mod/github.com/smacker/go-tree-sitter@v0.0.0-20230720070738-0d0a9f78d8f8/cpp
info  golangBuild - github.com/smacker/go-tree-sitter/csharp
info  golangBuild - github.com/smacker/go-tree-sitter/csharp: build constraints exclude all Go files in /go/pkg/mod/github.com/smacker/go-tree-sitter@v0.0.0-20230720070738-0d0a9f78d8f8/csharp
info  golangBuild - github.com/smacker/go-tree-sitter/css
info  golangBuild - github.com/smacker/go-tree-sitter/css: build constraints exclude all Go files in /go/pkg/mod/github.com/smacker/go-tree-sitter@v0.0.0-20230720070738-0d0a9f78d8f8/css
info  golangBuild - github.com/smacker/go-tree-sitter/cue
info  golangBuild - github.com/smacker/go-tree-sitter/cue: build constraints exclude all Go files in /go/pkg/mod/github.com/smacker/go-tree-sitter@v0.0.0-20230720070738-0d0a9f78d8f8/cue
info  golangBuild - github.com/smacker/go-tree-sitter/dockerfile
info  golangBuild - github.com/smacker/go-tree-sitter/dockerfile: build constraints exclude all Go files in /go/pkg/mod/github.com/smacker/go-tree-sitter@v0.0.0-20230720070738-0d0a9f78d8f8/dockerfile
...

later

it says

golangBuild - /go/pkg/mod/github.com/smacker/go-tree-sitter@v0.0.0-20230720070738-0d0a9f78d8f8/iter.go:17:18: undefined: Node
info  golangBuild - /go/pkg/mod/github.com/smacker/go-tree-sitter@v0.0.0-20230720070738-0d0a9f78d8f8/iter.go:21:21: undefined: Node
info  golangBuild - /go/pkg/mod/github.com/smacker/go-tree-sitter@v0.0.0-20230720070738-0d0a9f78d8f8/iter.go:25:20: undefined: Node
info  golangBuild - /go/pkg/mod/github.com/smacker/go-tree-sitter@v0.0.0-20230720070738-0d0a9f78d8f8/iter.go:30:26: undefined: Node
info  golangBuild - /go/pkg/mod/github.com/smacker/go-tree-sitter@v0.0.0-20230720070738-0d0a9f78d8f8/iter.go:34:20: undefined: Node
info  golangBuild - /go/pkg/mod/github.com/smacker/go-tree-sitter@v0.0.0-20230720070738-0d0a9f78d8f8/iter.go:38:32: undefined: Node
info  golangBuild - /go/pkg/mod/github.com/smacker/go-tree-sitter@v0.0.0-20230720070738-0d0a9f78d8f8/iter.go:43:9: undefined: Node
info  golangBuild - /go/pkg/mod/github.com/smacker/go-tree-sitter@v0.0.0-20230720070738-0d0a9f78d8f8/iter.go:46:18: undefined: Node
info  golangBuild - /go/pkg/mod/github.com/smacker/go-tree-sitter@v0.0.0-20230720070738-0d0a9f78d8f8/iter.go:68:40: undefined: Node

the one google result (projectdiscovery/katana#546) i get for this error seems to suggest that the. C compiler cannot be found. This could also explain the first messages.

  golangBuild:
    dockerImage: "golang:1.21.0"
    dockerEnvVars:
      GOFLAGS: "-buildvcs=false CC=/usr/bin/gcc"
      CGO_ENABLED: 1
@kohlerm
Copy link
Author

kohlerm commented Dec 9, 2023

Forgot to mention.This all works with a local golang installation as well as the official golang 1.21 container

Copy link
Contributor

github-actions bot commented Feb 8, 2024

Thank you for your contribution! This issue is stale because it has been open 60 days with no activity. In order to keep it open, please remove stale label or add a comment within the next 10 days. If you need a Piper team member to remove the stale label make sure to add @SAP/jenkins-library-team to your comment.

@github-actions github-actions bot added the stale marks stale issues and pull requests label Feb 8, 2024
Copy link
Contributor

Issue got stale and no further activity happened. It has automatically been closed. Please re-open in case you still consider it relevant.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale marks stale issues and pull requests
Projects
None yet
Development

No branches or pull requests

1 participant