Skip to contentSkip to conversation

go: Upgrade compiler to 1.16 major release

PATCH In review Khem Raj 4 participants 6 messages Feb 24, 2021 – Mar 22, 2021

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH v2 1/3 go: Upgrade compiler to 1.16 major release

Revert a CC/CXX check [1] which wont work with OE settings Forward port needed patches forward

Details releaase notes are here [2]

[1] https://go-review.googlesource.com/c/go/+/228517/
[2] https://golang.org/doc/go1.16

---
 meta/conf/distro/include/tcmode-default.inc   |  2 +-
 .../go/{go-1.15.inc => go-1.16.inc}           |  7 +-
 ...ow-CC-and-CXX-to-have-multiple-words.patch |  0
 ...ent-based-hash-generation-less-pedan.patch | 22 ++---
 ...-to-be-overridden-in-the-environment.patch |  0
 ...4-ld-add-soname-to-shareable-objects.patch | 12 +--
 ...de-CC-when-building-dist-and-go_boot.patch |  0
 ...dist-separate-host-and-target-builds.patch |  0
 ...d-go-make-GOROOT-precious-by-default.patch |  0
 ...008-use-GOBUILDMODE-to-set-buildmode.patch |  0
 ...go-make-sure-CC-and-CXX-are-absolute.patch | 95 +++++++++++++++++++
 ...ive_1.15.8.bb => go-binary-native_1.16.bb} |  4 +-
 ...dian_1.15.bb => go-cross-canadian_1.16.bb} |  0
 .../go/{go-cross_1.15.bb => go-cross_1.16.bb} |  0
 ...o-crosssdk_1.15.bb => go-crosssdk_1.16.bb} |  0
 .../{go-native_1.15.bb => go-native_1.16.bb}  |  0
 ...{go-runtime_1.15.bb => go-runtime_1.16.bb} |  0
 .../go/{go_1.15.bb => go_1.16.bb}             |  0
 18 files changed, 119 insertions(+), 23 deletions(-)
 rename meta/recipes-devtools/go/{go-1.15.inc => go-1.16.inc} (78%)
 rename meta/recipes-devtools/go/{go-1.15 => go-1.16}/0001-allow-CC-and-CXX-to-have-multiple-words.patch (100%)
 rename meta/recipes-devtools/go/{go-1.15 => go-1.16}/0002-cmd-go-make-content-based-hash-generation-less-pedan.patch (93%)
 rename meta/recipes-devtools/go/{go-1.15 => go-1.16}/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch (100%)
 rename meta/recipes-devtools/go/{go-1.15 => go-1.16}/0004-ld-add-soname-to-shareable-objects.patch (80%)
 rename meta/recipes-devtools/go/{go-1.15 => go-1.16}/0005-make.bash-override-CC-when-building-dist-and-go_boot.patch (100%)
 rename meta/recipes-devtools/go/{go-1.15 => go-1.16}/0006-cmd-dist-separate-host-and-target-builds.patch (100%)
 rename meta/recipes-devtools/go/{go-1.15 => go-1.16}/0007-cmd-go-make-GOROOT-precious-by-default.patch (100%)
 rename meta/recipes-devtools/go/{go-1.15 => go-1.16}/0008-use-GOBUILDMODE-to-set-buildmode.patch (100%)
 create mode 100644 meta/recipes-devtools/go/go-1.16/0009-Revert-cmd-go-make-sure-CC-and-CXX-are-absolute.patch
 rename meta/recipes-devtools/go/{go-binary-native_1.15.8.bb => go-binary-native_1.16.bb} (83%)
 rename meta/recipes-devtools/go/{go-cross-canadian_1.15.bb => go-cross-canadian_1.16.bb} (100%)
 rename meta/recipes-devtools/go/{go-cross_1.15.bb => go-cross_1.16.bb} (100%)
 rename meta/recipes-devtools/go/{go-crosssdk_1.15.bb => go-crosssdk_1.16.bb} (100%)
 rename meta/recipes-devtools/go/{go-native_1.15.bb => go-native_1.16.bb} (100%)
 rename meta/recipes-devtools/go/{go-runtime_1.15.bb => go-runtime_1.16.bb} (100%)
 rename meta/recipes-devtools/go/{go_1.15.bb => go_1.16.bb} (100%)
meta/conf/distro/include/tcmode-default.inc +1 -1
index 8df328dc0d..8e454f74a5 100644
@@ -23,7 +23,7 @@ GDBVERSION ?= "10.%"
 GLIBCVERSION ?= "2.33"
 LINUXLIBCVERSION ?= "5.10%"
 QEMUVERSION ?= "5.2%"
-GOVERSION ?= "1.15%"
+GOVERSION ?= "1.16%"
 # This can not use wildcards like 8.0.% since it is also used in mesa to denote
 # llvm version being used, so always bump it with llvm recipe version bump
 LLVMVERSION ?= "10.0.1"
meta/recipes-devtools/go/go-1.16.inc renamed from meta/recipes-devtools/go/go-1.15.inc +4 -3
similarity index 78%
rename from meta/recipes-devtools/go/go-1.15.inc
rename to meta/recipes-devtools/go/go-1.16.inc
index 7c8190f68c..1ebbbef833 100644
@@ -1,7 +1,7 @@
 require go-common.inc
 
-GO_BASEVERSION = "1.15"
-PV = "1.15.8"
+GO_BASEVERSION = "1.16"
+PV = "1.16"
 FILESEXTRAPATHS_prepend := "${FILE_DIRNAME}/go-${GO_BASEVERSION}:"
 
 LIC_FILES_CHKSUM = "file://LICENSE;md5=5d4950ecb7b26d2c5e4e7b4e0dd74707"
@@ -15,5 +15,6 @@ SRC_URI += "\
     file://0006-cmd-dist-separate-host-and-target-builds.patch \
     file://0007-cmd-go-make-GOROOT-precious-by-default.patch \
     file://0008-use-GOBUILDMODE-to-set-buildmode.patch \
+    file://0009-Revert-cmd-go-make-sure-CC-and-CXX-are-absolute.patch \
 "
-SRC_URI[main.sha256sum] = "540c0ab7781084d124991321ed1458e479982de94454a98afab6acadf38497c2"
+SRC_URI[main.sha256sum] = "7688063d55656105898f323d90a79a39c378d86fe89ae192eb3b7fc46347c95a"
meta/recipes-devtools/go/go-1.16/0001-allow-CC-and-CXX-to-have-multiple-words.patch renamed from meta/recipes-devtools/go/go-1.15/0001-allow-CC-and-CXX-to-have-multiple-words.patch +0 -0
similarity index 100%
rename from meta/recipes-devtools/go/go-1.15/0001-allow-CC-and-CXX-to-have-multiple-words.patch
rename to meta/recipes-devtools/go/go-1.16/0001-allow-CC-and-CXX-to-have-multiple-words.patch
meta/recipes-devtools/go/go-1.16/0002-cmd-go-make-content-based-hash-generation-less-pedan.patch renamed from meta/recipes-devtools/go/go-1.15/0002-cmd-go-make-content-based-hash-generation-less-pedan.patch +11 -11
similarity index 93%
rename from meta/recipes-devtools/go/go-1.15/0002-cmd-go-make-content-based-hash-generation-less-pedan.patch
rename to meta/recipes-devtools/go/go-1.16/0002-cmd-go-make-content-based-hash-generation-less-pedan.patch
index d0511c0c40..04d0e496c0 100644
@@ -63,8 +63,8 @@ Signed-off-by: Alexander J Kube <[email protected]>
  		fmt.Fprintf(os.Stderr, "go: invalid cflags: %v\n", err)
 --- a/src/cmd/go/internal/work/exec.go
 +++ b/src/cmd/go/internal/work/exec.go
-@@ -33,6 +33,8 @@ import (
- 	"cmd/go/internal/str"
+@@ -37,6 +37,8 @@ import (
+ 	"cmd/go/internal/trace"
  )
  
 +var omitGopath = os.Getenv("GOPATH_OMIT_IN_ACTIONID") != ""
@@ -72,7 +72,7 @@ Signed-off-by: Alexander J Kube <[email protected]>
  // actionList returns the list of actions in the dag rooted at root
  // as visited in a depth-first post-order traversal.
  func actionList(root *Action) []*Action {
-@@ -209,7 +211,7 @@ func (b *Builder) buildActionID(a *Actio
+@@ -228,7 +230,7 @@ func (b *Builder) buildActionID(a *Actio
  	// Assume b.WorkDir is being trimmed properly.
  	// When -trimpath is used with a package built from the module cache,
  	// use the module path and version instead of the directory.
@@ -81,7 +81,7 @@ Signed-off-by: Alexander J Kube <[email protected]>
  		fmt.Fprintf(h, "dir %s\n", p.Dir)
  	} else if cfg.BuildTrimpath && p.Module != nil {
  		fmt.Fprintf(h, "module %s@%s\n", p.Module.Path, p.Module.Version)
-@@ -228,13 +230,13 @@ func (b *Builder) buildActionID(a *Actio
+@@ -247,13 +249,13 @@ func (b *Builder) buildActionID(a *Actio
  	}
  	if len(p.CgoFiles)+len(p.SwigFiles) > 0 {
  		fmt.Fprintf(h, "cgo %q\n", b.toolID("cgo"))
@@ -99,7 +99,7 @@ Signed-off-by: Alexander J Kube <[email protected]>
  		}
  		// TODO(rsc): Should we include the SWIG version or Fortran/GCC/G++/Objective-C compiler versions?
  	}
-@@ -2298,33 +2300,48 @@ var (
+@@ -2401,33 +2403,48 @@ 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 {
@@ -157,7 +157,7 @@ Signed-off-by: Alexander J Kube <[email protected]>
  }
  
  // compilerExe returns the compiler to use given an
-@@ -2333,11 +2350,16 @@ func (b *Builder) fcExe() []string {
+@@ -2436,11 +2453,16 @@ 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"].
@@ -165,7 +165,7 @@ Signed-off-by: Alexander J Kube <[email protected]>
 +func (b *Builder) compilerExe(envValue string, def string, filtered bool) []string {
  	compiler := strings.Fields(envValue)
  	if len(compiler) == 0 {
- 		compiler = []string{def}
+ 		compiler = strings.Fields(def)
  	}
 +
 +	if filtered {
@@ -175,7 +175,7 @@ Signed-off-by: Alexander J Kube <[email protected]>
  	return compiler
  }
  
-@@ -2510,7 +2532,7 @@ func envList(key, def string) []string {
+@@ -2620,7 +2642,7 @@ func envList(key, def string) []string {
  }
  
  // CFlags returns the flags to use when invoking the C, C++ or Fortran compilers, or cgo.
@@ -184,7 +184,7 @@ Signed-off-by: Alexander J Kube <[email protected]>
  	defaults := "-g -O2"
  
  	if cppflags, err = buildFlags("CPPFLAGS", "", p.CgoCPPFLAGS, checkCompilerFlags); err != nil {
-@@ -2529,6 +2551,14 @@ func (b *Builder) CFlags(p *load.Package
+@@ -2639,6 +2661,14 @@ func (b *Builder) CFlags(p *load.Package
  		return
  	}
  
@@ -199,7 +199,7 @@ Signed-off-by: Alexander J Kube <[email protected]>
  	return
  }
  
-@@ -2543,7 +2573,7 @@ var cgoRe = lazyregexp.New(`[/\\:]`)
+@@ -2653,7 +2683,7 @@ var cgoRe = lazyregexp.New(`[/\\:]`)
  
  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
@@ -208,7 +208,7 @@ Signed-off-by: Alexander J Kube <[email protected]>
  	if err != nil {
  		return nil, nil, err
  	}
-@@ -2902,7 +2932,7 @@ func (b *Builder) swigIntSize(objdir str
+@@ -3104,7 +3134,7 @@ func (b *Builder) swigIntSize(objdir str
  
  // 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) {
meta/recipes-devtools/go/go-1.16/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch renamed from meta/recipes-devtools/go/go-1.15/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch +0 -0
similarity index 100%
rename from meta/recipes-devtools/go/go-1.15/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch
rename to meta/recipes-devtools/go/go-1.16/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch
meta/recipes-devtools/go/go-1.16/0004-ld-add-soname-to-shareable-objects.patch renamed from meta/recipes-devtools/go/go-1.15/0004-ld-add-soname-to-shareable-objects.patch +6 -6
similarity index 80%
rename from meta/recipes-devtools/go/go-1.15/0004-ld-add-soname-to-shareable-objects.patch
rename to meta/recipes-devtools/go/go-1.16/0004-ld-add-soname-to-shareable-objects.patch
index da29923920..cd875f1164 100644
@@ -19,15 +19,15 @@ Signed-off-by: Alexander J Kube <[email protected]>
 
 --- a/src/cmd/link/internal/ld/lib.go
 +++ b/src/cmd/link/internal/ld/lib.go
-@@ -1446,6 +1446,7 @@ func (ctxt *Link) hostlink() {
+@@ -1343,6 +1343,7 @@ func (ctxt *Link) hostlink() {
  				argv = append(argv, "-Wl,-z,relro")
  			}
  			argv = append(argv, "-shared")
 +			argv = append(argv, fmt.Sprintf("-Wl,-soname,%s", filepath.Base(*flagOutfile)))
- 			if ctxt.HeadType != objabi.Hwindows {
- 				// Pass -z nodelete to mark the shared library as
- 				// non-closeable: a dlclose will do nothing.
-@@ -1457,6 +1458,7 @@ func (ctxt *Link) hostlink() {
+ 			if ctxt.HeadType == objabi.Hwindows {
+ 				if *flagAslr {
+ 					argv = addASLRargs(argv)
+@@ -1358,6 +1359,7 @@ func (ctxt *Link) hostlink() {
  			argv = append(argv, "-Wl,-z,relro")
  		}
  		argv = append(argv, "-shared")
@@ -35,7 +35,7 @@ Signed-off-by: Alexander J Kube <[email protected]>
  	case BuildModePlugin:
  		if ctxt.HeadType == objabi.Hdarwin {
  			argv = append(argv, "-dynamiclib")
-@@ -1465,6 +1467,7 @@ func (ctxt *Link) hostlink() {
+@@ -1366,6 +1368,7 @@ func (ctxt *Link) hostlink() {
  				argv = append(argv, "-Wl,-z,relro")
  			}
  			argv = append(argv, "-shared")
meta/recipes-devtools/go/go-1.16/0005-make.bash-override-CC-when-building-dist-and-go_boot.patch renamed from meta/recipes-devtools/go/go-1.15/0005-make.bash-override-CC-when-building-dist-and-go_boot.patch +0 -0
similarity index 100%
rename from meta/recipes-devtools/go/go-1.15/0005-make.bash-override-CC-when-building-dist-and-go_boot.patch
rename to meta/recipes-devtools/go/go-1.16/0005-make.bash-override-CC-when-building-dist-and-go_boot.patch
meta/recipes-devtools/go/go-1.16/0006-cmd-dist-separate-host-and-target-builds.patch renamed from meta/recipes-devtools/go/go-1.15/0006-cmd-dist-separate-host-and-target-builds.patch +0 -0
similarity index 100%
rename from meta/recipes-devtools/go/go-1.15/0006-cmd-dist-separate-host-and-target-builds.patch
rename to meta/recipes-devtools/go/go-1.16/0006-cmd-dist-separate-host-and-target-builds.patch
meta/recipes-devtools/go/go-1.16/0007-cmd-go-make-GOROOT-precious-by-default.patch renamed from meta/recipes-devtools/go/go-1.15/0007-cmd-go-make-GOROOT-precious-by-default.patch +0 -0
similarity index 100%
rename from meta/recipes-devtools/go/go-1.15/0007-cmd-go-make-GOROOT-precious-by-default.patch
rename to meta/recipes-devtools/go/go-1.16/0007-cmd-go-make-GOROOT-precious-by-default.patch
meta/recipes-devtools/go/go-1.16/0008-use-GOBUILDMODE-to-set-buildmode.patch renamed from meta/recipes-devtools/go/go-1.15/0008-use-GOBUILDMODE-to-set-buildmode.patch +0 -0
similarity index 100%
rename from meta/recipes-devtools/go/go-1.15/0008-use-GOBUILDMODE-to-set-buildmode.patch
rename to meta/recipes-devtools/go/go-1.16/0008-use-GOBUILDMODE-to-set-buildmode.patch
meta/recipes-devtools/go/go-1.16/0009-Revert-cmd-go-make-sure-CC-and-CXX-are-absolute.patch new file +95 -0

95 lines not on this page · raw message

meta/recipes-devtools/go/go-binary-native_1.16.bb renamed from meta/recipes-devtools/go/go-binary-native_1.15.8.bb +2 -2
similarity index 83%
rename from meta/recipes-devtools/go/go-binary-native_1.15.8.bb
rename to meta/recipes-devtools/go/go-binary-native_1.16.bb
index df697e2781..155a475c95 100644
@@ -8,8 +8,8 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=5d4950ecb7b26d2c5e4e7b4e0dd74707"
 PROVIDES = "go-native"
 
 SRC_URI = "https://dl.google.com/go/go${PV}.${BUILD_GOOS}-${BUILD_GOARCH}.tar.gz;name=go_${BUILD_GOTUPLE}"
-SRC_URI[go_linux_amd64.sha256sum] = "d3379c32a90fdf9382166f8f48034c459a8cc433730bc9476d39d9082c94583b"
-SRC_URI[go_linux_arm64.sha256sum] = "0e31ea4bf53496b0f0809730520dee98c0ae5c530f3701a19df0ba0a327bf3d2"
+SRC_URI[go_linux_amd64.sha256sum] = "013a489ebb3e24ef3d915abe5b94c3286c070dfe0818d5bca8108f1d6e8440d2"
+SRC_URI[go_linux_arm64.sha256sum] = "3770f7eb22d05e25fbee8fb53c2a4e897da043eb83c69b9a14f8d98562cd8098"
 
 UPSTREAM_CHECK_URI = "https://golang.org/dl/"
 UPSTREAM_CHECK_REGEX = "go(?P<pver>\d+(\.\d+)+)\.linux"
meta/recipes-devtools/go/go-cross-canadian_1.16.bb renamed from meta/recipes-devtools/go/go-cross-canadian_1.15.bb +0 -0
similarity index 100%
rename from meta/recipes-devtools/go/go-cross-canadian_1.15.bb
rename to meta/recipes-devtools/go/go-cross-canadian_1.16.bb
meta/recipes-devtools/go/go-cross_1.16.bb renamed from meta/recipes-devtools/go/go-cross_1.15.bb +0 -0
similarity index 100%
rename from meta/recipes-devtools/go/go-cross_1.15.bb
rename to meta/recipes-devtools/go/go-cross_1.16.bb
meta/recipes-devtools/go/go-crosssdk_1.16.bb renamed from meta/recipes-devtools/go/go-crosssdk_1.15.bb +0 -0
similarity index 100%
rename from meta/recipes-devtools/go/go-crosssdk_1.15.bb
rename to meta/recipes-devtools/go/go-crosssdk_1.16.bb
meta/recipes-devtools/go/go-native_1.16.bb renamed from meta/recipes-devtools/go/go-native_1.15.bb +0 -0
similarity index 100%
rename from meta/recipes-devtools/go/go-native_1.15.bb
rename to meta/recipes-devtools/go/go-native_1.16.bb
meta/recipes-devtools/go/go-runtime_1.16.bb renamed from meta/recipes-devtools/go/go-runtime_1.15.bb +0 -0
similarity index 100%
rename from meta/recipes-devtools/go/go-runtime_1.15.bb
rename to meta/recipes-devtools/go/go-runtime_1.16.bb
meta/recipes-devtools/go/go_1.16.bb renamed from meta/recipes-devtools/go/go_1.15.bb +0 -0
similarity index 100%
rename from meta/recipes-devtools/go/go_1.15.bb
rename to meta/recipes-devtools/go/go_1.16.bb
Signature · 1 line
2.30.1
author
#1 lore raw

PATCH v2 2/3 go: Enable CGO and pie buildmode on rv64

go1.16 has added CGO support for riscv64 arch

---
 meta/classes/go.bbclass                     | 5 ++---
 meta/recipes-devtools/go/go-runtime_1.16.bb | 1 -
 meta/recipes-devtools/go/go_1.16.bb         | 5 ++---
 3 files changed, 4 insertions(+), 7 deletions(-)
meta/classes/go.bbclass +2 -3
index fa147892b0..77ec98dd51 100644
@@ -54,7 +54,6 @@ GOTOOLDIR_class-native = "${STAGING_LIBDIR_NATIVE}/go/pkg/tool/${BUILD_GOTUPLE}"
 export GOTOOLDIR
 
 export CGO_ENABLED ?= "1"
-export CGO_ENABLED_riscv64 = "0"
 export CGO_CFLAGS ?= "${CFLAGS}"
 export CGO_CPPFLAGS ?= "${CPPFLAGS}"
 export CGO_CXXFLAGS ?= "${CXXFLAGS}"
@@ -147,10 +146,10 @@ FILES_${PN}-staticdev = "${libdir}/go/pkg"
 INSANE_SKIP_${PN} += "ldflags"
 
 # Add -buildmode=pie to GOBUILDFLAGS to satisfy "textrel" QA checking, but mips
-# doesn't support -buildmode=pie, so skip the QA checking for mips and its
+# doesn't support -buildmode=pie, so skip the QA checking for mips/rv32 and its
 # variants.
 python() {
-    if 'mips' in d.getVar('TARGET_ARCH') or 'riscv' in d.getVar('TARGET_ARCH'):
+    if 'mips' in d.getVar('TARGET_ARCH') or 'riscv32' in d.getVar('TARGET_ARCH'):
         d.appendVar('INSANE_SKIP_%s' % d.getVar('PN'), " textrel")
     else:
         d.appendVar('GOBUILDFLAGS', ' -buildmode=pie')
meta/recipes-devtools/go/go-runtime_1.16.bb +0 -1
index d6ddb31ed4..63464a1501 100644
@@ -1,4 +1,3 @@
-export CGO_ENABLED_riscv64 = ""
 require go-${PV}.inc
 require go-runtime.inc
 
meta/recipes-devtools/go/go_1.16.bb +2 -3
index d4812c0f0a..4e9e0ebec8 100644
@@ -4,15 +4,14 @@ require go-target.inc
 inherit linuxloader
 
 export GOBUILDMODE=""
-export CGO_ENABLED_riscv64 = ""
 export GO_LDSO = "${@get_linuxloader(d)}"
 export CC_FOR_TARGET = "gcc"
 export CXX_FOR_TARGET = "g++"
 
-# mips/rv64 doesn't support -buildmode=pie, so skip the QA checking for mips/riscv and its
+# mips/rv64 doesn't support -buildmode=pie, so skip the QA checking for mips/riscv32 and its
 # variants.
 python() {
-    if 'mips' in d.getVar('TARGET_ARCH',True) or 'riscv' in d.getVar('TARGET_ARCH',True):
+    if 'mips' in d.getVar('TARGET_ARCH',True) or 'riscv32' in d.getVar('TARGET_ARCH',True):
         d.appendVar('INSANE_SKIP_%s' % d.getVar('PN',True), " textrel")
 }
 
Signature · 1 line
2.30.1
author
#2 lore raw

PATCH v2 3/3 go-helloworld: Turn into a go module enabled build

In reply to Khem Raj
---
 meta/recipes-extended/go-examples/go-helloworld_0.1.bb | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
meta/recipes-extended/go-examples/go-helloworld_0.1.bb +3 -2
index ab70ea98a3..d3f7525dc9 100644
@@ -6,13 +6,14 @@ LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
 
 SRC_URI = "git://${GO_IMPORT}"
-SRCREV = "46695d81d1fae905a270fb7db8a4d11a334562fe"
+SRCREV = "bcf50bfd7dcd8020c90965747d857ae42802e0c5"
 UPSTREAM_CHECK_COMMITS = "1"
 
 GO_IMPORT = "github.com/golang/example"
 GO_INSTALL = "${GO_IMPORT}/hello"
+GO_WORKDIR = "${GO_INSTALL}"
 
-inherit go
+inherit go-mod
 
 # This is just to make clear where this example is
 do_install_append() {
Signature · 1 line
2.30.1
#3 lore raw

Re: [OE-core] [PATCH v2 3/3] go-helloworld: Turn into a go module enabled build

This is now failing when you are behind a proxy because it's trying to fetch those modules during do_compile().
https://github.com/golang/example/commit/bcf50bfd7dcd8020c90965747d857ae42802e0c5

Error log:

| ERROR: Execution of '~/build/tmp/work/corei7-64-poky-linux/go-helloworld/0.1-r0/temp/run.do_compile.26031' failed with exit code 1:
| go: golang.org/x/[email protected]: Get "https://proxy.golang.org/golang.org/x/tools/@v/v0.0.0-20210112183307-1e6ecd4bf1b0.mod": dial tcp 216.58.196.49:443: i/o timeout
| go: golang.org/x/[email protected]: Get "https://proxy.golang.org/golang.org/x/tools/@v/v0.0.0-20210112183307-1e6ecd4bf1b0.mod": dial tcp 216.58.196.49:443: i/o timeout

Regards,
Naveen

Quoted 40 lines

-----Original Message-----
From: [email protected] <openembedded- [email protected]> On Behalf Of Khem Raj
Sent: Wednesday, February 24, 2021 12:13 PM
To: [email protected]
Cc: Khem Raj <[email protected]>
Subject: [OE-core] [PATCH v2 3/3] go-helloworld: Turn into a go module enabled build

---
 meta/recipes-extended/go-examples/go-helloworld_0.1.bb | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
meta/recipes-extended/go-examples/go-helloworld_0.1.bb +0 -0
index ab70ea98a3..d3f7525dc9 100644
@@ -6,13 +6,14 @@ LICENSE = "MIT"
 LIC_FILES_CHKSUM =

"file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b 4f302"

SRC_URI = "git://${GO_IMPORT}"

meta/recipes-extended/go-examples/go-helloworld_0.1.bb +3 -3
-SRCREV = "46695d81d1fae905a270fb7db8a4d11a334562fe"
+SRCREV = "bcf50bfd7dcd8020c90965747d857ae42802e0c5"
 UPSTREAM_CHECK_COMMITS = "1"
 
 GO_IMPORT = "github.com/golang/example"
 GO_INSTALL = "${GO_IMPORT}/hello"
+GO_WORKDIR = "${GO_INSTALL}"
 
-inherit go
+inherit go-mod
 
 # This is just to make clear where this example is
 do_install_append() {
--

2.30.1

#4 lore raw

Re: [OE-core] [PATCH v2 3/3] go-helloworld: Turn into a go module enabled build

Quoted 8 lines · Naveen Saini

This is now failing when you are behind a proxy because it's trying to fetch those modules during do_compile().
https://github.com/golang/example/commit/bcf50bfd7dcd8020c90965747d857ae42802e0c5

Error log:

Quoted 3 lines

ERROR: Execution of '~/build/tmp/work/corei7-64-poky-linux/go-helloworld/0.1-r0/temp/run.do_compile.26031' failed with exit code 1:
go: golang.org/x/[email protected]: Get "https://proxy.golang.org/golang.org/x/tools/@v/v0.0.0-20210112183307-1e6ecd4bf1b0.mod": dial tcp 216.58.196.49:443: i/o timeout
go: golang.org/x/[email protected]: Get "https://proxy.golang.org/golang.org/x/tools/@v/v0.0.0-20210112183307-1e6ecd4bf1b0.mod": dial tcp 216.58.196.49:443: i/o timeout

Also,

https://autobuilder.yoctoproject.org/typhoon/#/builders/80/builds/1876/steps/14/logs/stdio

2021-03-02 05:12:19,144 - oe-selftest - INFO - ======================================================================
2021-03-02 05:12:19,144 - oe-selftest - INFO - FAIL: gotoolchain.oeGoToolchainSelfTest.test_go_dep_build (subunit.RemotedTestCase)
2021-03-02 05:12:19,144 - oe-selftest - INFO - ----------------------------------------------------------------------
2021-03-02 05:12:19,145 - oe-selftest - INFO - testtools.testresult.real._StringException: Traceback (most recent call last):
  File "/home/pokybuild/yocto-worker/oe-selftest-debian/build/meta/lib/oeqa/selftest/cases/gotoolchain.py", line 68, in test_go_dep_build
    retv = self.run_sdk_go_command('build', proj, name)
  File "/home/pokybuild/yocto-worker/oe-selftest-debian/build/meta/lib/oeqa/selftest/cases/gotoolchain.py", line 54, in run_sdk_go_command
    return runCmd(cmd).status
  File "/home/pokybuild/yocto-worker/oe-selftest-debian/build/meta/lib/oeqa/utils/commands.py", line 210, in runCmd
    raise AssertionError("Command '%s' returned non-zero exit status %d:\n%s" % (command, result.status, exc_output))

AssertionError: Command 'cd /tmp/SDKQAvg7566re/go/src/github.com/direnv/direnv; . /tmp/SDKQAvg7566re/environment-setup-core2-64-poky-linux; export GOPATH=/tmp/SDKQAvg7566re/go; ${CROSS_COMPILE}go build' returned non-zero exit status 1:
go: github.com/BurntSushi/[email protected]: Get "https://proxy.golang.org/github.com/%21burnt%21sushi/toml/@v/v0.3.1.mod": net/http: TLS handshake timeout

Cheers,

Richard

#5 lore raw

Re: [OE-core] [PATCH v2 3/3] go-helloworld: Turn into a go module enabled build

In reply to Naveen Saini
Quoted 5 lines · Naveen Saini

[Please note: This e-mail is from an EXTERNAL e-mail address]

This is now failing when you are behind a proxy because it's trying to fetch those modules during do_compile().
https://github.com/golang/example/commit/bcf50bfd7dcd8020c90965747d857ae42802e0c5

Quoted 8 lines

Error log:

| ERROR: Execution of '~/build/tmp/work/corei7-64-poky-linux/go-helloworld/0.1-r0/temp/run.do_compile.26031' failed with exit code 1:
| go: golang.org/x/[email protected]: Get "https://proxy.golang.org/golang.org/x/tools/@v/v0.0.0-20210112183307-1e6ecd4bf1b0.mod": dial tcp 216.58.196.49:443: i/o timeout
| go: golang.org/x/[email protected]: Get "https://proxy.golang.org/golang.org/x/tools/@v/v0.0.0-20210112183307-1e6ecd4bf1b0.mod": dial tcp 216.58.196.49:443: i/o timeout

Regards,
Naveen

I send a patch to disable the module-aware mode for this recipe, as module-aware mode blocks offline build

and condition when  proxy.golang.org is not accssible.

But disable module-aware mode is just a temporary workaround,  now go is 1.16,  from go1.17, GOPATH mode will be dropped,

GO111MODULE will be ignored. Maybe, the final solution  should be making  bitbake's fetcher support offline build with

go module-aware mode.

Quoted 44 lines
Quoted 41 lines

-----Original Message-----
From: [email protected] <openembedded- [email protected]> On Behalf Of Khem Raj
Sent: Wednesday, February 24, 2021 12:13 PM
To: [email protected]
Cc: Khem Raj <[email protected]>
Subject: [OE-core] [PATCH v2 3/3] go-helloworld: Turn into a go module enabled build

---
  meta/recipes-extended/go-examples/go-helloworld_0.1.bb | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)
meta/recipes-extended/go-examples/go-helloworld_0.1.bb +0 -0
index ab70ea98a3..d3f7525dc9 100644
@@ -6,13 +6,14 @@ LICENSE = "MIT"
  LIC_FILES_CHKSUM =

"file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b 4f302"

  SRC_URI = "git://${GO_IMPORT}"
meta/recipes-extended/go-examples/go-helloworld_0.1.bb +3 -3
-SRCREV = "46695d81d1fae905a270fb7db8a4d11a334562fe"
+SRCREV = "bcf50bfd7dcd8020c90965747d857ae42802e0c5"
  UPSTREAM_CHECK_COMMITS = "1"
 
  GO_IMPORT = "github.com/golang/example"
  GO_INSTALL = "${GO_IMPORT}/hello"
+GO_WORKDIR = "${GO_INSTALL}"
 
-inherit go
+inherit go-mod
 
  # This is just to make clear where this example is
  do_install_append() {
--

2.30.1