diff --git a/recipes-networking/cni/cni_git.bb b/recipes-networking/cni/cni_git.bb index b41b47cf..aa9902e3 100644 --- a/recipes-networking/cni/cni_git.bb +++ b/recipes-networking/cni/cni_git.bb @@ -14,12 +14,13 @@ SRCREV_plugins = "b6a0e0bc96906f0d3bd6bfcaab0b5ae72292f46c" SRCREV_flannel_plugin = "6464faacf5c00e25321573225d74638455ef03a0" SRCREV_FORMAT = "cni_plugins" SRC_URI = "\ - git://github.com/containernetworking/cni.git;branch=main;name=cni;protocol=https \ - git://github.com/containernetworking/plugins.git;branch=main;destsuffix=${S}/src/github.com/containernetworking/plugins;name=plugins;protocol=https \ - git://github.com/flannel-io/cni-plugin;branch=main;name=flannel_plugin;protocol=https;destsuffix=${S}/src/github.com/containernetworking/plugins/plugins/meta/flannel \ - file://modules.txt \ + git://github.com/containernetworking/cni.git;branch=main;name=cni;protocol=https;destsuffix=${GO_SRCURI_DESTSUFFIX} \ + file://modules.txt \ " +SRC_URI += "git://github.com/containernetworking/plugins.git;branch=main;destsuffix=${GO_SRCURI_DESTSUFFIX}/src/github.com/containernetworking/plugins;name=plugins;protocol=https" +SRC_URI += "git://github.com/flannel-io/cni-plugin;branch=main;name=flannel_plugin;protocol=https;destsuffix=${GO_SRCURI_DESTSUFFIX}/src/github.com/containernetworking/plugins/plugins/meta/flannel" + # generated via: # ./scripts/oe-go-mod-autogen.py --repo https://github.com/containernetworking/cni.git --rev include src_uri.inc @@ -32,6 +33,7 @@ LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=fa818a259cbed7ce8bc2a22d35a464fc" GO_IMPORT = "import" +S = "${WORKDIR}/git" PV = "v1.2.0-rc0+git${SRCREV_cni}" CNI_VERSION = "v1.2.0" @@ -49,11 +51,19 @@ do_compile() { mkdir -p ${S}/src/github.com/containernetworking ln -sfr ${S}/src/import ${S}/src/github.com/containernetworking/cni + # Fixes: cannot find package "github.com/containernetworking/plugins/plugins/meta/bandwidth" in any of: + # we can't clone the plugin source directly to where it belongs because + # there seems to be an issue in the relocation code from UNPACKDIR to S + # and our LICENSE file is never found. + # This symbolic link arranges for the code to be available where go will + # search during the build + ln -sfr ${S}/src/import/src/github.com/containernetworking/plugins ${B}/src/github.com/containernetworking + # our copied .go files are to be used for the build ln -sf vendor.copy vendor # inform go that we know what we are doing - cp ${WORKDIR}/modules.txt vendor/ + cp ${UNPACKDIR}/modules.txt vendor/ export GO111MODULE=off @@ -63,7 +73,7 @@ do_compile() { cd ${B}/src/github.com/containernetworking/cni/cnitool ${GO} build ${GOBUILDFLAGS} - cd ${B}/src/github.com/containernetworking/plugins + cd ${B}/src/import/src/github.com/containernetworking/plugins PLUGINS="$(ls -d plugins/meta/*; ls -d plugins/ipam/*; ls -d plugins/main/* | grep -v windows)" mkdir -p ${B}/plugins/bin/ for p in $PLUGINS; do diff --git a/recipes-networking/cni/src_uri.inc b/recipes-networking/cni/src_uri.inc index 6cda91ab..fe90f20f 100644 --- a/recipes-networking/cni/src_uri.inc +++ b/recipes-networking/cni/src_uri.inc @@ -1,65 +1,65 @@ # golang.org/x/net v0.17.0 # [1] git ls-remote https://go.googlesource.com/net b225e7ca6dde1ef5a5ae5ce922861bda011cfabd SRCREV_net="b225e7ca6dde1ef5a5ae5ce922861bda011cfabd" -SRC_URI += "git://go.googlesource.com/net;name=net;protocol=https;nobranch=1;destsuffix=${WORKDIR}/${BP}/src/import/vendor.fetch/golang.org/x/net" +SRC_URI += "git://go.googlesource.com/net;name=net;protocol=https;nobranch=1;destsuffix=${GO_SRCURI_DESTSUFFIX}/vendor.fetch/golang.org/x/net" # golang.org/x/sys v0.14.0 # [1] git ls-remote https://go.googlesource.com/sys cb378ae1ff8cd45e69d4f172df8370bc844e1f86 SRCREV_sys="cb378ae1ff8cd45e69d4f172df8370bc844e1f86" -SRC_URI += "git://go.googlesource.com/sys;name=sys;protocol=https;nobranch=1;destsuffix=${WORKDIR}/${BP}/src/import/vendor.fetch/golang.org/x/sys" +SRC_URI += "git://go.googlesource.com/sys;name=sys;protocol=https;nobranch=1;destsuffix=${GO_SRCURI_DESTSUFFIX}/vendor.fetch/golang.org/x/sys" # gopkg.in/yaml.v3 v3.0.1 # [1] git ls-remote https://github.com/go-yaml/yaml f6f7691b1fdeb513f56608cd2c32c51f8194bf51 SRCREV_yaml.v3="f6f7691b1fdeb513f56608cd2c32c51f8194bf51" -SRC_URI += "git://github.com/go-yaml/yaml;name=yaml.v3;protocol=https;nobranch=1;destsuffix=${WORKDIR}/${BP}/src/import/vendor.fetch/gopkg.in/yaml.v3" +SRC_URI += "git://github.com/go-yaml/yaml;name=yaml.v3;protocol=https;nobranch=1;destsuffix=${GO_SRCURI_DESTSUFFIX}/vendor.fetch/gopkg.in/yaml.v3" # golang.org/x/text v0.13.0 # [1] git ls-remote https://go.googlesource.com/text f488e191e67ed95a5b9b7b39024e5a5f5f1ffd02 SRCREV_text="f488e191e67ed95a5b9b7b39024e5a5f5f1ffd02" -SRC_URI += "git://go.googlesource.com/text;name=text;protocol=https;nobranch=1;destsuffix=${WORKDIR}/${BP}/src/import/vendor.fetch/golang.org/x/text" +SRC_URI += "git://go.googlesource.com/text;name=text;protocol=https;nobranch=1;destsuffix=${GO_SRCURI_DESTSUFFIX}/vendor.fetch/golang.org/x/text" # golang.org/x/tools v0.14.0 # [1] git ls-remote https://go.googlesource.com/tools 3f4194ee29d7db9b59757dfff729ef55cf89661c SRCREV_tools="3f4194ee29d7db9b59757dfff729ef55cf89661c" -SRC_URI += "git://go.googlesource.com/tools;name=tools;protocol=https;nobranch=1;destsuffix=${WORKDIR}/${BP}/src/import/vendor.fetch/golang.org/x/tools" +SRC_URI += "git://go.googlesource.com/tools;name=tools;protocol=https;nobranch=1;destsuffix=${GO_SRCURI_DESTSUFFIX}/vendor.fetch/golang.org/x/tools" # github.com/onsi/gomega v1.30.0 # [1] git ls-remote https://github.com/onsi/gomega f804ac6ada8d36164ecae0513295de8affce1245 SRCREV_gomega="f804ac6ada8d36164ecae0513295de8affce1245" -SRC_URI += "git://github.com/onsi/gomega;name=gomega;protocol=https;nobranch=1;destsuffix=${WORKDIR}/${BP}/src/import/vendor.fetch/github.com/onsi/gomega" +SRC_URI += "git://github.com/onsi/gomega;name=gomega;protocol=https;nobranch=1;destsuffix=${GO_SRCURI_DESTSUFFIX}/vendor.fetch/github.com/onsi/gomega" # github.com/go-logr/logr v1.3.0 # [1] git ls-remote https://github.com/go-logr/logr 8adefbede0fe82bdee4fb8c9c9bdc7bc5d91388f SRCREV_logr="8adefbede0fe82bdee4fb8c9c9bdc7bc5d91388f" -SRC_URI += "git://github.com/go-logr/logr;name=logr;protocol=https;nobranch=1;destsuffix=${WORKDIR}/${BP}/src/import/vendor.fetch/github.com/go-logr/logr" +SRC_URI += "git://github.com/go-logr/logr;name=logr;protocol=https;nobranch=1;destsuffix=${GO_SRCURI_DESTSUFFIX}/vendor.fetch/github.com/go-logr/logr" # github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 # [1] git ls-remote https://github.com/google/pprof 94a9f03dee38882adc8bdfc42cdd6a04f8e7056e SRCREV_pprof="94a9f03dee38882adc8bdfc42cdd6a04f8e7056e" -SRC_URI += "git://github.com/google/pprof;name=pprof;protocol=https;nobranch=1;destsuffix=${WORKDIR}/${BP}/src/import/vendor.fetch/github.com/google/pprof" +SRC_URI += "git://github.com/google/pprof;name=pprof;protocol=https;nobranch=1;destsuffix=${GO_SRCURI_DESTSUFFIX}/vendor.fetch/github.com/google/pprof" # github.com/google/go-cmp v0.6.0 # [1] git ls-remote https://github.com/google/go-cmp c3ad8435e7bef96af35732bc0789e5a2278c6d5f SRCREV_go-cmp="c3ad8435e7bef96af35732bc0789e5a2278c6d5f" -SRC_URI += "git://github.com/google/go-cmp;name=go-cmp;protocol=https;nobranch=1;destsuffix=${WORKDIR}/${BP}/src/import/vendor.fetch/github.com/google/go-cmp" +SRC_URI += "git://github.com/google/go-cmp;name=go-cmp;protocol=https;nobranch=1;destsuffix=${GO_SRCURI_DESTSUFFIX}/vendor.fetch/github.com/google/go-cmp" # github.com/onsi/ginkgo/v2 v2.13.2 # [1] git ls-remote https://github.com/onsi/ginkgo 931dc0b144749710bd085d4eb7cd4192a22972d7 SRCREV_v2="931dc0b144749710bd085d4eb7cd4192a22972d7" -SRC_URI += "git://github.com/onsi/ginkgo;name=v2;protocol=https;nobranch=1;destsuffix=${WORKDIR}/${BP}/src/import/vendor.fetch/github.com/onsi/ginkgo/v2" +SRC_URI += "git://github.com/onsi/ginkgo;name=v2;protocol=https;nobranch=1;destsuffix=${GO_SRCURI_DESTSUFFIX}/vendor.fetch/github.com/onsi/ginkgo/v2" # github.com/vishvananda/netns v0.0.4 # [1] git ls-remote https://github.com/vishvananda/netns 7a452d2d15292b2bfb2a2d88e6bdeac156a761b9 SRCREV_netns="7a452d2d15292b2bfb2a2d88e6bdeac156a761b9" -SRC_URI += "git://github.com/vishvananda/netns;name=netns;protocol=https;nobranch=1;destsuffix=${WORKDIR}/${BP}/src/import/vendor.fetch/github.com/vishvananda/netns" +SRC_URI += "git://github.com/vishvananda/netns;name=netns;protocol=https;nobranch=1;destsuffix=${GO_SRCURI_DESTSUFFIX}/vendor.fetch/github.com/vishvananda/netns" # github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 # [1] git ls-remote https://github.com/go-task/slim-sprig 52ccab3ef572c7e1a2c258be183f9a9296d60152 SRCREV_slim-sprig="52ccab3ef572c7e1a2c258be183f9a9296d60152" -SRC_URI += "git://github.com/go-task/slim-sprig;name=slim-sprig;protocol=https;nobranch=1;destsuffix=${WORKDIR}/${BP}/src/import/vendor.fetch/github.com/go-task/slim-sprig" +SRC_URI += "git://github.com/go-task/slim-sprig;name=slim-sprig;protocol=https;nobranch=1;destsuffix=${GO_SRCURI_DESTSUFFIX}/vendor.fetch/github.com/go-task/slim-sprig" # github.com/Masterminds/semver/v3 v3.2.1 # [1] git ls-remote https://github.com/Masterminds/semver e06051f8fcc4c8b4a4990c337b9862a2448722e5 SRCREV_v3="e06051f8fcc4c8b4a4990c337b9862a2448722e5" -SRC_URI += "git://github.com/Masterminds/semver;name=v3;protocol=https;nobranch=1;destsuffix=${WORKDIR}/${BP}/src/import/vendor.fetch/github.com/Masterminds/semver/v3" +SRC_URI += "git://github.com/Masterminds/semver;name=v3;protocol=https;nobranch=1;destsuffix=${GO_SRCURI_DESTSUFFIX}/vendor.fetch/github.com/Masterminds/semver/v3"