Use flate2/zlib-rs for dev/release build (#2068)

* Add feature zlib-rs to binstalk-downloader

Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>

* Add feature zlib-rs to binstalk

Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>

* Add feature zlib-rs to cargo-binstall

Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>

* Enable zlib-rs for CI build pipeline

Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>

---------

Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
This commit is contained in:
Jiahao XU 2025-02-28 19:08:34 +10:00 committed by GitHub
parent 72ddf9c3f4
commit 712ad730a6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 5 additions and 22 deletions

View file

@ -63,6 +63,7 @@ static = ["binstalk/static"]
pkg-config = ["binstalk/pkg-config"] pkg-config = ["binstalk/pkg-config"]
zlib-ng = ["binstalk/zlib-ng"] zlib-ng = ["binstalk/zlib-ng"]
zlib-rs = ["binstalk/zlib-rs"]
rustls = ["binstalk/rustls"] rustls = ["binstalk/rustls"]
native-tls = ["binstalk/native-tls"] native-tls = ["binstalk/native-tls"]

View file

@ -88,6 +88,7 @@ static = ["bzip2/static", "xz2/static", "native-tls-crate?/vendored"]
pkg-config = ["zstd/pkg-config"] pkg-config = ["zstd/pkg-config"]
zlib-ng = ["flate2/zlib-ng"] zlib-ng = ["flate2/zlib-ng"]
zlib-rs = ["flate2/zlib-rs"]
# Dummy feature, enabled if rustls or native-tls is enabled. # Dummy feature, enabled if rustls or native-tls is enabled.
# Used to avoid compilation error when no feature is enabled. # Used to avoid compilation error when no feature is enabled.

View file

@ -56,6 +56,7 @@ static = ["binstalk-downloader/static"]
pkg-config = ["binstalk-downloader/pkg-config"] pkg-config = ["binstalk-downloader/pkg-config"]
zlib-ng = ["binstalk-downloader/zlib-ng"] zlib-ng = ["binstalk-downloader/zlib-ng"]
zlib-rs = ["binstalk-downloader/zlib-rs"]
rustls = ["binstalk-downloader/rustls", "binstalk-registry/rustls"] rustls = ["binstalk-downloader/rustls", "binstalk-registry/rustls"]
native-tls = ["binstalk-downloader/native-tls", "binstalk-registry/native-tls"] native-tls = ["binstalk-downloader/native-tls", "binstalk-registry/native-tls"]

View file

@ -79,30 +79,10 @@ support-pkg-config := if target == target-host {
if target-os == "linux" { "true" } else { "" } if target-os == "linux" { "true" } else { "" }
} else { "" } } else { "" }
#} else if target == "aarch64-unknown-linux-gnu" {
# ",zlib-ng"
#} else if target == "aarch64-unknown-linux-musl" {
# ",zlib-ng"
git-max-perf-feature := if target == "x86_64-apple-darwin" {
",zlib-ng"
} else if target == "x86_64h-apple-darwin" {
",zlib-ng"
} else if target == "aarch64-apple-darwin" {
",zlib-ng"
} else if target-os == "windows" {
",zlib-ng"
} else if target == "x86_64-unknown-linux-gnu" {
",zlib-ng"
} else if target == "x86_64-unknown-linux-musl" {
",zlib-ng"
} else {
""
}
h3-features := if enable-h3 != "" { ",http3" } else { "" } h3-features := if enable-h3 != "" { ",http3" } else { "" }
cargo-features := trim_end_match(if override-features != "" { override-features + h3-features cargo-features := trim_end_match(if override-features != "" { override-features + h3-features
} else if (cargo-profile / ci-or-no) == "dev/ci" { "git,rustls,fancy-with-backtrace,zstd-thin,log_max_level_debug" + git-max-perf-feature + (if support-pkg-config != "" { ",pkg-config" } else { "" }) + h3-features + extra-features } else if (cargo-profile / ci-or-no) == "dev/ci" { "git,rustls,fancy-with-backtrace,zstd-thin,log_max_level_debug,zlib-rs" + (if support-pkg-config != "" { ",pkg-config" } else { "" }) + h3-features + extra-features
} else if (cargo-profile / ci-or-no) == "release/ci" { "git,static,rustls,trust-dns,fancy-no-backtrace,zstd-thin,log_release_max_level_debug,cross-lang-fat-lto" + git-max-perf-feature + h3-features + extra-features } else if (cargo-profile / ci-or-no) == "release/ci" { "git,static,rustls,trust-dns,fancy-no-backtrace,zstd-thin,log_release_max_level_debug,cross-lang-fat-lto,zlib-rs" + h3-features + extra-features
} else if extra-features != "" { extra-features + h3-features } else if extra-features != "" { extra-features + h3-features
} else if enable-h3 != "" { "http3" } else if enable-h3 != "" { "http3"
} else { "" } else { ""