Skip to content

Commit

Permalink
feat: allow user to choose if they bundle tls library or not
Browse files Browse the repository at this point in the history
By gating the `reqwest/native-tls-vendored` feature behind the
`bundle_tls` feature (renamed from `bundle_openssl` and added to
`mithril-relay` and `mithril-end-to-end`).
  • Loading branch information
Alenar committed Jan 29, 2025
1 parent 1bb0fbd commit 325686c
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 16 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ jobs:
# We separate the build in 2 steps as we want to avoid side effects with Rust feature unification.
- name: Cargo build - Tooling
shell: bash
run: cargo build --release --bin mithril-end-to-end --bin load-aggregator
run: cargo build --release --bin mithril-end-to-end --bin load-aggregator --features bundle_tls

- name: Build Mithril workspace & publish artifacts
uses: ./.github/workflows/actions/build-upload-mithril-artifact
with:
binaries-build-args: --bin mithril-aggregator --bin mithril-signer --bin mithril-client --bin mithril-relay --features bundle_openssl,full
binaries-build-args: --bin mithril-aggregator --bin mithril-signer --bin mithril-client --bin mithril-relay --features bundle_tls,full
libraries-build-args: --package mithril-stm --package mithril-client --features full,unstable

- name: Build Debian packages
Expand Down Expand Up @@ -81,15 +81,15 @@ jobs:
include:
# Only build client on windows & mac
- os: macos-14
binaries-build-args: --bin mithril-client --features bundle_openssl
binaries-build-args: --bin mithril-client --features bundle_tls
libraries-build-args: --package mithril-stm --package mithril-client --features full,unstable
- os: macos-14-large
binaries-build-args: --bin mithril-client --features bundle_openssl
binaries-build-args: --bin mithril-client --features bundle_tls
libraries-build-args: --package mithril-stm --package mithril-client --features full,unstable
- os: windows-latest
# Use `--bins --package <package>` instead of `--bin <package>`, otherwise the 'windows' compatibility
# hack in mithril common cargo.toml doesn't apply (we have no idea why).
binaries-build-args: --bins --package mithril-client-cli --features bundle_openssl
binaries-build-args: --bins --package mithril-client-cli --features bundle_tls
libraries-build-args: --package mithril-stm --package mithril-client --no-default-features --features num-integer-backend,full,unstable
runs-on: ${{ matrix.os }}

Expand Down
4 changes: 2 additions & 2 deletions mithril-aggregator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ paste = "1.0.15"
prometheus = "0.13.4"
rayon = "1.10.0"
regex = "1.11.1"
reqwest = { version = "0.12.12", features = ["json", "native-tls-vendored"] }
reqwest = { version = "0.12.12", features = ["json"] }
semver = "1.0.24"
serde = { version = "1.0.217", features = ["derive"] }
serde_json = "1.0.134"
Expand Down Expand Up @@ -78,5 +78,5 @@ tempfile = "3.14.0"
[features]
default = ["jemallocator"]

bundle_openssl = []
bundle_tls = ["reqwest/native-tls-vendored"]
jemallocator = ["dep:tikv-jemallocator"]
2 changes: 1 addition & 1 deletion mithril-aggregator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ CARGO = cargo
all: test build

build:
${CARGO} build --release --features bundle_openssl
${CARGO} build --release --features bundle_tls
cp ../target/release/mithril-aggregator .

run: build
Expand Down
4 changes: 2 additions & 2 deletions mithril-client-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ fs2 = "0.4.3"
futures = "0.3.31"
human_bytes = { version = "0.4.3", features = ["fast"] }
indicatif = { version = "0.17.9", features = ["tokio"] }
mithril-client = { path = "../mithril-client", features = ["fs", "native-tls-vendored", "unstable"] }
mithril-client = { path = "../mithril-client", features = ["fs", "unstable"] }
mithril-doc = { path = "../internal/mithril-doc" }
serde = { version = "1.0.217", features = ["derive"] }
serde_json = "1.0.134"
Expand All @@ -50,4 +50,4 @@ tokio = { version = "1.42.0", features = ["full"] }
mithril-common = { path = "../mithril-common", features = ["test_tools"] }

[features]
bundle_openssl = []
bundle_tls = ["mithril-client/native-tls-vendored"]
2 changes: 1 addition & 1 deletion mithril-client-cli/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ CARGO = cargo
all: test build

build:
${CARGO} build --release --features bundle_openssl
${CARGO} build --release --features bundle_tls
cp ../target/release/mithril-client .

run: build
Expand Down
5 changes: 4 additions & 1 deletion mithril-relay/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ libp2p = { version = "0.54.1", features = [
] }
mithril-common = { path = "../mithril-common", features = ["full"] }
mithril-doc = { path = "../internal/mithril-doc" }
reqwest = { version = "0.12.12", features = ["json", "native-tls-vendored"] }
reqwest = { version = "0.12.12", features = ["json"] }
serde = { version = "1.0.217", features = ["derive"] }
serde_json = "1.0.134"
serde_yaml = "0.9.34"
Expand All @@ -50,3 +50,6 @@ warp = "0.3.7"
[dev-dependencies]
slog-scope = "4.4.0"
slog-term = "2.9.1"

[features]
bundle_tls = ["reqwest/native-tls-vendored"]
4 changes: 2 additions & 2 deletions mithril-signer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ paste = "1.0.15"
prometheus = "0.13.4"
rand_chacha = "0.3.1"
rand_core = "0.6.4"
reqwest = { version = "0.12.12", features = ["json", "native-tls-vendored", "stream"] }
reqwest = { version = "0.12.12", features = ["json", "stream"] }
serde = { version = "1.0.217", features = ["derive"] }
serde_json = "1.0.134"
slog = { version = "2.7.0", features = [
Expand Down Expand Up @@ -58,5 +58,5 @@ slog-term = "2.9.1"
[features]
default = ["jemallocator"]

bundle_openssl = []
bundle_tls = ["reqwest/native-tls-vendored"]
jemallocator = ["dep:tikv-jemallocator"]
2 changes: 1 addition & 1 deletion mithril-signer/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ CARGO = cargo
all: test build

build:
${CARGO} build --release --features bundle_openssl
${CARGO} build --release --features bundle_tls
cp ../target/release/mithril-signer .

run: build
Expand Down
3 changes: 2 additions & 1 deletion mithril-test-lab/mithril-end-to-end/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ hex = "0.4.3"
indicatif = { version = "0.17.9", features = ["tokio"] }
mithril-common = { path = "../../mithril-common", features = ["full"] }
mithril-doc = { path = "../../internal/mithril-doc" }
reqwest = { version = "0.12.12", features = ["json", "native-tls-vendored"] }
reqwest = { version = "0.12.12", features = ["json"] }
serde = { version = "1.0.217", features = ["derive"] }
serde_json = "1.0.134"
serde_yaml = "0.9.34"
Expand All @@ -42,3 +42,4 @@ tokio-util = { version = "0.7.13", features = ["codec"] }
[features]
default = []
allow_skip_signer_certification = []
bundle_tls = ["reqwest/native-tls-vendored"]

0 comments on commit 325686c

Please sign in to comment.