Skip to content

Commit 94ff37d

Browse files
authored
Merge pull request #31 from Recidiviz/dan/try-fPIC
Fix crash when running on arm64
2 parents cbdcd88 + 414da48 commit 94ff37d

File tree

3 files changed

+4
-14
lines changed

3 files changed

+4
-14
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
artifact_name: bigquery-emulator
2323
asset_name: bigquery-emulator-linux-amd64
2424
platform: linux/amd64
25-
- runner: runs-on=${{github.run_id}}/runner=4cpu-linux-arm64
25+
- runner: ubuntu-24.04-arm
2626
artifact_name: bigquery-emulator
2727
asset_name: bigquery-emulator-linux-arm64
2828
platform: linux/arm64

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ RUN go mod download
1111

1212
RUN make emulator/build
1313

14-
FROM debian:bullseye AS emulator
14+
# Since the binary uses dynamic linking we must use the same base image as the build runtime
15+
FROM ghcr.io/recidiviz/go-zetasql:0.5.5-recidiviz.3 AS emulator
1516

1617
COPY --from=0 /work/bigquery-emulator /bin/bigquery-emulator
1718

Makefile

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,8 @@
11
VERSION ?= latest
22
REVISION := $(shell git rev-parse --short HEAD)
33

4-
UNAME_OS := $(shell uname -s)
5-
UNAME_ARCH := $(shell uname -m)
6-
ifeq ($(UNAME_OS),Linux)
7-
ifeq ($(UNAME_ARCH),aarch64)
8-
STATIC_LINK_FLAG := -linkmode external -extldflags "-static -fPIE -v"
9-
else
10-
STATIC_LINK_FLAG := -linkmode external -extldflags "-static -v"
11-
endif
12-
endif
13-
144
emulator/build:
15-
CGO_ENABLED=1 CXX=clang++ CGO_CFLAGS="-fPIE" CGO_CXXFLAGS="-fPIE" go build -work -a -x -o bigquery-emulator \
16-
-ldflags='${STATIC_LINK_FLAG}' \
5+
CGO_ENABLED=1 CXX=clang++ go build -o bigquery-emulator \
176
./cmd/bigquery-emulator
187

198
docker/build:

0 commit comments

Comments
 (0)