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 f37f29b
Show file tree
Hide file tree
Showing 13 changed files with 410 additions and 128 deletions.
15 changes: 9 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,rustls-tls,test-suite"

- 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,rustls-tls,test-suite"

# 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 All @@ -50,6 +49,10 @@ jobs:
if: ${{ matrix.profile == 'debug' }}
run: cross build --locked --target=${{ matrix.platform.target }} --workspace --all-targets ${{ matrix.platform.args }}

- name: Setup tmate session
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3

- name: Build Release
if: ${{ matrix.profile == 'release' }}
run: cross build --locked --target=${{ matrix.platform.target }} --workspace --all-targets ${{ matrix.platform.args }} --release
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 f37f29b

Please sign in to comment.