Skip to content

Commit

Permalink
chore: Allow to build with rustls
Browse files Browse the repository at this point in the history
ring 0.17 supports RISC-V, so building Pulsar with rustls instead
of OpenSSL is possible.

Choice of the TLS library is exposed by the following features
in the `smtp-notifier` crate:

* `native-tls` - uses the native TLS library in the system, usually
  OpenSSL. Enabled by default.
* `boring-tls` - uses BoringSSL. Disabled by default.
* `rustls-tls` - uses rustls. Disabled by default.

When building Pulsar with Cargo, the native TLS is going to be used.

However, for binary builds for Github releases, rustls is being
used, since it's always statically built and doesn't require any
runtime dependencies from the users.
  • Loading branch information
vadorovsky committed Dec 18, 2023
1 parent a158059 commit 93ca5ef
Show file tree
Hide file tree
Showing 7 changed files with 334 additions and 103 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,19 @@ jobs:
- target: x86_64-unknown-linux-gnu
args: "--features full"

# For `musl` builds openssl must be vendored
# For `musl` builds, we need to use rustls
- target: x86_64-unknown-linux-musl
args: "--features full --features openssl-vendored"
args: "--no-default-features --features full --features rustls-tls"

- target: aarch64-unknown-linux-gnu
args: "--features full"

# For `musl` builds openssl must be vendored
# For `musl` builds, we need to use rustls
- target: aarch64-unknown-linux-musl
args: "--features full --features openssl-vendored"
args: "--no-default-features --features full --features rustls-tls"

# Dependencies of `xtask` might fail to build on riscv64.
- target: riscv64gc-unknown-linux-gnu
args: "--features full --exclude xtask"
args: "--features full"

steps:
- name: Code checkout
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/quality.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,14 @@ jobs:
- target: x86_64-unknown-linux-gnu
args: "--features full"

# For `musl` builds openssl must be vendored
- target: x86_64-unknown-linux-musl
args: "--features full --features openssl-vendored"
args: "--features full"

- target: aarch64-unknown-linux-gnu
args: "--features full"

# For `musl` builds openssl must be vendored
- target: aarch64-unknown-linux-musl
args: "--features full --features openssl-vendored"
args: "--features full"

# Dependencies of `xtask` might fail to build on riscv64.
- target: riscv64gc-unknown-linux-gnu
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,25 +53,25 @@ jobs:
matrix:
platform:
- target: x86_64-unknown-linux-gnu
args: "--features full --features openssl-vendored"
args: "--no-default-features --features smtp-notifier/rustls-tls"
docker:
base-image: debian:bookworm
platform: linux/amd64

- target: x86_64-unknown-linux-musl
args: "--features full --features openssl-vendored"
args: "--no-default-features --features smtp-notifier/rustls-tls"

- target: aarch64-unknown-linux-gnu
args: "--features full --features openssl-vendored"
args: "--no-default-features --features smtp-notifier/rustls-tls"
docker:
base-image: debian:bookworm
platform: linux/arm64

- target: aarch64-unknown-linux-musl
args: "--features full --features openssl-vendored"
args: "--no-default-features --features smtp-notifier/rustls-tls"

- target: riscv64gc-unknown-linux-gnu
args: "--features full --features openssl-vendored"
args: "--no-default-features --features smtp-notifier/rustls-tls"
docker:
base-image: debian:sid
platform: linux/riscv64
Expand Down
Loading

0 comments on commit 93ca5ef

Please sign in to comment.