Skip to content

Commit fcc0d2b

Browse files
committed
Fix trixie FIPS Go package: correct version and robust changelog update
The GOLANG_VERSOIN variable was set to '1.24~2' but the golang-debian submodule changelog has version '1.24.4-1'. This caused the sed command in src/golang/Makefile to silently fail: sed -i 's/1.24~2/1.24~2+fips/' debian/changelog Since '1.24~2' doesn't appear in the changelog, the +fips suffix was never added, and the published package was effectively stock Debian Go without sonic-fips patches (sonic_fips detection, symcryptprovider). Fixes: 1. Update GOLANG_VERSOIN to match actual debian changelog version 2. Use dpkg-parsechangelog in Makefile for robust version detection, preventing this class of bug when the debian submodule is updated This fixes FIPS test failures (fips/test_fips.py) for trixie containers with Go binaries, where the telemetry process doesn't load symcrypt because the Go runtime can't detect SONiC FIPS mode. Fixes: #83 Signed-off-by: Dawei Huang <daweihuang@microsoft.com>
1 parent 17168d7 commit fcc0d2b

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

rules/golang.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
GOLANG_MAIN_VERSION = go1.24
44
GOLANGT_TAG = go1.24.4
5-
GOLANG_VERSOIN = 1.24~2
5+
GOLANG_VERSOIN = 1.24.4-1
66
GOLANG_VERSOIN_FIPS = $(GOLANG_VERSOIN)+fips
77
GOLANG = golang-$(GOLANG_MAIN_VERSION)_$(GOLANG_VERSOIN_FIPS)_all.deb
88
$(GOLANG)_SRC_PATH = $(SRC_PATH)/golang

src/golang/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ $(MAIN_TARGET):
1616
scripts/full-initialize-repo.sh $(GOLANGT_TAG)
1717
cp -r ../golang-debian/debian go/
1818
cd go
19-
sed -i "s/$(GOLANG_VERSOIN)/$(GOLANG_VERSOIN)+fips/" debian/changelog
19+
VERSION=$$(dpkg-parsechangelog --show-field Version) && \
20+
sed -i "s/$$VERSION/$${VERSION}+fips/" debian/changelog
2021
cp ../../golang/patches/*.patch debian/patches/
2122
comm -23 --nocheck-order ../../golang/patches/series debian/patches/series >> debian/patches/series
2223
dpkg-buildpackage -b -d -rfakeroot -us -uc

0 commit comments

Comments
 (0)