New forks fail to build because of missing dependencies
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 12.4k
- Forks
- 510
- PR merge metrics
- No merged PRs in 30d
Description
I think this is occurring because absolute import paths are being used when relative paths may be required, but this issue is pervasive, so I wanted to get some feedback before creating a pull request.
Should the import statements refer to e.g. toxiproxy/stream or just stream (I'm not fluent in Go), rather than github.com/Shopify/toxiproxy/stream? The current imports have the effect of directing Go to look for those packages in the vendor/ directory when a fork builds (see sample Travis log snippet below).
NB I did briefly look at the docs for the tools/godep project, but it appears to be deprecated.
An example is link.go:
package toxiproxy
import (
"io"
"github.com/Shopify/toxiproxy/stream"
"github.com/Shopify/toxiproxy/toxics"
"github.com/sirupsen/logrus"
)
This results in build errors on a fresh fork:
$ godep go build
link.go:6:2: cannot find package "github.com/Shopify/toxiproxy/stream" in any of:
/home/travis/gopath/src/github.com/jimkleine/toxiproxy/vendor/github.com/Shopify/toxiproxy/stream (vendor tree)
/home/travis/.gimme/versions/go1.9.7.linux.amd64/src/github.com/Shopify/toxiproxy/stream (from $GOROOT)
/home/travis/gopath/src/github.com/jimkleine/toxiproxy/Godeps/_workspace/src/github.com/Shopify/toxiproxy/stream (from $GOPATH)
/home/travis/gopath/src/github.com/Shopify/toxiproxy/stream
api.go:12:2: cannot find package "github.com/Shopify/toxiproxy/toxics" in any of:
/home/travis/gopath/src/github.com/jimkleine/toxiproxy/vendor/github.com/Shopify/toxiproxy/toxics (vendor tree)
/home/travis/.gimme/versions/go1.9.7.linux.amd64/src/github.com/Shopify/toxiproxy/toxics (from $GOROOT)
/home/travis/gopath/src/github.com/jimkleine/toxiproxy/Godeps/_workspace/src/github.com/Shopify/toxiproxy/toxics (from $GOPATH)
/home/travis/gopath/src/github.com/Shopify/toxiproxy/toxics
godep: go exit status 1
The command "godep go build" failed and exited with 1 during .
The equivalent Travis build log from the Shopify repo is:
$ godep go build
10.28s$ godep go test ./...
ok github.com/Shopify/toxiproxy 0.579s
? github.com/Shopify/toxiproxy/cli [no test files]
? github.com/Shopify/toxiproxy/client [no test files]
? github.com/Shopify/toxiproxy/cmd [no test files]
ok github.com/Shopify/toxiproxy/stream 0.052s
ok github.com/Shopify/toxiproxy/testhelper 0.010s
ok github.com/Shopify/toxiproxy/testing 0.010s [no tests to run]
ok github.com/Shopify/toxiproxy/toxics 6.507s
The command "godep go test ./..." exited with 0.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the imports in link.go and api.go, then run godep go build from a fresh fork to reproduce the missing-package errors. Compare the fork's vendor and Godeps paths with the successful Shopify Travis build. Done means a fresh fork builds and godep go test ./... completes successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100