]> git.99rst.org Git - openwrt-packages.git/commitdiff
oci-runtime-tools: build runtimetest statically
authorDaniel Golle <redacted>
Wed, 19 Aug 2026 06:08:26 +0000 (07:08 +0100)
committerDaniel Golle <redacted>
Sun, 23 Aug 2026 22:37:55 +0000 (23:37 +0100)
runtimetest is copied into the validation bundle, whose rootfs carries a
static busybox and no dynamic loader, so the dynamically linked binary the
generic Go recipe produces fails to execute and every validation test that
inspects the container from the inside aborts.

Build that one command again as the static binary upstream's own runtimetest
target produces. Upstream gets there by asking the external linker for a
static link, while disabling cgo reaches the same result without fighting the
-linkmode external that the generic Go recipe would otherwise impose.

Signed-off-by: Daniel Golle <redacted>
utils/oci-runtime-tools/Makefile

index df640716f82990df910203b6a11b1d53cb27b6ca..d802e94f712a0b8b4b285df6d79b19ed39df639e 100644 (file)
@@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=oci-runtime-tools
 PKG_VERSION:=1.3.0.20260316
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_LICENSE:=Apache-2.0
 PKG_LICENSE_FILES:=LICENSE
 
@@ -82,6 +82,14 @@ endef
 
 define Build/Compile
        $(call GoPackage/Build/Compile)
+       $(GO_GENERAL_BUILD_CONFIG_VARS) \
+       $(GO_PKG_BUILD_CONFIG_VARS) \
+       GO_BUILD_PKG="$(GO_PKG)cmd/runtimetest" \
+       $(GO_PKG_VARS) \
+       CGO_ENABLED=0 \
+       $(SHELL) $(GO_INCLUDE_DIR)golang-build.sh build \
+               -v -buildvcs=false -trimpath -tags "netgo osusergo" \
+               -ldflags "$(patsubst %,-X %,$(GO_PKG_LDFLAGS_X))"
        $(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
 endef
 
git clone https://git.99rst.org/PROJECT