summaryrefslogtreecommitdiffstats
path: root/recipes-containers/cosign/cosign_git.bb
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@gmail.com>2026-04-28 14:16:28 +0000
committerBruce Ashfield <bruce.ashfield@gmail.com>2026-04-28 14:16:28 +0000
commit3b721edc4d86ef2d5188311c41ca4d184f0b6943 (patch)
treef5b4e9208d451ee21c4bcd714b7dc8f4949a3436 /recipes-containers/cosign/cosign_git.bb
parent88ae1ba5a54636fbd20b81986962b8766f879c63 (diff)
downloadmeta-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.bb46
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 @@
1SUMMARY = "Container signing, verification and storage in an OCI registry" 1SUMMARY = "Container signing, verification and storage in an OCI registry"
2HOMEPAGE = "https://github.com/sigstore/cosign" 2HOMEPAGE = "https://github.com/sigstore/cosign"
3LICENSE = "Apache-2.0" 3LICENSE = "Apache-2.0"
4LIC_FILES_CHKSUM = "file://src/${GO_IMPORT}/COPYRIGHT.txt;md5=3830a9ca4f9dc30be01bfa2e4042dd46 \ 4LIC_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
8GO_IMPORT = "github.com/sigstore/cosign" 8GO_IMPORT = "github.com/sigstore/cosign"
9GO_INSTALL = "${GO_IMPORT}/v3/cmd/cosign" 9
10SRC_URI = "git://${GO_IMPORT};protocol=https;nobranch=1;destsuffix=${GO_SRCURI_DESTSUFFIX}" 10SRC_URI = "git://github.com/sigstore/cosign.git;branch=main;name=cosign;protocol=https;destsuffix=${GO_SRCURI_DESTSUFFIX}"
11PV = "3.0.6+git" 11PV = "3.0.6+git"
12SRCREV = "f1ad3ee952313be5d74a49d67ba0aa8d0d5e351f" 12SRCREV_cosign = "f1ad3ee952313be5d74a49d67ba0aa8d0d5e351f"
13
14SRCREV_FORMAT = "cosign"
15
16# go-mod-discovery configuration
17GO_MOD_DISCOVERY_SRCDIR = "${S}/src/${GO_IMPORT}"
18GO_MOD_DISCOVERY_BUILD_TARGET = "./cmd/cosign"
19GO_MOD_DISCOVERY_GIT_REPO = "https://github.com/sigstore/cosign.git"
20GO_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
25SRC_URI += "gomod://buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go;version=v1.36.11-20260209202127-80ab13bee0bf.1;sha256sum=${COSIGN_BUF_BUILD_SHA}"
26SRC_URI += "gomod://software.sslmate.com/src/go-pkcs12;version=v0.4.0;sha256sum=${COSIGN_PKCS12_SHA}"
27GO_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
30COSIGN_BUF_BUILD_SHA ?= "907cb90a97d72b869a0f2f08e71ebdaaa5a0efa57ca72ebd7d14ed5a9922b541"
31COSIGN_PKCS12_SHA ?= "55019a391e5302a51ba62e98909e006224b81207866da90beaf582ec0dee036f"
32
33# GO_MOD_FETCH_MODE: "vcs" (all git://) or "hybrid" (gomod:// + git://)
34GO_MOD_FETCH_MODE ?= "hybrid"
35
36# VCS mode: all modules via git://
37include ${@ "go-mod-git.inc" if d.getVar("GO_MOD_FETCH_MODE") == "vcs" else ""}
38include ${@ "go-mod-cache.inc" if d.getVar("GO_MOD_FETCH_MODE") == "vcs" else ""}
39
40# Hybrid mode: gomod:// for most, git:// for selected
41include ${@ "go-mod-hybrid-gomod.inc" if d.getVar("GO_MOD_FETCH_MODE") == "hybrid" else ""}
42include ${@ "go-mod-hybrid-git.inc" if d.getVar("GO_MOD_FETCH_MODE") == "hybrid" else ""}
43include ${@ "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)
14require ${BPN}-licenses.inc 46require ${BPN}-licenses.inc
15require ${BPN}-go-mods.inc
16 47
17inherit go-mod go-mod-update-modules 48inherit go goarch
49inherit go-mod-discovery
18 50
19BBCLASSEXTEND = "native nativesdk" 51BBCLASSEXTEND = "native nativesdk"