Skip to content
This repository has been archived by the owner on Mar 6, 2020. It is now read-only.

gb generate to include $GB_PROJECT_DIR/bin in $PATH #630

Open
toffaletti opened this issue Jun 30, 2016 · 0 comments
Open

gb generate to include $GB_PROJECT_DIR/bin in $PATH #630

toffaletti opened this issue Jun 30, 2016 · 0 comments

Comments

@toffaletti
Copy link

This issue is related to #100 in that I have a vendor dependency like this:

$ gb vendor list
github.com/mailru/easyjson          https://github.com/mailru/easyjson          master 69e532648c145d4ae3b9214d166e20938eae8ef3

I solve the issue of building the binary with a Makefile that does this:

$ gb build github.com/mailru/easyjson/easyjson
$ ls bin/
easyjson

And I've got a file with a generate directive:

//go:generate easyjson -all -snake_case $GOFILE

But gb generate src/stuff/result.go gives me:

result.go:1: running "easyjson": exec: "easyjson": executable file not found in $PATH
FATAL: command "generate" failed: exit status 1

I've got a work around, but it isn't pretty:

$ env PATH=`pwd`/bin:$PATH gb generate ./src/stuff/result.go 

I was pleasantly surprised to find gb setup $GOPATH correctly when running the generate command, so thanks for that!

Additionally I had a couple other problems getting gb generate working.

When I initially ran this I expected it just to operate on my project, but it seemed to be going through every possible package it could find?

$ gb generate

/usr/local/go/src/cmd/compile/internal/big/float.go:137: running "stringer": exec: "stringer": executable file not found in $PATH
2016/06/29 21:00:46 open builtin.go: permission denied
exit status 1
/usr/local/go/src/cmd/compile/internal/gc/lex.go:5: running "go": exit status 1
2016/06/29 21:00:46 open anames.go: permission denied
exit status 1
/usr/local/go/src/cmd/internal/obj/arm/a.out.go:35: running "go": exit status 1
2016/06/29 21:00:47 open anames.go: permission denied
exit status 1
/usr/local/go/src/cmd/internal/obj/arm64/a.out.go:349: running "go": exit status 1
2016/06/29 21:00:47 open anames.go: permission denied
exit status 1
/usr/local/go/src/cmd/internal/obj/mips/a.out.go:34: running "go": exit status 1
2016/06/29 21:00:47 open anames.go: permission denied
exit status 1
/usr/local/go/src/cmd/internal/obj/ppc64/a.out.go:34: running "go": exit status 1
2016/06/29 21:00:48 open anames.go: permission denied
exit status 1
/usr/local/go/src/cmd/internal/obj/x86/a.out.go:35: running "go": exit status 1
FATAL: command "generate" failed: exit status 1

Then I tried this which gave no output and also seemed to do nothing at all with my go:generate directives?

$ gb generate ./src/...
pritambaral added a commit to pritambaral/gb that referenced this issue Jan 16, 2017
Projects may want to use binaries in $PROJECT/bin in `//go:generate`

Closes constabulary#630
pritambaral added a commit to pritambaral/gb that referenced this issue Jan 16, 2017
Projects may want to use binaries in $PROJECT/bin in `//go:generate`

Closes constabulary#630
pritambaral added a commit to pritambaral/gb that referenced this issue Jan 16, 2017
Projects may want to use binaries in $PROJECT/bin in `//go:generate`

Closes constabulary#630
pritambaral added a commit to pritambaral/gb that referenced this issue May 10, 2017
Projects may want to use binaries in $PROJECT/bin in `//go:generate`

Closes constabulary#630
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant