Skip to content

Commit 45273a2

Browse files
committed
feat: [PPT-2525] Update crystal build for unwind support
1 parent 4162383 commit 45273a2

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

Dockerfile

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ RUN adduser \
2323
--uid "${UID}" \
2424
"${USER}"
2525

26+
RUN apk add \
27+
--update \
28+
--no-cache \
29+
libunwind-static \
30+
libunwind-dev \
31+
xz-static \
32+
xz-dev
33+
2634
# Install shards for caching
2735
COPY shard.yml .
2836
COPY shard.override.yml .
@@ -37,13 +45,21 @@ COPY ./src /app/src
3745
RUN UNAME_AT_COMPILE_TIME=true \
3846
PLACE_COMMIT=$PLACE_COMMIT \
3947
PLACE_VERSION=$PLACE_VERSION \
40-
shards build --production --error-trace --static
48+
shards build \
49+
--debug \
50+
--error-trace \
51+
--no-color \
52+
--static \
53+
-O1 \
54+
--frame-pointers=always \
55+
--link-flags "-no-pie -Wl,-no-pie -Wl,--eh-frame-hdr -Wl,--build-id -rdynamic -Wl,--export-dynamic -lunwind -llzma"
4156

4257
SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
4358

4459
# Extract binary dependencies
4560
RUN mkdir deps
4661
RUN for binary in /app/bin/*; do \
62+
file "$binary" | grep -q ELF || continue; \
4763
ldd "$binary" | \
4864
tr -s '[:blank:]' '\n' | \
4965
grep '^/' | \

0 commit comments

Comments
 (0)