nomad-software / vend

A dependency vendor for Go programs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

vend deleted go.exe

allaryin opened this issue · comments

I... seriously.

$ go get github.com/nomad-software/vend
go: finding github.com/nomad-software/vend latest
go: finding golang.org/x/sys v0.0.0-20181218192612-074acd46bca6
go: downloading github.com/nomad-software/vend v0.0.0-20181222113412-fb70e2a0dee9
go: extracting github.com/nomad-software/vend v0.0.0-20181222113412-fb70e2a0dee9

$ cd <project directory in question>

$ vend
download:, exit status 1073741845

$ vend -package
tidy:, exec: "go": executable file not found in %PATH%

$ go
'go' is not recognized as an internal or external command,
operable program or batch file.

$ which go
which: no go in (C:\Program Files\...snip...)

$ dir c:\go\bin
 Volume in drive C is OS
 Volume Serial Number is 58BF-59A1

 Directory of c:\go\bin

04/02/2019  10:16 AM    <DIR>          .
04/02/2019  10:16 AM    <DIR>          ..
02/25/2019  11:09 PM        17,127,424 godoc.exe
02/25/2019  11:09 PM         3,640,320 gofmt.exe
               2 File(s)     20,767,744 bytes
               2 Dir(s)  176,467,365,888 bytes free

The go.mod was touched, but unchanged. The vendor directory in question was unchanged.

Looking over your code, I can't see anything suspicious - but it looks like the error happened when the initial go mod download failed to run (and in fact exited with a STATUS-FATAL-APP-EXIT)...

...

After re-installing go (1.12.1), both vend and vend -package worked.

However, they are not pulling in all sources - one of our dependencies is a private git repo. The initial attempt to clone the private mod may have been what catalyzed the go.exe deletion issue in the first place?

At the very least, failure to download a module after trying to do so should be logged.

I seriously doubt vend deleted anything but the vendor folder. If there was any problem doing that, it would have been reported on the command line.

vend is a very simple program, it deletes the vendor folder in the current directory then copies directories reported by go mod download -json. It's that simple. vend does not download anything.

Like I said, I didn't find any likely culprit in your code, but what happened happened. I'm concerned this might be a bug in go mod download that was somehow only exposed when run this way.