Skip to content

Commit fd12ef8

Browse files
committed
change!: drop obsolete SHA‐1 features
The hashing API has moved to `gix_hash::hasher`, and we now use `sha1-checked` unconditionally.
1 parent e4439aa commit fd12ef8

File tree

7 files changed

+11
-27
lines changed

7 files changed

+11
-27
lines changed

Diff for: .github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ jobs:
391391
- name: features of gix-features
392392
run: |
393393
set +x
394-
for feature in progress parallel io-pipe crc32 zlib zlib-rust-backend fast-sha1 rustsha1 cache-efficiency-debug; do
394+
for feature in progress parallel io-pipe crc32 zlib zlib-rust-backend cache-efficiency-debug; do
395395
(cd gix-features && cargo build --features "$feature" --target "$TARGET")
396396
done
397397
- name: crates with 'wasm' feature

Diff for: .github/workflows/release.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,7 @@ jobs:
137137
os: windows-latest
138138
- target: aarch64-pc-windows-msvc
139139
os: windows-latest
140-
# on linux we build with musl which causes trouble with open-ssl. For now, just build max-pure there
141-
# even though we could also build with `--features max-control,http-client-reqwest,gitoxide-core-blocking-client,gix-features/fast-sha1` for fast hashing.
140+
# on linux we build with musl which causes trouble with open-ssl. For now, just build max-pure there.
142141
# It's a TODO.
143142
exclude:
144143
- target: x86_64-unknown-linux-musl

Diff for: Cargo.toml

+7-10
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ max = ["max-control", "fast", "gitoxide-core-tools-query", "gitoxide-core-tools-
4545
## transports as it uses Rust's HTTP implementation.
4646
##
4747
## As fast as possible, with TUI progress, progress line rendering with auto-configuration, all transports available but less mature pure Rust HTTP implementation, all `ein` tools, CLI colors and local-time support, JSON output, regex support for rev-specs.
48-
max-pure = ["max-control", "gix-features/rustsha1", "gix-features/zlib-rust-backend", "http-client-reqwest", "gitoxide-core-blocking-client"]
48+
max-pure = ["max-control", "gix-features/zlib-rust-backend", "http-client-reqwest", "gitoxide-core-blocking-client"]
4949

5050
## Like `max`, but with more control for configuration. See the *Package Maintainers* headline for more information.
5151
max-control = ["tracing", "fast-safe", "pretty-cli", "gitoxide-core-tools", "prodash-render-line", "prodash-render-tui", "prodash/render-line-autoconfigure", "gix/revparse-regex"]
@@ -60,7 +60,7 @@ lean = ["fast", "tracing", "pretty-cli", "http-client-curl", "gitoxide-core-tool
6060
## This build is essentially limited to local operations without any fanciness.
6161
##
6262
## Optimized for size, no parallelism thus much slower, progress line rendering.
63-
small = ["pretty-cli", "gix-features/rustsha1", "gix-features/zlib-rust-backend", "prodash-render-line", "is-terminal"]
63+
small = ["pretty-cli", "gix-features/zlib-rust-backend", "prodash-render-line", "is-terminal"]
6464

6565
## Like lean, but uses Rusts async implementations for networking.
6666
##
@@ -74,7 +74,7 @@ small = ["pretty-cli", "gix-features/rustsha1", "gix-features/zlib-rust-backend"
7474
lean-async = ["fast", "tracing", "pretty-cli", "gitoxide-core-tools", "gitoxide-core-tools-query", "gitoxide-core-tools-corpus", "gitoxide-core-async-client", "prodash-render-line"]
7575

7676
#! ### Package Maintainers
77-
#! `*-control` features leave it to you to configure C libraries, involving choices for `zlib`, ! hashing and transport implementation.
77+
#! `*-control` features leave it to you to configure C libraries, involving choices for `zlib` and transport implementation.
7878
#!
7979
#! Additional features *can* be provided with `--features` and are handled by the [`gix-features` crate](https://docs.rs/gix-features/latest).
8080
#! If nothing else is specified, the Rust implementation is used. ! Note that only one feature of each section can be enabled at a time.
@@ -84,28 +84,25 @@ lean-async = ["fast", "tracing", "pretty-cli", "gitoxide-core-tools", "gitoxide-
8484
#! - `gix-features/zlib-ng-compat`
8585
#! - `gix-features/zlib-stock`
8686
#! - `gix-features/zlib-rust-backend` (*default if no choice is made*)
87-
#! * **sha1**
88-
#! - `gix-features/fast-sha1`
89-
#! - `gix-features/rustsha1` (*default if no choice is made*)
9087
#! * **HTTP** - see the *Building Blocks for mutually exclusive networking* headline
9188
#!
9289
#! #### Examples
9390
#!
9491
#! * `cargo build --release --no-default-features --features max-control,gix-features/zlib-stock,gitoxide-core-blocking-client,http-client-curl`
9592
#! - Create a build just like `max`, but using the stock `zlib` library instead of `zlib-ng`
96-
#! * `cargo build --release --no-default-features --features max-control,http-client-reqwest,gitoxide-core-blocking-client,gix-features/fast-sha1`
97-
#! - Create a build just like `max-pure`, but with faster hashing due to `fast-sha1`.
93+
#! * `cargo build --release --no-default-features --features max-control,http-client-reqwest,gitoxide-core-blocking-client,gix-features/zlib-ng`
94+
#! - Create a build just like `max-pure`, but with faster compression due to `zlib-ng`.
9895

9996
#! ### Building Blocks
10097
#! Typical combinations of features of our dependencies, some of which are referred to in the `gitoxide` crate's code for conditional compilation.
10198

10299
## Makes the crate execute as fast as possible by supporting parallel computation of otherwise long-running functions
103-
## as well as fast, hardware accelerated hashing, along with a faster zlib backend.
100+
## as well as a faster zlib backend.
104101
## If disabled, the binary will be visibly smaller.
105102
fast = ["gix/max-performance", "gix/comfort"]
106103

107104
## Makes the crate execute as fast as possible by supporting parallel computation of otherwise long-running functions
108-
## as well as fast, hardware accelerated hashing, along with a faster zlib backend.
105+
## as well as a faster zlib backend.
109106
## If disabled, the binary will be visibly smaller.
110107
fast-safe = ["gix/max-performance-safe", "gix/comfort"]
111108

Diff for: crate-status.md

-2
Original file line numberDiff line numberDiff line change
@@ -894,8 +894,6 @@ See its [README.md](https://github.com/GitoxideLabs/gitoxide/blob/main/gix-lock/
894894
* `in_parallel`
895895
* `join`
896896
* _When off all functions execute serially_
897-
* **fast-sha1**
898-
* provides a faster SHA1 implementation using CPU intrinsics
899897
* [x] API documentation
900898

901899
### gix-tui

Diff for: gix-features/Cargo.toml

-4
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,6 @@ zlib-stock = ["zlib", "flate2?/zlib"]
7777
## may build in environments where other backends don't.
7878
zlib-rust-backend = ["zlib", "flate2?/rust_backend"]
7979

80-
# TODO: Remove these.
81-
fast-sha1 = []
82-
rustsha1 = []
83-
8480
#! ### Other
8581

8682
## Count cache hits and misses and print that debug information on drop.

Diff for: gix/Cargo.toml

+2-6
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ blocking-http-transport-reqwest-native-tls = [
217217
#! #### Performance
218218
#!
219219
#! The reason these features exist is to allow optimization for compile time and optimize for compatibility by default. This means that some performance options around
220-
#! SHA1 and ZIP might not compile on all platforms, so it depends on the end-user who compiles the application to chose these based on their needs.
220+
#! ZIP might not compile on all platforms, so it depends on the end-user who compiles the application to chose these based on their needs.
221221

222222
## Activate features that maximize performance, like using threads, but leave everything else that might affect compatibility out to allow users more fine-grained
223223
## control over performance features like which `zlib*` implementation to use.
@@ -249,11 +249,7 @@ pack-cache-lru-dynamic = ["gix-pack/pack-cache-lru-dynamic"]
249249

250250
## Activate other features that maximize performance, like usage of threads, `zlib-ng` and access to caching in object databases.
251251
## Note that some platforms might suffer from compile failures, which is when `max-performance-safe` should be used.
252-
max-performance = ["max-performance-safe", "zlib-ng", "fast-sha1"]
253-
254-
## If enabled, use assembly versions of sha1 on supported platforms.
255-
## This might cause compile failures as well which is why it can be turned off separately.
256-
fast-sha1 = ["gix-features/fast-sha1"]
252+
max-performance = ["max-performance-safe", "zlib-ng"]
257253

258254
## Use the C-based zlib-ng backend, which can compress and decompress significantly faster.
259255
## Note that this will cause duplicate symbol errors if the application also depends on `zlib` - use `zlib-ng-compat` in that case.

Diff for: justfile

-2
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,6 @@ check:
9999
cargo check -p gix-features --all-features
100100
cargo check -p gix-features --features parallel
101101
cargo check -p gix-features --features fs-read-dir
102-
cargo check -p gix-features --features rustsha1
103-
cargo check -p gix-features --features fast-sha1
104102
cargo check -p gix-features --features progress
105103
cargo check -p gix-features --features io-pipe
106104
cargo check -p gix-features --features crc32

0 commit comments

Comments
 (0)