From 19fe1d37e78bbff37201ba8523ac328ef6c9afb3 Mon Sep 17 00:00:00 2001 From: KtorZ Date: Wed, 2 Oct 2024 10:50:54 +0200 Subject: [PATCH] Make bundling of ssl conditionned by target environment instead of feature flag. --- .github/workflows/tests.yml | 2 +- Cargo.toml | 4 ---- crates/aiken/Cargo.toml | 4 +--- crates/aiken/src/main.rs | 2 +- 4 files changed, 3 insertions(+), 9 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7f695874..baa16aab 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -22,7 +22,7 @@ jobs: run: | sudo apt-get install -y pkg-config libssl-dev musl musl-dev musl-tools rustup target add x86_64-unknown-linux-musl - cargo install --path=crates/aiken -F bundle_openssl --target=x86_64-unknown-linux-musl + cargo install --path=crates/aiken --target=x86_64-unknown-linux-musl mv $(which aiken) aiken ldd aiken - uses: actions/upload-artifact@v4 diff --git a/Cargo.toml b/Cargo.toml index 2abd5b97..6afb0a11 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,10 +43,6 @@ publish-prereleases = true # as one would normally write them in a workflow. github-build-setup = "../musl-build-setup.yml" -[[workspace.metadata.dist.artifact]] -target = "x86_64-unknown-linux-musl" -features = ["bundle_openssl"] - # Cargo-dist uses ubuntu-20.04 by default, causing issues in various cases # because it links with openssl-1.1 whereas recent distro ships with 3.x [workspace.metadata.dist.github-custom-runners] diff --git a/crates/aiken/Cargo.toml b/crates/aiken/Cargo.toml index 9eb8a1dc..f586788a 100644 --- a/crates/aiken/Cargo.toml +++ b/crates/aiken/Cargo.toml @@ -47,11 +47,9 @@ serde_json = "1.0.94" thiserror = "1.0.39" uplc = { path = '../uplc', version = "1.1.4" } +[target.'cfg(target_env = "musl")'.dependencies] openssl = { version = "0.10.66", features = ["vendored"], optional = true } openssl-probe = { version = "0.1.5", optional = true } -[features] -bundle_openssl = ["dep:openssl", "dep:openssl-probe"] - [target.'cfg(not(windows))'.dependencies] xdg = "2.5.2" diff --git a/crates/aiken/src/main.rs b/crates/aiken/src/main.rs index 59819910..cd23a9e4 100644 --- a/crates/aiken/src/main.rs +++ b/crates/aiken/src/main.rs @@ -14,7 +14,7 @@ mod cmd; fn main() -> miette::Result<()> { panic_handler(); - #[cfg(feature = "bundle_openssl")] + #[cfg(target_env = "musl")] openssl_probe::init_ssl_cert_env_vars(); match Cmd::default() {