|
@@ -1,7 +1,7 @@
|
|
|
-From 8b2feaee81d7a16adc59e61d06c1e7314d3a5408 Mon Sep 17 00:00:00 2001
|
|
|
+From 47db69e20ed66fb62b01affd83d829654b829893 Mon Sep 17 00:00:00 2001
|
|
|
From: Matt Madison <matt@madison.systems>
|
|
|
Date: Mon, 19 Feb 2018 08:50:59 -0800
|
|
|
-Subject: [PATCH 2/9] cmd/go: make content-based hash generation less pedantic
|
|
|
+Subject: [PATCH] cmd/go: make content-based hash generation less pedantic
|
|
|
|
|
|
Go 1.10's build tool now uses content-based hashes to
|
|
|
determine when something should be built or re-built.
|
|
@@ -41,17 +41,18 @@ by setting the CGO_PEDANTIC environment variable.
|
|
|
Upstream-Status: Inappropriate [OE specific]
|
|
|
|
|
|
Signed-off-by: Matt Madison <matt@madison.systems>
|
|
|
+
|
|
|
---
|
|
|
src/cmd/go/internal/envcmd/env.go | 2 +-
|
|
|
- src/cmd/go/internal/work/exec.go | 63 ++++++++++++++++++++++++++++-----------
|
|
|
+ src/cmd/go/internal/work/exec.go | 63 ++++++++++++++++++++++---------
|
|
|
2 files changed, 46 insertions(+), 19 deletions(-)
|
|
|
|
|
|
diff --git a/src/cmd/go/internal/envcmd/env.go b/src/cmd/go/internal/envcmd/env.go
|
|
|
-index f891123f9c..ebacfbfdbc 100644
|
|
|
+index cedbfbf..5763a0d 100644
|
|
|
--- a/src/cmd/go/internal/envcmd/env.go
|
|
|
+++ b/src/cmd/go/internal/envcmd/env.go
|
|
|
-@@ -113,7 +113,7 @@ func findEnv(env []cfg.EnvVar, name string) string {
|
|
|
- func ExtraEnvVars() []cfg.EnvVar {
|
|
|
+@@ -128,7 +128,7 @@ func ExtraEnvVars() []cfg.EnvVar {
|
|
|
+ func ExtraEnvVarsCostly() []cfg.EnvVar {
|
|
|
var b work.Builder
|
|
|
b.Init()
|
|
|
- cppflags, cflags, cxxflags, fflags, ldflags, err := b.CFlags(&load.Package{})
|
|
@@ -60,10 +61,10 @@ index f891123f9c..ebacfbfdbc 100644
|
|
|
// Should not happen - b.CFlags was given an empty package.
|
|
|
fmt.Fprintf(os.Stderr, "go: invalid cflags: %v\n", err)
|
|
|
diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go
|
|
|
-index c4c1500eb2..b0f6b45647 100644
|
|
|
+index 12e1527..e41bfac 100644
|
|
|
--- a/src/cmd/go/internal/work/exec.go
|
|
|
+++ b/src/cmd/go/internal/work/exec.go
|
|
|
-@@ -173,6 +173,8 @@ func (b *Builder) Do(root *Action) {
|
|
|
+@@ -174,6 +174,8 @@ func (b *Builder) Do(root *Action) {
|
|
|
wg.Wait()
|
|
|
}
|
|
|
|
|
@@ -72,7 +73,7 @@ index c4c1500eb2..b0f6b45647 100644
|
|
|
// buildActionID computes the action ID for a build action.
|
|
|
func (b *Builder) buildActionID(a *Action) cache.ActionID {
|
|
|
p := a.Package
|
|
|
-@@ -189,7 +191,7 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID {
|
|
|
+@@ -190,7 +192,7 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID {
|
|
|
// but it does not hide the exact value of $GOPATH.
|
|
|
// Include the full dir in that case.
|
|
|
// Assume b.WorkDir is being trimmed properly.
|
|
@@ -81,14 +82,14 @@ index c4c1500eb2..b0f6b45647 100644
|
|
|
fmt.Fprintf(h, "dir %s\n", p.Dir)
|
|
|
}
|
|
|
fmt.Fprintf(h, "goos %s goarch %s\n", cfg.Goos, cfg.Goarch)
|
|
|
-@@ -197,13 +199,13 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID {
|
|
|
- fmt.Fprintf(h, "omitdebug %v standard %v local %v prefix %q\n", p.Internal.OmitDebug, p.Standard, p.Internal.Local, p.Internal.LocalPrefix)
|
|
|
+@@ -201,13 +203,13 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID {
|
|
|
+ }
|
|
|
if len(p.CgoFiles)+len(p.SwigFiles) > 0 {
|
|
|
fmt.Fprintf(h, "cgo %q\n", b.toolID("cgo"))
|
|
|
-- cppflags, cflags, cxxflags, fflags, _, _ := b.CFlags(p)
|
|
|
-- fmt.Fprintf(h, "CC=%q %q %q\n", b.ccExe(), cppflags, cflags)
|
|
|
-+ cppflags, cflags, cxxflags, fflags, _, _ := b.CFlags(p, true)
|
|
|
-+ fmt.Fprintf(h, "CC=%q %q %q\n", b.ccExe(true), cppflags, cflags)
|
|
|
+- cppflags, cflags, cxxflags, fflags, ldflags, _ := b.CFlags(p)
|
|
|
+- fmt.Fprintf(h, "CC=%q %q %q %q\n", b.ccExe(), cppflags, cflags, ldflags)
|
|
|
++ cppflags, cflags, cxxflags, fflags, ldflags, _ := b.CFlags(p, true)
|
|
|
++ fmt.Fprintf(h, "CC=%q %q %q %q\n", b.ccExe(true), cppflags, cflags, ldflags)
|
|
|
if len(p.CXXFiles)+len(p.SwigFiles) > 0 {
|
|
|
- fmt.Fprintf(h, "CXX=%q %q\n", b.cxxExe(), cxxflags)
|
|
|
+ fmt.Fprintf(h, "CXX=%q %q\n", b.cxxExe(true), cxxflags)
|
|
@@ -99,7 +100,7 @@ index c4c1500eb2..b0f6b45647 100644
|
|
|
}
|
|
|
// TODO(rsc): Should we include the SWIG version or Fortran/GCC/G++/Objective-C compiler versions?
|
|
|
}
|
|
|
-@@ -1731,33 +1733,33 @@ var (
|
|
|
+@@ -2096,33 +2098,33 @@ var (
|
|
|
// gccCmd returns a gcc command line prefix
|
|
|
// defaultCC is defined in zdefaultcc.go, written by cmd/dist.
|
|
|
func (b *Builder) GccCmd(incdir, workdir string) []string {
|
|
@@ -142,7 +143,7 @@ index c4c1500eb2..b0f6b45647 100644
|
|
|
}
|
|
|
|
|
|
// compilerExe returns the compiler to use given an
|
|
|
-@@ -1766,11 +1768,14 @@ func (b *Builder) fcExe() []string {
|
|
|
+@@ -2131,11 +2133,14 @@ func (b *Builder) fcExe() []string {
|
|
|
// of the compiler but can have additional arguments if they
|
|
|
// were present in the environment value.
|
|
|
// For example if CC="gcc -DGOPHER" then the result is ["gcc", "-DGOPHER"].
|
|
@@ -158,7 +159,7 @@ index c4c1500eb2..b0f6b45647 100644
|
|
|
return compiler
|
|
|
}
|
|
|
|
|
|
-@@ -1920,8 +1925,23 @@ func envList(key, def string) []string {
|
|
|
+@@ -2285,8 +2290,23 @@ func envList(key, def string) []string {
|
|
|
return strings.Fields(v)
|
|
|
}
|
|
|
|
|
@@ -183,7 +184,7 @@ index c4c1500eb2..b0f6b45647 100644
|
|
|
defaults := "-g -O2"
|
|
|
|
|
|
if cppflags, err = buildFlags("CPPFLAGS", "", p.CgoCPPFLAGS, checkCompilerFlags); err != nil {
|
|
|
-@@ -1939,6 +1959,13 @@ func (b *Builder) CFlags(p *load.Package) (cppflags, cflags, cxxflags, fflags, l
|
|
|
+@@ -2304,6 +2324,13 @@ func (b *Builder) CFlags(p *load.Package) (cppflags, cflags, cxxflags, fflags, l
|
|
|
if ldflags, err = buildFlags("LDFLAGS", defaults, p.CgoLDFLAGS, checkLinkerFlags); err != nil {
|
|
|
return
|
|
|
}
|
|
@@ -197,7 +198,7 @@ index c4c1500eb2..b0f6b45647 100644
|
|
|
|
|
|
return
|
|
|
}
|
|
|
-@@ -1954,7 +1981,7 @@ var cgoRe = regexp.MustCompile(`[/\\:]`)
|
|
|
+@@ -2319,7 +2346,7 @@ var cgoRe = regexp.MustCompile(`[/\\:]`)
|
|
|
|
|
|
func (b *Builder) cgo(a *Action, cgoExe, objdir string, pcCFLAGS, pcLDFLAGS, cgofiles, gccfiles, gxxfiles, mfiles, ffiles []string) (outGo, outObj []string, err error) {
|
|
|
p := a.Package
|
|
@@ -206,7 +207,7 @@ index c4c1500eb2..b0f6b45647 100644
|
|
|
if err != nil {
|
|
|
return nil, nil, err
|
|
|
}
|
|
|
-@@ -2306,7 +2333,7 @@ func (b *Builder) swigIntSize(objdir string) (intsize string, err error) {
|
|
|
+@@ -2679,7 +2706,7 @@ func (b *Builder) swigIntSize(objdir string) (intsize string, err error) {
|
|
|
|
|
|
// Run SWIG on one SWIG input file.
|
|
|
func (b *Builder) swigOne(a *Action, p *load.Package, file, objdir string, pcCFLAGS []string, cxx bool, intgosize string) (outGo, outC string, err error) {
|
|
@@ -215,6 +216,3 @@ index c4c1500eb2..b0f6b45647 100644
|
|
|
if err != nil {
|
|
|
return "", "", err
|
|
|
}
|
|
|
---
|
|
|
-2.14.1
|
|
|
-
|