speedup git shallow cloning: Enable gix/max-performance (#1186)

for targets:
 - x86_64-apple-darwin
 - aarch64-apple-darwin
 - x86_64-unknown-linux-gnu
 - x86_64-unknown-linux-musl

which will use `zlib-ng` to speedup decompression and use assembly
version for sha1 checksum calculation on supported CPU.

Also enable feature `zlib-ng` on windows and
 - aarch64-unknown-linux-gnu
 - aarch64-unknown-linux-musl

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2023-07-10 16:18:15 +10:00 committed by GitHub
parent 7dea40a99a
commit 9d4694219b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 58 additions and 2 deletions

View file

@ -73,9 +73,32 @@ support-pkg-config := if target == target-host {
if target-os == "linux" { "true" } else { "" }
} else { "" }
enable-git-max-perf-feature := if target == "x86_64-apple-darwin" {
"true"
} else if target == "aarch64-apple-darwin" {
"true"
} else if target == "x86_64-unknown-linux-gnu" {
"true"
} else if target == "x86_64-unknown-linux-musl" {
"true"
} else {
"false"
}
git-max-perf-feature := if enable-git-max-perf-feature == "true" {
",git-max-perf"
} else if target-os == "windows" {
",zlib-ng"
} else if target == "aarch64-unknown-linux-gnu" {
",zlib-ng"
} else if target == "aarch64-unknown-linux-musl" {
",zlib-ng"
} else {
""
}
cargo-features := trim_end_match(if override-features != "" { override-features
} else if (cargo-profile / ci-or-no) == "dev/ci" { "git,rustls,fancy-with-backtrace,zstd-thin,log_max_level_debug" + (if support-pkg-config != "" { ",pkg-config" } else { "" }) + 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" + extra-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 { "" }) + 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 + extra-features
} else { extra-features
}, ",")