Skip to content

Commit e71c703

Browse files
cruesslerByron
authored andcommitted
Adapt to sha1 not being default feature of gix-hash
1 parent 1019b42 commit e71c703

30 files changed

Lines changed: 137 additions & 52 deletions

File tree

.github/workflows/ci.yml

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -558,22 +558,15 @@ jobs:
558558
gix-bitmap
559559
gix-chunk
560560
gix-command
561-
gix-commitgraph
562561
gix-config-value
563562
gix-date
564563
gix-glob
565-
gix-hash
566-
gix-hashtable
567564
gix-mailmap
568-
gix-object
569565
gix-packetline
570566
gix-path
571567
gix-pathspec
572568
gix-prompt
573569
gix-quote
574-
gix-refspec
575-
gix-revision
576-
gix-traverse
577570
gix-url
578571
gix-validate
579572
)
@@ -587,11 +580,26 @@ jobs:
587580
for feature in progress parallel io-pipe crc32 zlib cache-efficiency-debug; do
588581
cargo build -p gix-features --features "$feature" --target "$TARGET"
589582
done
590-
- name: crates with 'wasm' feature
583+
- name: crates with 'sha1' and 'wasm' feature
591584
run: |
592585
set -x
593586
for crate in gix-pack; do
594-
cargo build -p "$crate" --features wasm --target "$TARGET"
587+
cargo build -p "$crate" --features sha1,wasm --target "$TARGET"
588+
done
589+
- name: crates with 'sha1' feature
590+
run: |
591+
crates=(
592+
gix-commitgraph
593+
gix-hash
594+
gix-hashtable
595+
gix-object
596+
gix-refspec
597+
gix-revision
598+
gix-traverse
599+
)
600+
set -x
601+
for crate in "${crates[@]}"; do
602+
cargo build -p "$crate" --features sha1 --target "$TARGET"
595603
done
596604
- name: gix-pack with all features (including wasm)
597605
run: cargo build -p gix-pack --all-features --target "$TARGET"

gix-commitgraph/Cargo.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ rust-version = "1.82"
1616
doctest = false
1717

1818
[features]
19+
## Support for SHA1 hashes and digests.
20+
sha1 = ["gix-hash/sha1"]
1921
## Data structures implement `serde::Serialize` and `serde::Deserialize`
2022
serde = ["dep:serde", "gix-hash/serde", "bstr/serde"]
2123

@@ -34,11 +36,11 @@ document-features = { version = "0.2.0", optional = true }
3436
[dev-dependencies]
3537
gix-testtools = { path = "../tests/tools" }
3638
gix-date = { path = "../gix-date" }
37-
gix-hash = { path = "../gix-hash", features = ["sha256"] }
39+
gix-hash = { path = "../gix-hash", features = ["sha1", "sha256"] }
3840

3941
[package.metadata.docs.rs]
4042
all-features = true
41-
features = ["document-features"]
43+
features = ["sha1", "document-features"]
4244

4345
[package.metadata.cargo-machete]
4446
ignored = [

gix-commitgraph/fuzz/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ memmap2 = "0.9.0"
2121

2222
[dependencies.gix-commitgraph]
2323
path = ".."
24+
features = ["sha1"]
2425

2526
# Prevent this from interfering with workspaces
2627
[workspace]

gix-config/Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ rust-version = "1.82"
1515
autotests = false
1616

1717
[features]
18+
## Support for SHA1 hashes and digests.
19+
sha1 = ["gix-ref/sha1"]
1820
## Data structures implement `serde::Serialize` and `serde::Deserialize`.
1921
serde = ["dep:serde", "bstr/serde", "gix-sec/serde", "gix-ref/serde", "gix-glob/serde", "gix-config-value/serde"]
2022

@@ -46,7 +48,7 @@ path = "./benches/large_config_file.rs"
4648

4749
[package.metadata.docs.rs]
4850
all-features = true
49-
features = ["document-features"]
51+
features = ["sha1", "document-features"]
5052

5153
[package.metadata.cargo-machete]
5254
ignored = [

gix-config/fuzz/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ anyhow = "1.0.76"
1616

1717
[dependencies.gix-config]
1818
path = ".."
19+
features = ["sha1"]
1920

2021
# Prevent this from interfering with workspaces
2122
[workspace]

gix-diff/Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ autotests = false
1414

1515
[features]
1616
default = ["blob", "index"]
17+
## Support for SHA1 hashes and digests.
18+
sha1 = ["gix-hash/sha1"]
1719
## Enable diffing of blobs using imara-diff.
1820
blob = [
1921
"dep:imara-diff",
@@ -74,7 +76,7 @@ imara-diff-v2 = { version = "0.2.0", package = "imara-diff" }
7476

7577
[package.metadata.docs.rs]
7678
all-features = true
77-
features = ["document-features"]
79+
features = ["sha1", "document-features"]
7880

7981
[package.metadata.cargo-machete]
8082
ignored = [

gix-hash/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ gix-testtools = { path = "../tests/tools" }
4040

4141
[package.metadata.docs.rs]
4242
all-features = true
43-
features = ["document-features"]
43+
features = ["sha1", "document-features"]

gix-hashtable/Cargo.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,14 @@ rust-version = "1.82"
1414
[lib]
1515
doctest = false
1616

17+
[features]
18+
## Support for SHA1 hashes and digests.
19+
sha1 = ["gix-hash/sha1"]
20+
1721
[dependencies]
1822
parking_lot = "0.12.4"
1923
hashbrown = { version = "0.16.0", default-features = false, features = ["inline-more"] }
2024
gix-hash = { version = "^0.22.0", path = "../gix-hash" }
25+
26+
[package.metadata.docs.rs]
27+
features = ["sha1"]

gix-index/Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ doctest = false
1818
test = true
1919

2020
[features]
21+
## Support for SHA1 hashes and digests.
22+
sha1 = ["gix-hash/sha1"]
2123
## Data structures implement `serde::Serialize` and `serde::Deserialize`.
2224
serde = ["dep:serde", "smallvec/serde", "gix-hash/serde"]
2325

@@ -61,4 +63,4 @@ libc = { version = "0.2.180" }
6163
gix-testtools = { path = "../tests/tools" }
6264

6365
[package.metadata.docs.rs]
64-
features = ["document-features", "serde"]
66+
features = ["sha1", "document-features", "serde"]

gix-merge/Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ workspace = true
1515
doctest = false
1616

1717
[features]
18+
## Support for SHA1 hashes and digests.
19+
sha1 = ["gix-hash/sha1"]
1820
## Data structures implement `serde::Serialize` and `serde::Deserialize`.
1921
serde = ["dep:serde", "gix-hash/serde", "gix-object/serde"]
2022

@@ -51,7 +53,7 @@ pretty_assertions = "1.4.0"
5153

5254
[package.metadata.docs.rs]
5355
all-features = true
54-
features = ["document-features"]
56+
features = ["sha1", "document-features"]
5557

5658
[package.metadata.cargo-machete]
5759
ignored = [

0 commit comments

Comments
 (0)