From 06fbe309323005d728e863d461f9bd1aedf24ab5 Mon Sep 17 00:00:00 2001 From: Boovan Rajendran Date: Fri, 22 Nov 2024 10:50:52 -0500 Subject: [PATCH] Fix for GOPATH failure in go-dep Package The go-dep package is encountering the following error after updating golang-any, golang-go, and golang-src to version 1.22: "go.mod file not found in current directory or any parent" According to the Golang 1.22 release notes https://tip.golang.org/doc/go1.22#go-command, go get is no longer supported outside of a module in the legacy GOPATH mode. To address this, we have created a patch that sets and exports the GO111MODULE variable to off. Test Plan: PASS: go-dep Package build successfully PASS: Download all packages successfully. PASS: Build ISO and installed as AIO-SX. Story: 2011047 Task: 51402 Change-Id: I28e276dd2caae7c094ac77dc0a2074d9ba6acb22 Signed-off-by: Boovan Rajendran --- ...for-GOPATH-failure-in-go-dep-Package.patch | 33 +++++++++++++++++++ tools/golang-dep/debian/deb_patches/series | 1 + 2 files changed, 34 insertions(+) create mode 100644 tools/golang-dep/debian/deb_patches/0001-Fix-for-GOPATH-failure-in-go-dep-Package.patch create mode 100644 tools/golang-dep/debian/deb_patches/series diff --git a/tools/golang-dep/debian/deb_patches/0001-Fix-for-GOPATH-failure-in-go-dep-Package.patch b/tools/golang-dep/debian/deb_patches/0001-Fix-for-GOPATH-failure-in-go-dep-Package.patch new file mode 100644 index 0000000..4939f1d --- /dev/null +++ b/tools/golang-dep/debian/deb_patches/0001-Fix-for-GOPATH-failure-in-go-dep-Package.patch @@ -0,0 +1,33 @@ +From f16b8b44ed946e40871abf6b3d8d638c768b0dd2 Mon Sep 17 00:00:00 2001 +From: Boovan Rajendran +Date: Fri, 22 Nov 2024 03:51:57 -0500 +Subject: [PATCH] Fix for GOPATH failure in go-dep Package + +The go-dep package is encountering the following error after +updating golang-any, golang-go, and golang-src to version 1.22: +"go.mod file not found in current directory or any parent" + +According to the Golang 1.22 release notes +https://tip.golang.org/doc/go1.22#go-command, go get is no longer +supported outside of a module in the legacy GOPATH mode. + +Signed-off-by: Boovan Rajendran +--- + debian/rules | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/debian/rules b/debian/rules +index 1585fda..e3f90c0 100755 +--- a/debian/rules ++++ b/debian/rules +@@ -4,6 +4,7 @@ include /usr/share/dpkg/architecture.mk + + export DH_VERBOSE := 3 + export DH_GOLANG_INSTALL_ALL := 1 ++export GO111MODULE := off + + %: + dh $@ --buildsystem=golang --with=golang +-- +2.25.1 + diff --git a/tools/golang-dep/debian/deb_patches/series b/tools/golang-dep/debian/deb_patches/series new file mode 100644 index 0000000..f599b6c --- /dev/null +++ b/tools/golang-dep/debian/deb_patches/series @@ -0,0 +1 @@ +0001-Fix-for-GOPATH-failure-in-go-dep-Package.patch