Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zig: use via apk #34

Merged
merged 1 commit into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
path: ~/.cache/zig
- run: |
wget --progress=dot:mega \
https://ziglang.org/download/0.11.0/zig-linux-$(uname -m)-0.11.0.tar.xz
https://ziglang.org/download/0.12.0/zig-linux-$(uname -m)-0.12.0.tar.xz
tar -xJf zig-linux-*.tar.xz
rm zig-linux-*.xz
mv zig-linux-* zig-sdk
Expand Down
17 changes: 4 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@
FROM alpine
FROM alpine:edge

# zig is installed from the upstream tarball, because:
# - as of writing, alpine has zig only in testing (which is cumbersome to use)
# - apk get zig pulls in libllvm, which is huge.
#
# Upstream tarball is statically linked, making it small and convenient to use.
RUN apk add make \
&& wget https://ziglang.org/download/0.12.0/zig-linux-$(uname -m)-0.12.0.tar.xz \
&& tar -xJf zig-linux-*.tar.xz \
&& rm zig-linux-*.xz \
&& mv zig-linux-* zig
RUN apk add make zig

WORKDIR inotify-info

COPY . .

RUN CC="/zig/zig cc -target $(uname -m)-linux-musl" \
CXX="/zig/zig c++ -target $(uname -m)-linux-musl" \
RUN CC="zig cc -target $(uname -m)-linux-musl" \
CXX="zig c++ -target $(uname -m)-linux-musl" \
make

FROM scratch
Expand Down