Skip to content

Commit f37f29b

Browse files
committed
chore: Allow to build with rustls
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.
1 parent a158059 commit f37f29b

File tree

13 files changed

+410
-128
lines changed

13 files changed

+410
-128
lines changed

.github/workflows/build.yaml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,19 @@ jobs:
1919
- target: x86_64-unknown-linux-gnu
2020
args: "--features full"
2121

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

2626
- target: aarch64-unknown-linux-gnu
2727
args: "--features full"
2828

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

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

3736
steps:
3837
- name: Code checkout
@@ -50,6 +49,10 @@ jobs:
5049
if: ${{ matrix.profile == 'debug' }}
5150
run: cross build --locked --target=${{ matrix.platform.target }} --workspace --all-targets ${{ matrix.platform.args }}
5251

52+
- name: Setup tmate session
53+
if: ${{ failure() }}
54+
uses: mxschmitt/action-tmate@v3
55+
5356
- name: Build Release
5457
if: ${{ matrix.profile == 'release' }}
5558
run: cross build --locked --target=${{ matrix.platform.target }} --workspace --all-targets ${{ matrix.platform.args }} --release

.github/workflows/quality.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,14 @@ jobs:
5252
- target: x86_64-unknown-linux-gnu
5353
args: "--features full"
5454

55-
# For `musl` builds openssl must be vendored
5655
- target: x86_64-unknown-linux-musl
57-
args: "--features full --features openssl-vendored"
56+
args: "--features full"
5857

5958
- target: aarch64-unknown-linux-gnu
6059
args: "--features full"
6160

62-
# For `musl` builds openssl must be vendored
6361
- target: aarch64-unknown-linux-musl
64-
args: "--features full --features openssl-vendored"
62+
args: "--features full"
6563

6664
# Dependencies of `xtask` might fail to build on riscv64.
6765
- target: riscv64gc-unknown-linux-gnu

.github/workflows/release.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,25 +53,25 @@ jobs:
5353
matrix:
5454
platform:
5555
- target: x86_64-unknown-linux-gnu
56-
args: "--features full --features openssl-vendored"
56+
args: "--no-default-features --features smtp-notifier/rustls-tls"
5757
docker:
5858
base-image: debian:bookworm
5959
platform: linux/amd64
6060

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

6464
- target: aarch64-unknown-linux-gnu
65-
args: "--features full --features openssl-vendored"
65+
args: "--no-default-features --features smtp-notifier/rustls-tls"
6666
docker:
6767
base-image: debian:bookworm
6868
platform: linux/arm64
6969

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

7373
- target: riscv64gc-unknown-linux-gnu
74-
args: "--features full --features openssl-vendored"
74+
args: "--no-default-features --features smtp-notifier/rustls-tls"
7575
docker:
7676
base-image: debian:sid
7777
platform: linux/riscv64

0 commit comments

Comments
 (0)