Skip to content

Commit b383fab

Browse files
davidknaByron
authored andcommitted
restrict sha1 asm to supported archs
1 parent 9245083 commit b383fab

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ git-hash = { opt-level = 3 }
102102
git-actor = { opt-level = 3 }
103103
git-config = { opt-level = 3 }
104104
miniz_oxide = { opt-level = 3 }
105-
sha-1 = { opt-level = 3 }
105+
sha1 = { opt-level = 3 }
106106
sha1_smol = { opt-level = 3 }
107107

108108
[profile.release]

git-features/Cargo.toml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ zlib-rust-backend = ["flate2/rust_backend"]
5050
## A multi-crate implementation that can use hardware acceleration, thus bearing the potential for up to 2Gb/s throughput on
5151
## CPUs that support it, like AMD Ryzen or Intel Core i3, as well as Apple Silicon like M1.
5252
## Takes precedence over `rustsha1` if both are specified.
53-
fast-sha1 = ["sha-1"]
53+
fast-sha1 = ["sha1"]
5454
## A standard and well performing pure Rust implementation of Sha1. Will significantly slow down various git operations.
5555
rustsha1 = ["sha1_smol"]
5656

@@ -106,7 +106,7 @@ walkdir = { version = "2.3.2", optional = true } # used when parallel is off
106106
# hashing and 'fast-sha1' feature
107107
sha1_smol = { version = "1.0.0", optional = true }
108108
crc32fast = { version = "1.2.1", optional = true }
109-
sha-1 = { version = "0.10.0", optional = true }
109+
sha1 = { version = "0.10.0", optional = true }
110110

111111
# progress
112112
prodash = { version = "19.0.0", optional = true, default-features = false, features = ["unit-bytes", "unit-human"] }
@@ -133,10 +133,9 @@ bstr = { version = "0.2.15", default-features = false }
133133

134134

135135
# Assembly doesn't yet compile on MSVC on windows, but does on GNU, see https://github.com/RustCrypto/asm-hashes/issues/17
136-
# TODO: potentially include it only for certain architectures
137-
# [target.'cfg(all(any(target_arch = "x86", target_arch = "x86_64"), not(target_env = "msvc")))'.dependencies]
138-
[target.'cfg(not(target_env = "msvc"))'.dependencies]
139-
sha-1 = { version = "0.10.0", optional = true, features = ["asm"] }
136+
# At this time, only aarch64, x86 and x86_64 are supported.
137+
[target.'cfg(all(any(target_arch = "aarch64", target_arch = "x86", target_arch = "x86_64"), not(target_env = "msvc")))'.dependencies]
138+
sha1 = { version = "0.10.0", optional = true, features = ["asm"] }
140139

141140
[package.metadata.docs.rs]
142141
all-features = true

0 commit comments

Comments
 (0)