sourcegraph / lsif-go

Language Server Indexing Format (LSIF) generator for Go
https://lsif.dev/
MIT License
116 stars 20 forks source link

Indexing CGo? #227

Closed colinking closed 2 years ago

colinking commented 2 years ago

We're running into an issue with v1.7.5 because of CGo:

error: failed to index: failed to load packages: packages.Load: err: exit status 1: stderr: go build github.com/pganalyze/pg_query_go/v2/parser: build constraints exclude all Go files in /go/pkg/mod/github.com/pganalyze/pg_query_go/v2@v2.1.0/parser

Looks related to https://github.com/sourcegraph/lsif-go/pull/221/files which sets CGO_ENABLED=0 when loading packages. For now, we can lock to 1.7.4.

chrismwendt commented 2 years ago

Locking to 1.7.4 sounds good. You won't be missing much https://github.com/sourcegraph/lsif-go/releases/tag/v1.7.5

I'm asking @tjdevries about the mechanics of CGO_ENABLED=0. It seems at the very least we'd want to allow users to configure that environment variable.