mattn / gom

Go Manager - bundle for go
1.38k stars 92 forks source link

'gom install' failed on Go 1.6 with GO15VENDOREXPERIMENT=0 #84

Closed syohex closed 7 years ago

syohex commented 7 years ago
% go version
go version go1.6.3 linux/amd64
% echo $GO15VENDOREXPERIMENT
0
% gom install
downloading github.com/mattn/gover
downloading github.com/hashicorp/go-version
downloading github.com/daviddengcn/go-colortext
gom:  open /home/syohei/go/src/github.com/mattn/gom/_vendor/src: no such file or directory
% echo $?
1
syohex commented 7 years ago

This was introduced by https://github.com/mattn/gom/commit/a2d474243cd5b5b6c4aa5abdf344a0040225f0fe

mattn commented 7 years ago

Could you please once remove _vendor?

issue84

syohex commented 7 years ago

Could you please once remove vendor

I still get error even if _vendor is removed.

% ls
exec.go       gen.go       Gomfile     gomfile_test.go  main.go  README.mkd
exec_test.go  gen_test.go  gomfile.go  install.go       misc/
% ls -l _vendor
ls: cannot access '_vendor': No such file or directory
% export GO15VENDOREXPERIMENT=0
% ag GO15VENDOREXPERIMENT # I didn't typo
main.go
87:     return os.Getenv("GO15VENDOREXPERIMENT") == "1"
89:     return os.Getenv("GO15VENDOREXPERIMENT") != "0"
% gom install
downloading github.com/mattn/gover
downloading github.com/hashicorp/go-version
downloading github.com/daviddengcn/go-colortext
gom:  open /home/syohei/go/src/github.com/mattn/gom/_vendor/src: no such file or directory

Did you set GO15VENDOREXPERIMENT=0 ?

syohex commented 7 years ago

In this environment, moveSrcToVendor is called twice at this line and this line

mattn commented 7 years ago

Yes, moveSrcToVendor is called after build/install.

mattn commented 7 years ago

But your gom command (I don't know the version of gom) may be do it because behavior moveSrcToVendor was changed in few days ago.

syohex commented 7 years ago

I use latest gom.

In this environment, moveSrcToVendor is called twice at this line and this line

Before first moveSrcToVendor call
% ls _vendor
bin/  pkg/  src/
After first moveSrcToVendor call
% ls _vendor
bin/  github.com/  pkg/
Before second moveSrcToVendor call
% ls _vendor
bin/  github.com/  pkg/

_vendor/src is already moved, so second moveSrcToVendor is falied.

mattn commented 7 years ago

What do you mean second?

When gom install,

  1. move _vendor/github.com to _vendor/src (moveSrcToVendorSrc)
  2. go get
  3. move _vendor/src/* to _vendor/ (moveSrcToVendor )
syohex commented 7 years ago

Sorry for confused. Second means moveSrcToVendor at this point(https://github.com/mattn/gom/blob/a2d474243cd5b5b6c4aa5abdf344a0040225f0fe/install.go#L568). (first call is here(https://github.com/mattn/gom/blob/a2d474243cd5b5b6c4aa5abdf344a0040225f0fe/install.go#L316)

mattn commented 7 years ago

could you please update gom?

syohex commented 7 years ago

Error is gone. Thanks.