diff --git a/Cargo.lock b/Cargo.lock index d997993..40b287d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2468,6 +2468,15 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" +[[package]] +name = "openssl-src" +version = "300.4.1+3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "faa4eac4138c62414b5622d1b31c5c304f34b406b013c079c2bbc652fdd6678c" +dependencies = [ + "cc", +] + [[package]] name = "openssl-sys" version = "0.9.104" @@ -2476,6 +2485,7 @@ checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" dependencies = [ "cc", "libc", + "openssl-src", "pkg-config", "vcpkg", ] @@ -3420,6 +3430,7 @@ dependencies = [ "log", "mockall", "notify", + "openssl", "pretty-duration", "rand", "rand_chacha", diff --git a/Cargo.toml b/Cargo.toml index 732cdc3..9c3b46d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,6 +35,7 @@ hyper-util = { version = "0.1", features = ["full"] } itertools = "0.13.0" log = "0.4.22" notify = "7.0.0" +openssl = { version = "0.10.68", features = ["vendored"] } pretty-duration = "0.1.1" rand = "0.8.5" rand_chacha = "0.3.1" diff --git a/Dockerfile.ci b/Dockerfile.ci index 46a4052..be89cf0 100644 --- a/Dockerfile.ci +++ b/Dockerfile.ci @@ -1,17 +1,16 @@ FROM --platform=$BUILDPLATFORM rust:1.82.0-alpine3.20 AS builder -RUN apk add --no-cache musl-dev libressl-dev +RUN apk add --no-cache musl-dev libressl-dev perl build-base zig +RUN cargo install --locked cargo-zigbuild RUN rustup target add x86_64-unknown-linux-musl aarch64-unknown-linux-musl WORKDIR /app COPY Cargo.toml Cargo.lock . RUN mkdir src \ && echo "fn main() {}" > src/main.rs \ && cargo fetch \ - && cargo build --release --target x86_64-unknown-linux-musl \ - && cargo build --release --target aarch64-unknown-linux-musl \ + && cargo zigbuild --release --target x86_64-unknown-linux-musl --target aarch64-unknown-linux-musl \ && rm src/main.rs COPY src ./src -RUN cargo build --release --target x86_64-unknown-linux-musl \ - && cargo build --release --target aarch64-unknown-linux-musl \ +RUN cargo zigbuild --release --target x86_64-unknown-linux-musl --target aarch64-unknown-linux-musl \ && mkdir -p /app/release/linux \ && cp /app/target/x86_64-unknown-linux-musl/release/sandhole /app/release/linux/amd64 \ && cp /app/target/aarch64-unknown-linux-musl/release/sandhole /app/release/linux/arm64