Skip to content

Commit

Permalink
Feature vendored OpenSSL for static builds
Browse files Browse the repository at this point in the history
  • Loading branch information
DanGould committed Nov 20, 2022
1 parent ce6258f commit 9abd27d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
10 changes: 10 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ spec = "config_spec.toml"

[features]
test_paths = []
# If enabled, the crate will compile and statically link to a vendored copy of OpenSSL. This feature has no effect on Windows and macOS, where OpenSSL is not used.
vendored = ["hyper-tls/vendored"]

[dependencies]
bitcoin = { version = "0.28.1", features = ["use-serde"] }
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ RUN echo "Preparing to cargo build for x86_64 (${TARGETARCH})"
RUN apt-get update && apt-get install -y musl-tools musl-dev
# Add our x86 target to rust, then compile and install
RUN rustup target add x86_64-unknown-linux-musl
RUN cargo --config "net.git-fetch-with-cli=true" install --target x86_64-unknown-linux-musl --path .
RUN cargo --config "net.git-fetch-with-cli=true" install -F vendored --target x86_64-unknown-linux-musl --path .

# ARM
FROM builder AS branch-version-arm64
Expand All @@ -40,7 +40,7 @@ RUN rustup target add aarch64-unknown-linux-musl
ENV CC_aarch64_unknown_linux_musl=clang
ENV AR_aarch64_unknown_linux_musl=llvm-ar
ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_RUSTFLAGS="-Clink-self-contained=yes -Clinker=rust-lld"
RUN cargo --config "net.git-fetch-with-cli=true" install --target aarch64-unknown-linux-musl --path .
RUN cargo --config "net.git-fetch-with-cli=true" install -F vendored --target aarch64-unknown-linux-musl --path .

# We build for either x86_64 or ARM from above options using the docker $TARGETARCH
FROM branch-version-${TARGETARCH} AS chosen_builder
Expand Down

0 comments on commit 9abd27d

Please # to comment.