Skip to content

Commit

Permalink
Merge pull request #1079 from input-output-hk/djo/1073/bundle-openssl
Browse files Browse the repository at this point in the history
Bundle openssl with released binaries
  • Loading branch information
Alenar authored Jul 24, 2023
2 parents c2e8686 + 2a9cf8a commit 54668da
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,19 @@ inputs:
runs:
using: "composite"
steps:
- name: Add commit short sha to Cargo.tomls version
- name: Get label to append to crate versions
id: label
shell: bash
run: echo "short_sha=$(echo ${{ github.sha }} | cut -c1-7)" >> $GITHUB_OUTPUT

- name: Add commit short sha to Cargo.tomls version
shell: ${{ runner.os == 'Windows' && 'pwsh' || 'bash' }}
run: |
pip3 install toml
python3 ./.github/workflows/scripts/edit-cargo-toml-version.py -l $(echo ${{ github.sha }} | cut -c1-7)
python3 ./.github/workflows/scripts/edit-cargo-toml-version.py -l "${{ steps.label.outputs.short_sha }}"
- name: Cargo build - Distribution
shell: bash
shell: ${{ runner.os == 'Windows' && 'pwsh' || 'bash' }}
run: cargo build --release ${{ inputs.build-args }}

- name: Publish Mithril Distribution (${{ runner.os }}-${{ runner.arch }})
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ jobs:

- name: Build Mithril workspace & publish artifacts
uses: ./.github/workflows/actions/build-upload-mithril-artifact
with:
build-args: --features bundle_openssl

- name: Build Debian packages
shell: bash
Expand Down Expand Up @@ -95,7 +97,7 @@ jobs:
- name: Build Mithril workspace & publish artifacts
uses: ./.github/workflows/actions/build-upload-mithril-artifact
with:
build-args: ${{ matrix.build-args }}
build-args: --features bundle_openssl ${{ matrix.build-args }}

test:
strategy:
Expand Down Expand Up @@ -131,7 +133,11 @@ jobs:
shell: bash
run: |
cargo nextest run --profile ci ${{ matrix.test-args }}
# Rename junit file to include runner info
- name: Rename junit file to include runner info
shell: bash
if: success() || failure()
run: |
mv target/nextest/ci/tests-result.junit.xml test-results${{ matrix.artifact-suffix }}-${{ runner.os }}-${{ runner.arch }}.xml
- name: Upload Tests Results
Expand Down
22 changes: 19 additions & 3 deletions Cargo.lock

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

5 changes: 4 additions & 1 deletion mithril-aggregator/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mithril-aggregator"
version = "0.3.54"
version = "0.3.55"
description = "A Mithril Aggregator server"
authors = { workspace = true }
edition = { workspace = true }
Expand All @@ -18,6 +18,8 @@ config = "0.13.1"
flate2 = "1.0.23"
hex = "0.4.3"
mithril-common = { path = "../mithril-common" }
openssl = { version = "*", features = ["vendored"], optional = true }
openssl-probe = { version = "0.1.5", optional = true }
reqwest = { version = "0.11", features = ["json"] }
semver = "1.0.16"
serde = { version = "1.0", features = ["derive"] }
Expand Down Expand Up @@ -46,3 +48,4 @@ tempfile = "3.3.0"

[features]
portable = ["mithril-common/portable"] # portable feature avoids SIGILL crashes on CPUs not supporting Intel ADX instruction set when built on CPUs that support it
bundle_openssl = ["dep:openssl", "dep:openssl-probe"]
3 changes: 3 additions & 0 deletions mithril-aggregator/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,8 @@ async fn main() -> Result<(), String> {
let args = MainOpts::parse();
let _guard = slog_scope::set_global_logger(build_logger(&args));

#[cfg(feature = "bundle_openssl")]
openssl_probe::init_ssl_cert_env_vars();

args.execute().await.map_err(|e| e.to_string())
}
5 changes: 4 additions & 1 deletion mithril-client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mithril-client"
version = "0.3.21"
version = "0.3.22"
description = "A Mithril Client"
authors = { workspace = true }
edition = { workspace = true }
Expand All @@ -24,6 +24,8 @@ hex = "0.4.3"
human_bytes = { version = "0.4.2", features = ["fast"] }
indicatif = { version = "0.17.5", features = ["tokio"] }
mithril-common = { path = "../mithril-common" }
openssl = { version = "*", features = ["vendored"], optional = true }
openssl-probe = { version = "0.1.5", optional = true }
reqwest = { version = "0.11", features = ["json", "stream"] }
semver = "1.0"
serde = { version = "1.0", features = ["derive"] }
Expand All @@ -43,3 +45,4 @@ mockall = "0.11.0"

[features]
portable = ["mithril-common/portable"]
bundle_openssl = ["dep:openssl", "dep:openssl-probe"]
3 changes: 3 additions & 0 deletions mithril-client/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ async fn main() -> Result<(), String> {
let args = Args::parse();
let _guard = slog_scope::set_global_logger(args.build_logger());

#[cfg(feature = "bundle_openssl")]
openssl_probe::init_ssl_cert_env_vars();

args.execute()
.await
.map_err(|e| format!("An error occured: {e}"))
Expand Down
1 change: 0 additions & 1 deletion mithril-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,3 @@ serde_yaml = "0.9.10"
default = []
portable = ["mithril-stm/portable"] # portable feature avoids SIGILL crashes on CPUs not supporting Intel ADX instruction set when built on CPUs that support it
allow_skip_signer_certification = []

5 changes: 4 additions & 1 deletion mithril-signer/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mithril-signer"
version = "0.2.62"
version = "0.2.63"
description = "A Mithril Signer"
authors = { workspace = true }
edition = { workspace = true }
Expand All @@ -15,6 +15,8 @@ clap = { version = "4.0", features = ["derive", "env"] }
config = "0.13.1"
hex = "0.4.3"
mithril-common = { path = "../mithril-common" }
openssl = { version = "*", features = ["vendored"], optional = true }
openssl-probe = { version = "0.1.5", optional = true }
rand_chacha = "0.3.1"
rand_core = "0.6.3"
reqwest = { version = "0.11", features = ["json", "stream"] }
Expand All @@ -36,3 +38,4 @@ slog-term = "2.9.0"

[features]
portable = ["mithril-common/portable"] # portable feature avoids SIGILL crashes on CPUs not supporting Intel ADX instruction set when built on CPUs that support it
bundle_openssl = ["dep:openssl", "dep:openssl-probe"]
3 changes: 3 additions & 0 deletions mithril-signer/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ async fn main() -> Result<(), String> {
let args = Args::parse();
let _guard = slog_scope::set_global_logger(build_logger(args.log_level()));

#[cfg(feature = "bundle_openssl")]
openssl_probe::init_ssl_cert_env_vars();

debug!("Starting"; "node_version" => env!("CARGO_PKG_VERSION"));

// Load config
Expand Down

0 comments on commit 54668da

Please sign in to comment.