deferpanic / gorump

go on Rumprun
MIT License
314 stars 15 forks source link

Is vendoring broken? #45

Open ghost opened 8 years ago

ghost commented 8 years ago

GO15VENDOREXPERIMENT is enabled; I'm in the right GOPATH; there's a vendor directory. The gorump binary appears to either ignore the environment variable, or has broken vendor experiment code. Or, more likely, I'm doing something wrong, and would appreciate the pointer (this works with a non-go-rump go 1.5 as well as go 1.6 and 1.7).

1029) printenv | grep GO
GO15VENDOREXPERIMENT=1
GOPATH=/home/ser/workspace
1030) pwd
/home/ser/workspace/src/bitbucket.org/XXXXXXXXX/alerts
1031) ls vendor
bitbucket.org  github.com  golang.org  manifest  vendor.json
1032) ~/go-rump/gorump/go/bin/go build -o build/alert ./cmd/web
../../../github.com/serussell/logxi/v1/init.go:11:2: cannot find package "github.com/mattn/go-colorable" in any of:
        /home/ser/go-rump/gorump/go/src/github.com/mattn/go-colorable (from $GOROOT)
        /home/ser/workspace/src/github.com/mattn/go-colorable (from $GOPATH)
../../../github.com/serussell/logxi/v1/init.go:12:2: cannot find package "github.com/mattn/go-isatty" in any of:
        /home/ser/go-rump/gorump/go/src/github.com/mattn/go-isatty (from $GOROOT)
        /home/ser/workspace/src/github.com/mattn/go-isatty (from $GOPATH)
../../../github.com/serussell/logxi/v1/callstack.go:11:2: cannot find package "github.com/mgutz/ansi" in any of:
        /home/ser/go-rump/gorump/go/src/github.com/mgutz/ansi (from $GOROOT)
        /home/ser/workspace/src/github.com/mgutz/ansi (from $GOPATH)
1033)
eyberg commented 8 years ago

sorry for the late response

I just tried this on the httpd example and it is working for me - have you tried building any of the examples in the examples directory?

this is what I put into the httpd dir =>

➜  httpd git:(sfix) ✗ tree vendor 
vendor
└── bob
    └── bob.go

1 directory, 1 file
➜  httpd git:(sfix) ✗ cat vendor/bob/bob.go 
package bob

import (
        "fmt"
)

func Yo() {
        fmt.Println("yo")
}
➜  httpd git:(sfix) ✗ strings httpd.bin | grep bob.Yo
github.com/deferpanic/gorump/examples/httpd/vendor/bob.Yo
github.com/deferpanic/gorump/examples/httpd/vendor/bob.Yo
github.com/deferpanic/gorump/examples/httpd/vendor/bob.Yo
github.com/deferpanic/gorump/examples/httpd/vendor/bob.Yo

offhand I spot a few things wrong w/the compilation flags you have

1) you'll need to specify the GOOS env var to 'rumprun'

2) for right now we build these into c-archives and call from there - so that would need to be specified as well

from the httpd example you can do something like =>

CC=x86_64-rumprun-netbsd-gcc CGO_ENABLED=1 GO15VENDOREXPERIMENT=1 GOOS=rumprun ../../go/bin/go build -buildmode=c-archive -v -a -x *.go

lmk if you can build the examples as-is and then lmk if you can build w/vendoring

ghost commented 8 years ago

Hi,

Well, I get farther with these instructions (I think). Now I'm getting a different error:

import cycle not allowed
package bitbucket.org/XXX/alerts/cmd/web
        imports bitbucket.org/XXX/alerts
        imports bitbucket.org/XXX/isosws
        imports bytes
        imports errors
        imports runtime
        imports runtime/internal/atomic
        imports runtime

Here are some sample commands:

1043)internationalsos/alerts % PATH=~/go-rump/gorump/go/bin:~/go-rump/rumprun/rumprun/bin:$PATH CC=x86_64-rumprun-netbsd-gcc CGO_ENABLED=1 GO15VENDOREXPERIMENT=1 GOOS=rumprun which go
/home/ser/go-rump/gorump/go/bin/go
1044)internationalsos/alerts % PATH=~/go-rump/gorump/go/bin:~/go-rump/rumprun/rumprun/bin:$PATH CC=x86_64-rumprun-netbsd-gcc CGO_ENABLED=1 GO15VENDOREXPERIMENT=1 GOOS=rumprun go version
go version go1.5.1 linux/amd64

so I think I'm using the right go.

eyberg commented 8 years ago

were you able to get any of the examples working before diving into this one? it might be looping in something from a diff GOROOT/GOPATH

the import cycle error is def. something I exp. from time to time when I am using the wrong go build - I'd try to get one of the hello world examples working first and then dive into this one - I'd def. use the v/a/x build flags as well