go-build: Set up dependencies and GOPATH before do_compile

go-build recipe depends on runc source and during compilation tries to run the
command: go get github.com/opencontainers/runc.

This is incorrect as a source fetch shouldn't occur during compilation.  Also,
even after a fetch occurs during compilation, the go build path GOPATH points
to the incorrect path hence the runc source is never found.

Fetch the opencontainers/runc source and create links in the correct GOPATH
before compilation for a successful build.

Signed-off-by: Sai Hari Chandana Kalluri <chandana.kalluri@xilinx.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
This commit is contained in:
Chandana kalluri 2020-04-08 09:52:40 -07:00 committed by Bruce Ashfield
parent 40f79e8d17
commit 16134e66ca

View File

@ -3,8 +3,11 @@ SUMMARY = "console for runx"
DESCRIPTION = "Xen Runtime for OCI"
SRCREV_runx = "da0c75c58ae5232d19b1791c33545db3225e1ea9"
SRCREV_runc = "e4363b038787addfa12e8b0acf5417d4fba01693"
SRC_URI = "\
git://github.com/lf-edge/runx;nobranch=1;name=runx \
git://github.com/opencontainers/runc.git;nobranch=1;destsuffix=runc;name=runc \
"
SRC_URI[md5sum] = "0d701ac1e2a67d47ce7127432df2c32b"
SRC_URI[sha256sum] = "5a26478906d5005f4f809402e981518d2b8844949199f60c4b6e1f986ca2a769"
@ -29,6 +32,9 @@ do_compile() {
export GOARCH="${TARGET_GOARCH}"
cd ${S}/src/import/gobuild
mkdir -p go/src/github.com/opencontainers
ln -s ${WORKDIR}/runc ${S}/src/import/gobuild/go/src/github.com/opencontainers/runc
export GOPATH="${S}/src/import/gobuild/go/src/github.com/opencontainers/runc"
oe_runmake
}