Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Commit

Permalink
Skip -i flag in go build if modules are enabled (#1337)
Browse files Browse the repository at this point in the history
Using -i flag when running go build is not useful with go modules enabled
and in some cases can lead to a bug, with go trying to rebuild
shipped vendorized dependencies as described in this issue
golang/go#27285.
With this commit we check if go modules are enabled and we drop the -i
flag accordingly.
  • Loading branch information
cippaciong authored and markbates committed Sep 29, 2018
1 parent 9a57be6 commit 426c84d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion buffalo/cmd/build/bin.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,20 @@ import (
"strings"

"github.com/gobuffalo/envy"
"github.com/gobuffalo/genny/movinglater/gotools/gomods"
"github.com/pkg/errors"
)

func (b *Builder) buildBin() error {
buildArgs := []string{"build", "-i"}
buildArgs := []string{"build"}
if b.Debug {
buildArgs = append(buildArgs, "-v")
}

if !gomods.On() {
buildArgs = append(buildArgs, "-i")
}

tf := b.App.BuildTags(b.Environment, b.Tags...)
buildArgs = append(buildArgs, "-tags", tf.String())

Expand Down

0 comments on commit 426c84d

Please sign in to comment.