ondrajz / go-callvis

Visualize call graph of a Go program using Graphviz
https://ofabry.github.io/go-callvis
MIT License
5.91k stars 408 forks source link

mac 10.3 make failed #11

Closed logofox closed 6 years ago

logofox commented 7 years ago

cd github.com/TrueFurby/go-callvis/ && make

go get github.com/golang/dep/cmd/dep dep ensure -update make: dep: No such file or directory make: *** [dep] Error 1

ondrajz commented 7 years ago

No way for me to test this. But I checked the Makefile and the only reason I found it might be is the order of targets.

I have changed the order, try updating the repository and trying again.

ondrajz commented 7 years ago

Okay. I tried doing clean install and found out the problem was due some recent changes in dep tool. Using Godep.* files instead manifest/lock.json. I committed https://github.com/TrueFurby/go-callvis/commit/a5f9bf85971e9874d9aa4f376cb03942b3a92939 to fix this. Try with the latest changes.

yilin0830 commented 7 years ago

cd go-callvis/ && make

go get -u github.com/golang/dep/cmd/dep dep ensure -update make: dep: No such file or directory make: *** [dep] Error 1

ondrajz commented 7 years ago

Did you run:

go get -u github.com/TrueFurby/go-callvis
cd $GOPATH/src/github.com/TrueFurby/go-callvis && make

I just tested clean install and everything works for me. However I have no way to test this on mac.

mixeract commented 7 years ago

Still issues on macOS 10.12

$ go get -u github.com/TrueFurby/go-callvis
$ cd $GOPATH/src/github.com/TrueFurby/go-callvis && make
go get -u github.com/golang/dep/cmd/dep
dep ensure -update
make: dep: No such file or directory
make: *** [dep] Error 1

Update: Setting the correct $GOPATH should fix the issue. On Mac set the following in your ~/.bashrc

# Go path
export GOPATH=$HOME/golang
export GOROOT=/usr/local/opt/go/libexec
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
garrettr commented 6 years ago

I have the same issue on macOS 10.12.6. It is due to the lack of $GOPATH/bin in $PATH. The Makefile assumes that it is included when it tries to call dep after installing it.

I think it would be better to prefix all calls to dependencies installed with go get with $GOPATH/bin in the Makefile, since that will work regardless of whether you have added $GOPATH/bin to your $PATH. While that may be a popular modification among Gophers, it is not set by the default installer (which only adds $GOROOT to your $PATH), is not mentioned in the official install docs, and is only suggested as an optional modification for convenience in "How to write Go code".