Skip to content

Commit c76576c

Browse files
committed
1 parent 692c208 commit c76576c

File tree

3 files changed

+23
-3
lines changed

3 files changed

+23
-3
lines changed

.github/workflows/build.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,16 @@ jobs:
3232
run: |
3333
sudo apt-get install -y musl-tools musl-dev
3434
35+
# @todo ugly fix for ugly fix, musl.cc is not available from github runner
36+
- name: Download musl cross-compiler
37+
uses: Difegue/action-megacmd@v1
38+
with:
39+
args: get -m https://mega.nz/file/zQwVHSYb#8WqqMUCTbbEVKDW55NPrRnM2-4SC-numNCLDKoTWtwQ ~/
40+
41+
- name: Unpack musl cross-compiler
42+
run: |
43+
tar -xvf ~/aarch64-linux-musl-cross.tgz -C ~/
44+
3545
# - name: Cache golang
3646
# id: cache-golang
3747
# uses: actions/cache@v4

Dockerfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,13 @@ RUN rm -fv /etc/apt/sources.list.d/clickhouse.list && \
1616
echo "deb-src https://ppa.launchpadcontent.net/longsleep/golang-backports/ubuntu ${DISTRIB_CODENAME} main" >> /etc/apt/sources.list.d/golang.list && \
1717
( apt-get update || true ) && \
1818
apt-get install -y --no-install-recommends libc-dev golang-1.24 make git gcc musl-dev musl-tools && \
19-
wget -nv -P /root/ https://musl.cc/aarch64-linux-musl-cross.tgz && \
19+
# todo ugly fix for ugly fix, musl.cc is not available from github runner \
20+
DISTRIB_RELEASE=$(cat /etc/lsb-release | grep DISTRIB_RELEASE | cut -d "=" -f 2) && \
21+
echo ${DISTRIB_RELEASE} && \
22+
wget -nv -O /tmp/megacmd.deb https://mega.nz/linux/repo/xUbuntu_${DISTRIB_RELEASE}/amd64/megacmd-xUbuntu_${DISTRIB_RELEASE}_amd64.deb && \
23+
apt install -y "/tmp/megacmd.deb" && \
24+
mega-get https://mega.nz/file/zQwVHSYb#8WqqMUCTbbEVKDW55NPrRnM2-4SC-numNCLDKoTWtwQ /root/ && \
25+
# wget -nv -P /root/ https://musl.cc/aarch64-linux-musl-cross.tgz && \
2026
tar -xvf /root/aarch64-linux-musl-cross.tgz -C /root/ && \
2127
mkdir -p /root/go/
2228

Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ GO_BUILD_STATIC_FIPS = go build -trimpath -buildvcs=false -ldflags "-X 'main.ver
1919
PKG_FILES = build/$(NAME)_$(VERSION).amd64.deb build/$(NAME)_$(VERSION).arm64.deb build/$(NAME)-$(VERSION)-1.amd64.rpm build/$(NAME)-$(VERSION)-1.arm64.rpm
2020
HOST_OS = $(shell bash -c 'source <(go env) && echo $$GOHOSTOS')
2121
HOST_ARCH = $(shell bash -c 'source <(go env) && echo $$GOHOSTARCH')
22+
UBUNTU_VERSION=$(shell lsb_release -r -s)
2223

2324
.PHONY: clean all version test
2425

@@ -61,9 +62,12 @@ build/linux/amd64/$(NAME)-fips build/darwin/amd64/$(NAME)-fips:
6162
grep '_Cfunc__goboringcrypto_' /tmp/$(NAME)-fips-tags.txt 1> /dev/null && \
6263
rm -fv /tmp/$(NAME)-fips-tags.txt
6364

64-
# TODO remove ugly workaround, https://www.perplexity.ai/search/2ead4c04-060a-4d78-a75f-f26835238438
65+
# @TODO remove ugly workaround, https://www.perplexity.ai/search/2ead4c04-060a-4d78-a75f-f26835238438
66+
# @todo ugly fix for ugly fix, musl.cc is not available from github runner
67+
# bash -xce 'if [[ ! -f ~/aarch64-linux-musl-cross/bin/aarch64-linux-musl-gcc ]]; then wget -nv -P ~ https://musl.cc/aarch64-linux-musl-cross.tgz; tar -xvf ~/aarch64-linux-musl-cross.tgz -C ~; fi' && \
68+
6569
build/linux/arm64/$(NAME)-fips build/darwin/arm64/$(NAME)-fips:
66-
bash -xce 'if [[ ! -f ~/aarch64-linux-musl-cross/bin/aarch64-linux-musl-gcc ]]; then wget -nv -P ~ https://musl.cc/aarch64-linux-musl-cross.tgz; tar -xvf ~/aarch64-linux-musl-cross.tgz -C ~; fi' && \
70+
bash -xce 'if [[ ! -f ~/aarch64-linux-musl-cross/bin/aarch64-linux-musl-gcc ]]; then rm -rf ~/aarch64-linux-musl-cross; curl -sL -o /tmp/megacmd.deb https://mega.nz/linux/repo/xUbuntu_$(UBUNTU_VERSION)/amd64/megacmd-xUbuntu_$(UBUNTU_VERSION)_amd64.deb; sudo apt install -y /tmp/megacmd.deb; mega-get https://mega.nz/file/zQwVHSYb#8WqqMUCTbbEVKDW55NPrRnM2-4SC-numNCLDKoTWtwQ ~/; tar -xvf ~/aarch64-linux-musl-cross.tgz -C ~; fi' && \
6771
CC=~/aarch64-linux-musl-cross/bin/aarch64-linux-musl-gcc GOEXPERIMENT=boringcrypto CGO_ENABLED=1 GOOS=$(GOOS) GOARCH=$(GOARCH) $(GO_BUILD_STATIC_FIPS) -o $@ ./cmd/$(NAME) && \
6872
go tool nm $@ > /tmp/$(NAME)-fips-tags.txt && \
6973
grep '_Cfunc__goboringcrypto_' /tmp/$(NAME)-fips-tags.txt 1> /dev/null && \

0 commit comments

Comments
 (0)