gobuffalo / buffalo

Rapid Web Development w/ Go
http://gobuffalo.io
MIT License
8.08k stars 577 forks source link

Build failure with -mod=vendor #1698

Closed dmgk closed 5 years ago

dmgk commented 5 years ago
$ go install -tags "sqlite" -v -buildmode=exe -mod=vendor ./buffalo

build github.com/gobuffalo/buffalo/buffalo: cannot load github.com/gobuffalo/gitgen: open /wrkdirs/usr/ports/www/gobuffalo/work/buffalo-0.14.6/vendor/github.com/gobuffalo/gitgen: no such file or directory

It appears that go.mod is missing github.com/gobuffalo/gitgen. Reproducible on both master and v0.14.6.

markbates commented 5 years ago

Buffalo has build time dependencies, which is your problem. if you switch to using buffalo build or buffalo build you shouldn't have the issue. Subsequently, you can manually add those build time requirements to your go.mod.

dmgk commented 5 years ago

Perhaps I wasn't clear enough - this error was happening when building buffalo v0.14.6 itself, not buffalo project. It was caused by github.com/gobuffalo/gitgen being referenced only in github.com/gobuffalo/genny go.mod and not used anywhere in genny code (I guess that made go mod vendor to skip gitgen during vendoring).

The issue was specific to v0.14.6 and doesn't happen with current master.