diff options
| author | Bruce Ashfield <bruce.ashfield@gmail.com> | 2026-04-28 14:16:28 +0000 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2026-04-28 14:16:28 +0000 |
| commit | 3b721edc4d86ef2d5188311c41ca4d184f0b6943 (patch) | |
| tree | f5b4e9208d451ee21c4bcd714b7dc8f4949a3436 /recipes-containers/cosign/cosign_git.bb | |
| parent | 88ae1ba5a54636fbd20b81986962b8766f879c63 (diff) | |
| download | meta-virtualization-3b721edc4d86ef2d5188311c41ca4d184f0b6943.tar.gz | |
cosign: convert to go-mod-vcs hybrid fetch
Convert from go-mod + go-mod-update-modules to go-mod-vcs hybrid
fetch mode, consistent with other Go recipes in the layer (k3s,
nerdctl, docker-compose, etc.).
- Replace cosign-go-mods.inc (gomod:// only) with generated
go-mod-hybrid-{gomod,git,cache}.inc and go-mod-{git,cache}.inc
- Keep cosign-licenses.inc for dependency license tracking (our
go-mod-vcs tooling does not yet generate license metadata)
- Add GO_MOD_VCS_EXCLUDE for buf.build (no git repo) and
software.sslmate.com/src/go-pkcs12 (unreachable commit)
- Set GO_MOD_DISCOVERY_SRCDIR to match go.bbclass source layout
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Diffstat (limited to 'recipes-containers/cosign/cosign_git.bb')
| -rw-r--r-- | recipes-containers/cosign/cosign_git.bb | 46 |
1 files changed, 39 insertions, 7 deletions
diff --git a/recipes-containers/cosign/cosign_git.bb b/recipes-containers/cosign/cosign_git.bb index 09c28317..8bb8dc8b 100644 --- a/recipes-containers/cosign/cosign_git.bb +++ b/recipes-containers/cosign/cosign_git.bb | |||
| @@ -1,19 +1,51 @@ | |||
| 1 | SUMMARY = "Container signing, verification and storage in an OCI registry" | 1 | SUMMARY = "Container signing, verification and storage in an OCI registry" |
| 2 | HOMEPAGE = "https://github.com/sigstore/cosign" | 2 | HOMEPAGE = "https://github.com/sigstore/cosign" |
| 3 | LICENSE = "Apache-2.0" | 3 | LICENSE = "Apache-2.0" |
| 4 | LIC_FILES_CHKSUM = "file://src/${GO_IMPORT}/COPYRIGHT.txt;md5=3830a9ca4f9dc30be01bfa2e4042dd46 \ | 4 | LIC_FILES_CHKSUM = "file://${S}/src/${GO_IMPORT}/COPYRIGHT.txt;md5=3830a9ca4f9dc30be01bfa2e4042dd46 \ |
| 5 | file://src/${GO_IMPORT}/LICENSE;md5=86d3f3a95c324c9479bd8986968f4327 \ | 5 | file://${S}/src/${GO_IMPORT}/LICENSE;md5=86d3f3a95c324c9479bd8986968f4327 \ |
| 6 | " | 6 | " |
| 7 | 7 | ||
| 8 | GO_IMPORT = "github.com/sigstore/cosign" | 8 | GO_IMPORT = "github.com/sigstore/cosign" |
| 9 | GO_INSTALL = "${GO_IMPORT}/v3/cmd/cosign" | 9 | |
| 10 | SRC_URI = "git://${GO_IMPORT};protocol=https;nobranch=1;destsuffix=${GO_SRCURI_DESTSUFFIX}" | 10 | SRC_URI = "git://github.com/sigstore/cosign.git;branch=main;name=cosign;protocol=https;destsuffix=${GO_SRCURI_DESTSUFFIX}" |
| 11 | PV = "3.0.6+git" | 11 | PV = "3.0.6+git" |
| 12 | SRCREV = "f1ad3ee952313be5d74a49d67ba0aa8d0d5e351f" | 12 | SRCREV_cosign = "f1ad3ee952313be5d74a49d67ba0aa8d0d5e351f" |
| 13 | |||
| 14 | SRCREV_FORMAT = "cosign" | ||
| 15 | |||
| 16 | # go-mod-discovery configuration | ||
| 17 | GO_MOD_DISCOVERY_SRCDIR = "${S}/src/${GO_IMPORT}" | ||
| 18 | GO_MOD_DISCOVERY_BUILD_TARGET = "./cmd/cosign" | ||
| 19 | GO_MOD_DISCOVERY_GIT_REPO = "https://github.com/sigstore/cosign.git" | ||
| 20 | GO_MOD_DISCOVERY_GIT_REF = "${SRCREV_cosign}" | ||
| 21 | |||
| 22 | # Modules that can't be fetched via git (no repo metadata or unreachable commits) | ||
| 23 | # - buf.build/gen/go: generated protobuf module, no git repository | ||
| 24 | # - software.sslmate.com/src/go-pkcs12: commit not reachable via shallow fetch | ||
| 25 | SRC_URI += "gomod://buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go;version=v1.36.11-20260209202127-80ab13bee0bf.1;sha256sum=${COSIGN_BUF_BUILD_SHA}" | ||
| 26 | SRC_URI += "gomod://software.sslmate.com/src/go-pkcs12;version=v0.4.0;sha256sum=${COSIGN_PKCS12_SHA}" | ||
| 27 | GO_MOD_VCS_EXCLUDE = "buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go software.sslmate.com/src/go-pkcs12" | ||
| 28 | |||
| 29 | # Checksums — run bitbake cosign -c fetch to get correct values on first use | ||
| 30 | COSIGN_BUF_BUILD_SHA ?= "907cb90a97d72b869a0f2f08e71ebdaaa5a0efa57ca72ebd7d14ed5a9922b541" | ||
| 31 | COSIGN_PKCS12_SHA ?= "55019a391e5302a51ba62e98909e006224b81207866da90beaf582ec0dee036f" | ||
| 32 | |||
| 33 | # GO_MOD_FETCH_MODE: "vcs" (all git://) or "hybrid" (gomod:// + git://) | ||
| 34 | GO_MOD_FETCH_MODE ?= "hybrid" | ||
| 35 | |||
| 36 | # VCS mode: all modules via git:// | ||
| 37 | include ${@ "go-mod-git.inc" if d.getVar("GO_MOD_FETCH_MODE") == "vcs" else ""} | ||
| 38 | include ${@ "go-mod-cache.inc" if d.getVar("GO_MOD_FETCH_MODE") == "vcs" else ""} | ||
| 39 | |||
| 40 | # Hybrid mode: gomod:// for most, git:// for selected | ||
| 41 | include ${@ "go-mod-hybrid-gomod.inc" if d.getVar("GO_MOD_FETCH_MODE") == "hybrid" else ""} | ||
| 42 | include ${@ "go-mod-hybrid-git.inc" if d.getVar("GO_MOD_FETCH_MODE") == "hybrid" else ""} | ||
| 43 | include ${@ "go-mod-hybrid-cache.inc" if d.getVar("GO_MOD_FETCH_MODE") == "hybrid" else ""} | ||
| 13 | 44 | ||
| 45 | # Dependency license tracking (generated by go-mod-update-modules) | ||
| 14 | require ${BPN}-licenses.inc | 46 | require ${BPN}-licenses.inc |
| 15 | require ${BPN}-go-mods.inc | ||
| 16 | 47 | ||
| 17 | inherit go-mod go-mod-update-modules | 48 | inherit go goarch |
| 49 | inherit go-mod-discovery | ||
| 18 | 50 | ||
| 19 | BBCLASSEXTEND = "native nativesdk" | 51 | BBCLASSEXTEND = "native nativesdk" |
