Skip to content

Commit

Permalink
Removed useless build of musl and updated examples
Browse files Browse the repository at this point in the history
- Zig 0.12 package was moved from Alpine's Edge Testing to Edge
  Community
  • Loading branch information
7Zifle committed Apr 29, 2024
1 parent 4708ba5 commit 896d71c
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 26 deletions.
2 changes: 1 addition & 1 deletion examples/dealer_rep_client/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub fn build(b: *std.Build) void {
.optimize = optimize,
});

exe.addModule("zzmq", zzmq.module("zzmq"));
exe.root_module.addImport("zzmq", zzmq.module("zzmq"));

exe.linkSystemLibrary("zmq");
exe.linkLibC();
Expand Down
2 changes: 1 addition & 1 deletion examples/dealer_rep_server/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub fn build(b: *std.Build) void {
.optimize = optimize,
});

exe.addModule("zzmq", zzmq.module("zzmq"));
exe.root_module.addImport("zzmq", zzmq.module("zzmq"));

exe.linkSystemLibrary("zmq");
exe.linkLibC();
Expand Down
2 changes: 1 addition & 1 deletion examples/hello_world_client/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub fn build(b: *std.Build) void {
.optimize = optimize,
});

exe.addModule("zzmq", zzmq.module("zzmq"));
exe.root_module.addImport("zzmq", zzmq.module("zzmq"));

exe.linkSystemLibrary("zmq");
exe.linkLibC();
Expand Down
2 changes: 1 addition & 1 deletion examples/hello_world_server/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub fn build(b: *std.Build) void {
.optimize = optimize,
});

exe.addModule("zzmq", zzmq.module("zzmq"));
exe.root_module.addImport("zzmq", zzmq.module("zzmq"));

exe.linkSystemLibrary("zmq");
exe.linkLibC();
Expand Down
25 changes: 3 additions & 22 deletions test.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,30 +1,11 @@
FROM alpine:3.19 as builder

# Install necessary tools for building musl
RUN apk add --no-cache clang make

# Download musl source code
RUN wget https://musl.libc.org/releases/musl-1.2.4.tar.gz

# Extract the source code
RUN tar -xzvf musl-1.2.4.tar.gz

# Navigate into the musl directory
WORKDIR /musl-1.2.4

# Configure, build, and install musl
RUN ./configure && make && make install

# Cleanup
WORKDIR /
RUN rm -rf /musl-1.2.4 musl-1.2.4.tar.gz

# install Zig 0.12 from Alpine edge repo: https://pkgs.alpinelinux.org/package/edge/testing/x86_64/zig
RUN echo "@testing https://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
RUN apk add --no-cache zig@testing~=0.12.0
RUN echo "@edge-community https://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories
RUN apk add --no-cache zig@edge-community~=0.12.0

# install dependencies
RUN apk add --no-cache zeromq-dev
RUN apk add --no-cache zeromq-dev clang

COPY . /build/

Expand Down

0 comments on commit 896d71c

Please sign in to comment.