diff --git a/tools/please_go/ChangeLog b/tools/please_go/ChangeLog index 8de52759..75834162 100644 --- a/tools/please_go/ChangeLog +++ b/tools/please_go/ChangeLog @@ -1,3 +1,7 @@ +Version 1.4.4 +------------- + * Don't set `_module` on go_binary commands in `go_repo` + Version 1.4.3 ------------- * Don't try and pipe test output as it doesn't flush when the TestMain calls os.Exit diff --git a/tools/please_go/VERSION b/tools/please_go/VERSION index 3c80e4f0..e1df5de7 100644 --- a/tools/please_go/VERSION +++ b/tools/please_go/VERSION @@ -1 +1 @@ -1.4.3 \ No newline at end of file +1.4.4 \ No newline at end of file diff --git a/tools/please_go/generate/generate.go b/tools/please_go/generate/generate.go index d0c68eff..5ee42c5a 100644 --- a/tools/please_go/generate/generate.go +++ b/tools/please_go/generate/generate.go @@ -203,7 +203,7 @@ func (g *Generate) generate(dir string) error { return err } - lib := g.libRule(pkg, dir) + lib := g.ruleForPackage(pkg, dir) if lib == nil { return nil } @@ -336,7 +336,7 @@ func (g *Generate) depTargets(imports []string) []string { return deps } -func (g *Generate) libRule(pkg *build.Package, dir string) *Rule { +func (g *Generate) ruleForPackage(pkg *build.Package, dir string) *Rule { if len(pkg.GoFiles) == 0 && len(pkg.CgoFiles) == 0 { return nil } @@ -356,6 +356,7 @@ func (g *Generate) libRule(pkg *build.Package, dir string) *Rule { hdrs: pkg.HFiles, deps: g.depTargets(pkg.Imports), embedPatterns: pkg.EmbedPatterns, + isCMD: pkg.IsCommand(), } } diff --git a/tools/please_go/generate/rules.go b/tools/please_go/generate/rules.go index 802af054..80d089c6 100644 --- a/tools/please_go/generate/rules.go +++ b/tools/please_go/generate/rules.go @@ -16,7 +16,7 @@ type Rule struct { deps []string embedPatterns []string // TODO(jpoole): handle external test - external bool + external, isCMD bool } func populateRule(r *build.Rule, targetState *Rule) { @@ -55,5 +55,7 @@ func populateRule(r *build.Rule, targetState *Rule) { }, }) } - r.SetAttr("_module", NewStringExpr(targetState.module)) + if !targetState.isCMD { + r.SetAttr("_module", NewStringExpr(targetState.module)) + } }