From 77d31a83ed212d95fc98ce190da0a632a50c4676 Mon Sep 17 00:00:00 2001 From: Bruce Ashfield Date: Thu, 5 Oct 2023 20:21:49 +0000 Subject: oe-go-mod-autogen: add extra information to duplicate module paths Signed-off-by: Bruce Ashfield --- scripts/README-oe-go-mod-autogen.txt | 33 +++++++++++++++++++++++++++++++++ scripts/oe-go-mod-autogen.py | 2 +- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/scripts/README-oe-go-mod-autogen.txt b/scripts/README-oe-go-mod-autogen.txt index e5c11d90..36f1d89e 100644 --- a/scripts/README-oe-go-mod-autogen.txt +++ b/scripts/README-oe-go-mod-autogen.txt @@ -79,3 +79,36 @@ Description: to manually handle these unhandled modules if they are urgent to add/upgrade some go mod recipes. + +Debug tips: + +If the do_compile task exits with a go mod / fetch error, this is due +to some sort of compilation error during the go build. The log file +can be huge. To figure out what broke, try the following: + + % cd ${S}/src/import + % grep -v ^HASH ../../../temp/log.do_compile + +This will likely highlight what broke. It is often that either the wrong +revision was used (and there will be go build errors) or that a fetched +repository used the wrong source or destination. Seeing what module +couldn't be found, will allow you to locate the SRC_URI fetch in question, +how it was relocated. Either the source or destination may be wrong. + +As an example, k3s was failing with the following error: + + go: finding module for package sigs.k8s.io/kustomize/kustomize/v5/commands/build + vendor/k8s.io/kubectl/pkg/cmd/kustomize/kustomize.go:25:2: cannot query module due to -mod=vendor + WARNING: exit code 1 from a shell command. + +Which leads to looking at the SRC_URI and vendor fetch, which was not +using the proper source for kustomize. + + sigs.k8s.io/kustomize/kustomize/v5:sigs.k8s.io/kustomize/kustomize:force \ + +had to be changed to: + + sigs.k8s.io/kustomize/kustomize/v5:sigs.k8s.io/kustomize/kustomize/v5/kustomize:force \ + +To get the commands/build subirectory from the source into the proper +vendor location. diff --git a/scripts/oe-go-mod-autogen.py b/scripts/oe-go-mod-autogen.py index 2970847e..c44c096a 100755 --- a/scripts/oe-go-mod-autogen.py +++ b/scripts/oe-go-mod-autogen.py @@ -627,7 +627,7 @@ do_compile:prepend() { if module_to_check == m: continue if not m.startswith('%s/' % module_to_check): - logger.warning("%s is sharing repo (%s) with other modules, and it might need a subpath. Please double check" % (module_to_check, repo)) + logger.warning("%s is sharing repo (%s) with other modules, and it might need a subpath. Please double check: %s and: %s" % (module_to_check, repo, nosubpath_modules,m)) continue # -- cgit v1.2.3-54-g00ecf