app-emulation/containerd: set GOFLAGS to -mod=vendor

Since containerd 1.5 started to turn on Go module, we need to pass
`-mod=vendor` to the go build command.
Otherwise, go build will fail because it would try to fetch missing
go deps from remote repos. It would not work inside of sandbox.

We cannot set `COREOS_GO_MOD=vendor` because containerd ebuild calls
`emake` instead of `go_build`.
This commit is contained in:
Dongsu Park 2021-05-20 14:15:15 +02:00
parent 8a0da2857b
commit e63de2ea31

View File

@ -54,6 +54,8 @@ src_prepare() {
src_compile() { src_compile() {
local options=( $(usex btrfs "" "no_btrfs") ) local options=( $(usex btrfs "" "no_btrfs") )
export GOPATH="${WORKDIR}/${P}" # ${PWD}/vendor export GOPATH="${WORKDIR}/${P}" # ${PWD}/vendor
export GO111MODULE=on
export GOFLAGS="-v -x -mod=vendor"
LDFLAGS=$(usex hardened '-extldflags -fno-PIC' '') emake BUILDTAGS="${options[*]}" LDFLAGS=$(usex hardened '-extldflags -fno-PIC' '') emake BUILDTAGS="${options[*]}"
} }