sourcegraph / lsif-go

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

Cannot run lsif-go because of dependency issue with etcd-io/bbolt #64

Open jpresky opened 4 years ago

jpresky commented 4 years ago

I am following the instructions listed here to run this job: https://docs.gitlab.com/ee/user/project/code_intelligence.html

go get works fine but running the binary runs into problems because it looks like lsif-go downloads a few more modules.

go: github.com/coreos/etcd/etcdctl/ctlv2/command imports github.com/coreos/bbolt: github.com/coreos/bbolt@v1.3.5: parsing go.mod: module declares its path as: go.etcd.io/bbolt but was required as: github.com/coreos/bbolt

there is a mismatch in the path of bbolt in the gomod and how it is imported in code.

Relevant issue here: https://github.com/etcd-io/bbolt/issues/224

I imagine when they fix it, lsif-go will also need to be updated to reference the latest etcd, which imports bbolt.

go get -u github.com/sourcegraph/lsif-go/cmd/lsif-go
go: downloading github.com/sourcegraph/lsif-go v0.8.0
go: found github.com/sourcegraph/lsif-go/cmd/lsif-go in github.com/sourcegraph/lsif-go v0.8.0
go: downloading github.com/alecthomas/kingpin v2.2.6+incompatible
go: downloading github.com/slimsag/godocmd v0.0.0-20161025000126-a1005ad29fe3
go: downloading golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56
go: downloading github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d
go: downloading github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751
go: golang.org/x/tools upgrade => v0.0.0-20200713235242-6acd2ab80ede
go: github.com/alecthomas/template upgrade => v0.0.0-20190718012654-fb15b899a751
go: github.com/alecthomas/units upgrade => v0.0.0-20190924025748-f65c72e2690d
go: downloading golang.org/x/tools v0.0.0-20200713235242-6acd2ab80ede
go: downloading golang.org/x/mod v0.3.0
go: golang.org/x/xerrors upgrade => v0.0.0-20191204190536-9bdfabe68543
go: golang.org/x/mod upgrade => v0.3.0
$ $GOPATH/bin/lsif-go
.
error: index: load packages: go [-e -json -compiled=true -test=true -export=false -deps=true -find=false -- ./...]: exit status 1: go: finding module for package github.com/hashicorp/consul/api
go: finding module for package google.golang.org/grpc/peer
go: finding module for package github.com/jonboulle/clockwork
go: finding module for package github.com/grpc-ecosystem/go-grpc-prometheus
go: finding module for package golang.org/x/time/rate
go: finding module for package github.com/afex/hystrix-go/hystrix
go: finding module for package github.com/coreos/bbolt
go: finding module for package gopkg.in/tomb.v2
go: finding module for package github.com/urfave/cli
go: finding module for package github.com/casbin/casbin
go: downloading github.com/jonboulle/clockwork v0.2.0
go: downloading github.com/coreos/bbolt v1.3.5
go: downloading github.com/casbin/casbin v1.9.1
go: downloading github.com/urfave/cli v1.22.4
go: downloading github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
go: downloading github.com/hashicorp/consul/api v1.5.0
go: downloading golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e
go: downloading github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5
go: downloading github.com/hashicorp/consul v1.8.0
go: downloading gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637
go: downloading google.golang.org/grpc v1.30.0
go: finding module for package github.com/VividCortex/gohistogram
go: finding module for package google.golang.org/grpc/metadata
go: finding module for package github.com/openzipkin/zipkin-go
go: finding module for package github.com/streadway/handy/breaker
go: finding module for package github.com/opentracing/opentracing-go
go: finding module for package google.golang.org/grpc/health
go: finding module for package go.etcd.io/etcd/clientv3
go: downloading github.com/VividCortex/gohistogram v1.0.0
go: downloading github.com/openzipkin/zipkin-go v0.2.2
go: finding module for package github.com/hudl/fargo
go: downloading github.com/opentracing/opentracing-go v1.2.0
go: downloading github.com/streadway/handy v0.0.0-20200128134331-0f66f006fb2e
go: finding module for package github.com/openzipkin-contrib/zipkin-go-opentracing
go: downloading go.etcd.io/etcd v0.5.0-alpha.5
go: downloading github.com/hudl/fargo v1.3.0
go: finding module for package go.etcd.io/etcd/pkg/transport
go: finding module for package github.com/gorilla/mux
go: finding module for package google.golang.org/grpc/health/grpc_health_v1
go: downloading github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5
go: finding module for package google.golang.org/grpc/codes
go: finding module for package github.com/shurcooL/httpfs/vfsutil
go: downloading github.com/gorilla/mux v1.7.4
go: finding module for package google.golang.org/grpc
go: downloading github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749
go: finding module for package go.opencensus.io/trace/propagation
go: finding module for package cloud.google.com/go/pubsub
go: downloading go.etcd.io/etcd v3.3.22+incompatible
go: finding module for package github.com/juju/ansiterm
go: downloading cloud.google.com/go v0.61.0
go: finding module for package go.uber.org/zap
go: downloading go.opencensus.io v0.22.4
go: downloading cloud.google.com/go/pubsub v1.5.0
go: downloading go.uber.org/zap v1.15.0
go: downloading github.com/juju/ansiterm v0.0.0-20180109212912-720a0952cc2a
go: finding module for package cloud.google.com/go/datastore
go: downloading cloud.google.com/go/datastore v1.2.0
go: finding module for package cloud.google.com/go/bigquery
go: downloading cloud.google.com/go/bigquery v1.9.0
go: finding module for package github.com/grpc-ecosystem/grpc-gateway/runtime
go: finding module for package github.com/coreos/pkg/capnslog
go: finding module for package go.opencensus.io/plugin/ochttp
go: downloading github.com/grpc-ecosystem/grpc-gateway v1.14.6
go: downloading github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f
go: finding module for package github.com/grpc-ecosystem/go-grpc-middleware
go: downloading github.com/grpc-ecosystem/go-grpc-middleware v1.2.0
go: finding module for package go.opencensus.io/plugin/ochttp/propagation/b3
go: finding module for package github.com/performancecopilot/speed
go: downloading github.com/performancecopilot/speed v1.0.0
go: finding module for package github.com/godbus/dbus
go: downloading github.com/godbus/dbus v4.1.0+incompatible
go: downloading github.com/performancecopilot/speed v3.0.0+incompatible
go: finding module for package sourcegraph.com/sourcegraph/appdash
go: finding module for package github.com/samuel/go-zookeeper/zk
go: downloading sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0
go: downloading github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da
go: finding module for package github.com/streadway/amqp
go: finding module for package github.com/grpc-ecosystem/grpc-gateway/utilities
go: downloading github.com/streadway/amqp v1.0.0
go: finding module for package google.golang.org/grpc/transport
go: finding module for package github.com/aws/aws-sdk-go-v2/service/cloudwatch/cloudwatchiface
go: downloading github.com/aws/aws-sdk-go-v2 v0.23.0
go: finding module for package github.com/aws/aws-sdk-go-v2/service/cloudwatch
go: finding module for package google.golang.org/grpc/keepalive
go: finding module for package google.golang.org/api/googleapi
go: downloading google.golang.org/api v0.29.0
go: finding module for package github.com/andreiavrammsd/validator
go: downloading github.com/andreiavrammsd/validator v9.31.0+incompatible
go: finding module for package github.com/xiang90/probing
go: downloading github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2
go: finding module for package github.com/nats-io/go-nats
go: downloading github.com/nats-io/go-nats v1.8.1
go: finding module for package github.com/opentracing/opentracing-go/mocktracer
go: finding module for package github.com/aws/aws-sdk-go/service/cloudwatch
go: downloading github.com/aws/aws-sdk-go v1.33.5
go: finding module for package github.com/sony/gobreaker
go: finding module for package github.com/tmc/grpc-websocket-proxy/wsproxy
go: downloading github.com/sony/gobreaker v0.4.1
go: finding module for package github.com/apache/thrift/lib/go/thrift
go: downloading github.com/tmc/grpc-websocket-proxy v0.0.0-20200427203606-3cfed13b9966
go: downloading github.com/apache/thrift v0.13.0
go: finding module for package github.com/lightstep/lightstep-tracer-go
go: downloading github.com/lightstep/lightstep-tracer-go v0.20.0
go: finding module for package gopkg.in/cheggaaa/pb.v1
go: downloading gopkg.in/cheggaaa/pb.v1 v1.0.28
go: finding module for package gopkg.in/ini.v1
go: finding module for package github.com/soheilhy/cmux
go: finding module for package github.com/codegangsta/cli
go: downloading gopkg.in/ini.v1 v1.57.0
go: downloading github.com/soheilhy/cmux v0.1.4
go: downloading github.com/codegangsta/cli v1.22.4
go: finding module for package github.com/shurcooL/go/importgraphutil
go: finding module for package github.com/pborman/getopt/v2
go: downloading github.com/shurcooL/go v0.0.0-20200502201357-93f07166e636
go: finding module for package google.golang.org/grpc/credentials
go: downloading github.com/pborman/getopt v0.0.0-20190409184431-ee0cd42419d3
go: finding module for package github.com/olekukonko/tablewriter
go: downloading github.com/olekukonko/tablewriter v0.0.4
go: finding module for package github.com/google/btree
go: downloading github.com/google/btree v1.0.0
go: finding module for package github.com/neelance/sourcemap
go: downloading github.com/neelance/sourcemap v0.0.0-20200213170602-2833bce08e4c
go: finding module for package github.com/goji/param
go: downloading github.com/goji/param v0.0.0-20160927210335-d7f49fd7d1ed
go: finding module for package google.golang.org/grpc/grpclog
go: finding module for package go.opencensus.io/trace
go: finding module for package google.golang.org/grpc/naming
go: finding module for package github.com/badgerodon/collections
go: finding module for package github.com/pact-foundation/pact-go/dsl
go: finding module for package github.com/pborman/uuid
go: downloading github.com/pact-foundation/pact-go v1.4.3
go: downloading github.com/pborman/uuid v1.2.0
go: downloading github.com/badgerodon/collections v0.0.0-20130729185459-604e922904d3
go: finding module for package google.golang.org/api/option
go: finding module for package go.etcd.io/etcd/client
go: finding module for package github.com/pquerna/otp/totp
go: finding module for package github.com/aws/aws-sdk-go-v2/aws
go: downloading github.com/pquerna/otp v1.2.0
go: finding module for package github.com/influxdata/influxdb/client/v2
go: downloading github.com/influxdata/influxdb v1.8.1
go: finding module for package google.golang.org/grpc/status
go: finding module for package github.com/neelance/astrewrite
go: downloading github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86
go: finding module for package github.com/nats-io/gnatsd/server
go: downloading github.com/nats-io/gnatsd v1.4.1
go: finding module for package github.com/juju/retry
go: downloading github.com/juju/retry v0.0.0-20180821225755-9058e192b216
go: finding module for package github.com/ghodss/yaml
go: downloading github.com/ghodss/yaml v1.0.0
go: finding module for package github.com/juju/clock
go: downloading github.com/juju/clock v0.0.0-20190205081909-9c5c9712527c
go: finding module for package github.com/openzipkin/zipkin-go/reporter/http
go: finding module for package cloud.google.com/go/bigtable
go: downloading cloud.google.com/go/bigtable v1.4.0
go: finding module for package github.com/opentracing/opentracing-go/ext
go: finding module for package github.com/mcuadros/go-gin-prometheus
go: downloading github.com/mcuadros/go-gin-prometheus v0.1.0
go: finding module for package github.com/aws/aws-sdk-go/service/cloudwatch/cloudwatchiface
go: finding module for package github.com/juju/utils
go: downloading github.com/juju/utils v0.0.0-20200604140309-9d78121a29e0
go: finding module for package github.com/golang/groupcache/lru
go: downloading github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e
go: finding module for package github.com/bgentry/speakeasy
go: finding module for package go.opencensus.io/plugin/ochttp/propagation/tracecontext
go: downloading github.com/bgentry/speakeasy v0.1.0
go: finding module for package github.com/aws/aws-sdk-go/aws
go: finding module for package github.com/juju/version
go: downloading github.com/juju/version v0.0.0-20191219164919-81c1be00b9a6
go: finding module for package github.com/oklog/oklog/pkg/group
go: downloading github.com/oklog/oklog v0.3.2
go: finding module for package sourcegraph.com/sourcegraph/appdash/opentracing
go: finding module for package github.com/casbin/casbin/persist/file-adapter
go: finding module for package github.com/openzipkin/zipkin-go/model
go: finding module for package github.com/ansel1/merry
go: downloading github.com/ansel1/merry v1.5.1
go: finding module for package github.com/coreos/pkg/dlopen
go: finding module for package github.com/openzipkin/zipkin-go/propagation/b3
go: finding module for package github.com/openzipkin/zipkin-go/reporter/recorder
go: found github.com/coreos/pkg/capnslog in github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f
go: found google.golang.org/grpc/credentials in google.golang.org/grpc v1.30.0
go: found github.com/ghodss/yaml in github.com/ghodss/yaml v1.0.0
go: found github.com/jonboulle/clockwork in github.com/jonboulle/clockwork v0.2.0
go: found github.com/grpc-ecosystem/go-grpc-prometheus in github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
go: found github.com/grpc-ecosystem/grpc-gateway/runtime in github.com/grpc-ecosystem/grpc-gateway v1.14.6
go: found github.com/soheilhy/cmux in github.com/soheilhy/cmux v0.1.4
go: found github.com/tmc/grpc-websocket-proxy/wsproxy in github.com/tmc/grpc-websocket-proxy v0.0.0-20200427203606-3cfed13b9966
go: found github.com/urfave/cli in github.com/urfave/cli v1.22.4
go: found github.com/bgentry/speakeasy in github.com/bgentry/speakeasy v0.1.0
go: found github.com/coreos/bbolt in github.com/coreos/bbolt v1.3.5
go: found github.com/olekukonko/tablewriter in github.com/olekukonko/tablewriter v0.0.4
go: found golang.org/x/time/rate in golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e
go: found gopkg.in/cheggaaa/pb.v1 in gopkg.in/cheggaaa/pb.v1 v1.0.28
go: found github.com/grpc-ecosystem/go-grpc-middleware in github.com/grpc-ecosystem/go-grpc-middleware v1.2.0
go: found go.uber.org/zap in go.uber.org/zap v1.15.0
go: found github.com/google/btree in github.com/google/btree v1.0.0
go: found github.com/golang/groupcache/lru in github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e
go: found github.com/xiang90/probing in github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2
go: found github.com/godbus/dbus in github.com/godbus/dbus v4.1.0+incompatible
go: found gopkg.in/tomb.v2 in gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637
go: found github.com/casbin/casbin in github.com/casbin/casbin v1.9.1
go: found github.com/afex/hystrix-go/hystrix in github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5
go: found github.com/sony/gobreaker in github.com/sony/gobreaker v0.4.1
go: found github.com/streadway/handy/breaker in github.com/streadway/handy v0.0.0-20200128134331-0f66f006fb2e
go: found github.com/apache/thrift/lib/go/thrift in github.com/apache/thrift v0.13.0
go: found github.com/lightstep/lightstep-tracer-go in github.com/lightstep/lightstep-tracer-go v0.20.0
go: found github.com/opentracing/opentracing-go in github.com/opentracing/opentracing-go v1.2.0
go: found github.com/openzipkin-contrib/zipkin-go-opentracing in github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5
go: found github.com/openzipkin/zipkin-go in github.com/openzipkin/zipkin-go v0.2.2
go: found sourcegraph.com/sourcegraph/appdash in sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0
go: found github.com/oklog/oklog/pkg/group in github.com/oklog/oklog v0.3.2
go: found github.com/gorilla/mux in github.com/gorilla/mux v1.7.4
go: found github.com/hashicorp/consul/api in github.com/hashicorp/consul/api v1.5.0
go: found github.com/pborman/uuid in github.com/pborman/uuid v1.2.0
go: found github.com/nats-io/go-nats in github.com/nats-io/go-nats v1.8.1
go: found github.com/aws/aws-sdk-go/aws in github.com/aws/aws-sdk-go v1.33.5
go: found github.com/aws/aws-sdk-go-v2/aws in github.com/aws/aws-sdk-go-v2 v0.23.0
go: found github.com/VividCortex/gohistogram in github.com/VividCortex/gohistogram v1.0.0
go: found github.com/influxdata/influxdb/client/v2 in github.com/influxdata/influxdb v1.8.1
go: found github.com/performancecopilot/speed in github.com/performancecopilot/speed v3.0.0+incompatible
go: found go.etcd.io/etcd/client in go.etcd.io/etcd v3.3.22+incompatible
go: found github.com/hudl/fargo in github.com/hudl/fargo v1.3.0
go: found github.com/samuel/go-zookeeper/zk in github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da
go: found go.opencensus.io/plugin/ochttp in go.opencensus.io v0.22.4
go: found github.com/streadway/amqp in github.com/streadway/amqp v1.0.0
go: found github.com/badgerodon/collections in github.com/badgerodon/collections v0.0.0-20130729185459-604e922904d3
go: found github.com/neelance/sourcemap in github.com/neelance/sourcemap v0.0.0-20200213170602-2833bce08e4c
go: found github.com/shurcooL/httpfs/vfsutil in github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749
go: found github.com/neelance/astrewrite in github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86
go: found gopkg.in/ini.v1 in gopkg.in/ini.v1 v1.57.0
go: found github.com/juju/ansiterm in github.com/juju/ansiterm v0.0.0-20180109212912-720a0952cc2a
go: found github.com/juju/clock in github.com/juju/clock v0.0.0-20190205081909-9c5c9712527c
go: found github.com/juju/retry in github.com/juju/retry v0.0.0-20180821225755-9058e192b216
go: found github.com/juju/utils in github.com/juju/utils v0.0.0-20200604140309-9d78121a29e0
go: found github.com/juju/version in github.com/juju/version v0.0.0-20191219164919-81c1be00b9a6
go: found github.com/pquerna/otp/totp in github.com/pquerna/otp v1.2.0
go: found google.golang.org/api/option in google.golang.org/api v0.29.0
go: found cloud.google.com/go/bigquery in cloud.google.com/go/bigquery v1.9.0
go: found cloud.google.com/go/bigtable in cloud.google.com/go/bigtable v1.4.0
go: found cloud.google.com/go/datastore in cloud.google.com/go/datastore v1.2.0
go: found cloud.google.com/go/pubsub in cloud.google.com/go/pubsub v1.5.0
go: found github.com/ansel1/merry in github.com/ansel1/merry v1.5.1
go: found github.com/pborman/getopt/v2 in github.com/pborman/getopt v0.0.0-20190409184431-ee0cd42419d3
go: found github.com/codegangsta/cli in github.com/codegangsta/cli v1.22.4
go: found github.com/goji/param in github.com/goji/param v0.0.0-20160927210335-d7f49fd7d1ed
go: found github.com/mcuadros/go-gin-prometheus in github.com/mcuadros/go-gin-prometheus v0.1.0
go: found github.com/andreiavrammsd/validator in github.com/andreiavrammsd/validator v9.31.0+incompatible
go: found github.com/pact-foundation/pact-go/dsl in github.com/pact-foundation/pact-go v1.4.3
go: found github.com/nats-io/gnatsd/server in github.com/nats-io/gnatsd v1.4.1
go: found github.com/shurcooL/go/importgraphutil in github.com/shurcooL/go v0.0.0-20200502201357-93f07166e636
go: github.com/coreos/etcd/etcdctl/ctlv2/command imports
    github.com/coreos/bbolt: github.com/coreos/bbolt@v1.3.5: parsing go.mod:
    module declares its path as: go.etcd.io/bbolt
            but was required as: github.com/coreos/bbolt
jpresky commented 4 years ago

Here is the issue being tracked in etcd https://github.com/etcd-io/etcd/issues/12068

efritz commented 4 years ago

Thanks for the report! I'll see if there's a way we can accept input more leniently on our end.

efritz commented 4 years ago

@jpresky

Sorry for the delay into reading into this more deeply. I've put a lot of work into this repo recently to get it up to v1.0. I'm able to index both coreos/etcd as well as etcd-io/bbolt. Are you trying to index another repository that I didn't list here?

mrVanboy commented 3 years ago

Just curious: isn't it caused by the missing replace directive in go.mod of the project which is analyzed by lsif-go?

Ref:

efritz commented 3 years ago

From what I can tell the target project is not declaring its dependencies in go.mod correctly, and lsif-go wouldn't be able to do anything about it in this case. @jpresky, you say that go get works but lisf-go fails because it tries to pull in "additional" packages. Are you able to run tests on the code of this repo? (go get will fetch deps but not test deps, which lsif-go does require by default).