zb icon indicating copy to clipboard operation
zb copied to clipboard

`zb build` doesn't report about missing dependencies errors

Open robert-zaremba opened this issue 8 years ago • 6 comments

How to replicate:

  • create a new empty environment (GOPATH), eg:

    mkdir ~/tmp-go
    export GOPATH=~/tmp-go
    
  • clone repository (without using go get) with some dependencies, eg:

    git clone https://github.com/robert-zaremba/log15.git ~/tmp-go/src/github.com/robert-zaremba/log15
    
  • run zb build there.

It will return quietly without reporting error about missing dependencies. If you run go build (eg inside the log15/example package) it will return with errors.

robert-zaremba avatar Aug 29 '17 00:08 robert-zaremba

Hmm... when I tried that I get this:

% zb build
ERROR cannot find package "github.com/davecgh/go-spew/spew" in any of:
ERROR   /Users/jrubin/.gvm/gos/go1.9/src/github.com/davecgh/go-spew/spew (from $GOROOT)
ERROR   /Users/jrubin/tmp-go/src/github.com/davecgh/go-spew/spew (from $GOPATH)

I thought it might be something in my environment, but it doesn't seem so:

% env -i GOPATH="${GOPATH}" PATH="${PATH}" zb build
level=ERROR msg="cannot find package \"github.com/davecgh/go-spew/spew\" in any of:"
level=ERROR msg="\t/Users/jrubin/.gvm/gos/go1.8.3/src/github.com/davecgh/go-spew/spew (from $GOROOT)"
level=ERROR msg="\t/Users/jrubin/tmp-go/src/github.com/davecgh/go-spew/spew (from $GOPATH)"

joshuarubin avatar Aug 29 '17 02:08 joshuarubin

This is my output:

% cd ~
~ % mkdir ~/tmp-go

~ % export GOPATH=~/tmp-go

~ % git clone https://github.com/robert-zaremba/log15.git ~/tmp-go/src/github.com/robert-zaremba/log15
Cloning into '/home/robert/tmp-go/src/github.com/robert-zaremba/log15'...
remote: Counting objects: 624, done.
remote: Compressing objects: 100% (18/18), done.
remote: Total 624 (delta 0), reused 12 (delta 0), pack-reused 604
Receiving objects: 100% (624/624), 195.49 KiB | 0 bytes/s, done.
Resolving deltas: 100% (343/343), done.

robert@rz-thinkpad ~ % cd ~/tmp-go/src/github.com/robert-zaremba/log15

...github.com/robert-zaremba/log15 (git master)% zb build

...github.com/robert-zaremba/log15 (git master)% ls
bench_test.go  caller_test.go  doc.go   ext        format-terminal.go       handler.go       handler_go14.go  LICENSE        logger.go  reg.go   root.go    term
caller.go      CONTRIBUTORS    example  format.go  format-terminal_test.go  handler_go13.go  init_test.go     log15_test.go  README.md  rollbar  syslog.go  writer.go

...github.com/robert-zaremba/log15 (git master)% cd example 

...robert-zaremba/log15/example (git master)% go build
../format-terminal.go:9:2: cannot find package "github.com/davecgh/go-spew/spew" in any of:
        /usr/lib/golang/src/github.com/davecgh/go-spew/spew (from $GOROOT)
        /home/robert/tmp-go/src/github.com/davecgh/go-spew/spew (from $GOPATH)
example.go:7:2: cannot find package "github.com/facebookgo/stack" in any of:
        /usr/lib/golang/src/github.com/facebookgo/stack (from $GOROOT)
        /home/robert/tmp-go/src/github.com/facebookgo/stack (from $GOPATH)
../caller.go:7:2: cannot find package "github.com/go-stack/stack" in any of:
        /usr/lib/golang/src/github.com/go-stack/stack (from $GOROOT)
        /home/robert/tmp-go/src/github.com/go-stack/stack (from $GOPATH)
../root.go:6:2: cannot find package "github.com/mattn/go-colorable" in any of:
        /usr/lib/golang/src/github.com/mattn/go-colorable (from $GOROOT)
        /home/robert/tmp-go/src/github.com/mattn/go-colorable (from $GOPATH)
example.go:8:2: cannot find package "github.com/robert-zaremba/errstack" in any of:
        /usr/lib/golang/src/github.com/robert-zaremba/errstack (from $GOROOT)
        /home/robert/tmp-go/src/github.com/robert-zaremba/errstack (from $GOPATH)
../format-terminal.go:11:2: cannot find package "github.com/robert-zaremba/go-tty" in any of:
        /usr/lib/golang/src/github.com/robert-zaremba/go-tty (from $GOROOT)
        /home/robert/tmp-go/src/github.com/robert-zaremba/go-tty (from $GOPATH)

I tested it on Fedora 26 and Ubuntu 16.04

robert-zaremba avatar Aug 29 '17 07:08 robert-zaremba

I've been testing on Mac, it might be a Linux specific issue. What do you get when you run: LOG_LEVEL=debug zb build?

joshuarubin avatar Aug 29 '17 16:08 joshuarubin

Also nothing. I've tried zb -l DEBUG build as well.

robert-zaremba avatar Aug 30 '17 08:08 robert-zaremba

Are you sure you export GOPATH=~/tmp-go? I've tested it with a friend on Mac and he has the same issue.

robert-zaremba avatar Aug 30 '17 08:08 robert-zaremba

Yes, my $GOPATH is set just as yours is. I still can't reproduce. You are running the current zb from the master branch? What version of Go?

joshuarubin avatar Sep 01 '17 04:09 joshuarubin