Skip to content

Commit dbd8038

Browse files
committed
Spec: use inbuild gobuildid to generate build id with -B option
As of now, a random build ID (20 digits) generated and added to binary but with go-1.23.x it is causing following issue in the CI ``` /usr/lib/golang/pkg/tool/linux_amd64/link: -B option too long (max 16 digits): 0x1c32bce09ea23923c57a3cca65fd91e377714192 ``` Looks like `gobuilid` can be used to generate it with -B options without random ID and it can work without isssue for CI - golang/go#70380 ``` $ readelf -n out/linux-amd64/crc Displaying notes found in: .note.gnu.property Owner Data size Description GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0 Properties: x86 ISA needed: x86-64-baseline Displaying notes found in: .note.gnu.build-id Owner Data size Description GNU 0x00000014 NT_GNU_BUILD_ID (unique build ID bitstring) Build ID: f1c4d1d70301bc12737353faf4ee38de3cd25930 ```
1 parent 0292358 commit dbd8038

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packaging/rpm/crc.spec.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export GOFLAGS="-mod=vendor"
6565
mkdir embed-files
6666
cp /usr/bin/crc-driver-libvirt embed-files/crc-driver-libvirt-%{gohostarch}
6767
cp /usr/bin/crc-admin-helper embed-files/crc-admin-helper-linux-%{gohostarch}
68-
make COMMIT_SHA=__COMMIT_SHA__ GO_EXTRA_LDFLAGS="-B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n')" GO_EXTRA_BUILDFLAGS="" CUSTOM_EMBED=true EMBED_DOWNLOAD_DIR=embed-files/ release
68+
make COMMIT_SHA=__COMMIT_SHA__ GO_EXTRA_LDFLAGS="-B gobuildid" GO_EXTRA_BUILDFLAGS="" CUSTOM_EMBED=true EMBED_DOWNLOAD_DIR=embed-files/ release
6969

7070
%install
7171
# with fedora macros: gopkginstall

0 commit comments

Comments
 (0)