Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 755017 - go-module.eclass isn't compatible with v2 go modules
Summary: go-module.eclass isn't compatible with v2 go modules
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: William Hubbs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-11-17 07:49 UTC by Marek Bartosiewicz
Modified: 2020-11-17 19:19 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marek Bartosiewicz 2020-11-17 07:49:51 UTC
I'm not a Go developer, so sorry for any inconsistencies in terminology.

I was trying to hack minikube 1.14.1 ebuild and update it to 1.15.1 version in my local overlay. In my first attempt I just changed GIT_COMMIT and GIT_COMMIT_SHORT (this worked for 1.14.2 version).
First compile failed with requirement for newer version of docker-machine-parallels (v2.0.1). After updating the minikube ebuild and downloading the go module by hand I tried to compile again and this time it failed in such a way:

>>> Source configured.
>>> Compiling source in /var/tmp/portage/sys-cluster/minikube-1.15.1/work/minikube-1.15.1 ...
make -j48 out/minikube-linux-amd64 
PATH="/usr/lib/portage/python3.9/ebuild-helpers/xattr:/usr/lib/portage/python3.9/ebuild-helpers:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/lib/llvm/11/bin:/usr/lib/llvm/10/bin:/var/tmp/portage/sys-cluster/minikube-1.15.1/homedir/go/bin" go-bindata -nomemcopy -o pkg/minikube/assets/assets.go -pkg assets deploy/addons/...
gofmt -s -w pkg/minikube/assets/assets.go
PATH="/usr/lib/portage/python3.9/ebuild-helpers/xattr:/usr/lib/portage/python3.9/ebuild-helpers:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/lib/llvm/11/bin:/usr/lib/llvm/10/bin:/var/tmp/portage/sys-cluster/minikube-1.15.1/homedir/go/bin" go-bindata -nomemcopy -o pkg/minikube/translate/translations.go -pkg translate translations/...
gofmt -s -w pkg/minikube/translate/translations.go
GOOS="linux" GOARCH="amd64" \
go build -tags "go_getter_nos3 go_getter_nogcs" -ldflags="-X k8s.io/minikube/pkg/version.version=v1.15.1 -X k8s.io/minikube/pkg/version.isoVersion=v1.15.0 -X k8s.io/minikube/pkg/version.isoPath=minikube/iso -X k8s.io/minikube/pkg/version.gitCommitID=23f40a012abb52eff365ff99a709501a61ac5876 -X k8s.io/minikube/pkg/version.storageProvisionerVersion=v3" -a -o out/minikube-linux-amd64 k8s.io/minikube/cmd/minikube
WORK=/var/tmp/portage/sys-cluster/minikube-1.15.1/temp/go-build121408998
go: github.com/Parallels/docker-machine-parallels/v2@v2.0.1: reading file:///var/tmp/portage/sys-cluster/minikube-1.15.1/temp/go-proxy/github.com/%21parallels/docker-machine-parallels/v2/@v/v2.0.1.mod: open /var/tmp/portage/sys-cluster/minikube-1.15.1/temp/go-proxy/github.com/!parallels/docker-machine-parallels/v2/@v/v2.0.1.mod: no such file or directory
make: *** [Makefile:209: out/minikube-linux-amd64] Error 1

After cursory research I found this:
https://donatstudios.com/Go-v2-Modules
https://blog.golang.org/v2-go-modules

and that is way over my head, what I can understand it seems that eclass is incompatible with v2 go modules?
Comment 1 Georgy Yakovlev archtester gentoo-dev 2020-11-17 08:16:34 UTC
you have to generate variables on each bump.

one way is 

> cat go.sum | cut -d ' ' -f 1,2 | xargs -i echo -e \\t\"{}\"


another is using dev-go/get-ego-vendor

it will generate proper EGO_SUM for you.

this variable holds module list, which eclass transforms to URLs to download.

if you generate up-to-date one, you will no longer have problems.


please reopen if you still thing it's a problem.
Comment 2 Marek Bartosiewicz 2020-11-17 19:19:20 UTC
Thanks, this helped.
Proper EGO_SUM was the key.