/
Cargo.toml
149 lines (117 loc) · 6.34 KB
/
Cargo.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
[package]
name = "git-features"
description = "A crate to integrate various capabilities using compile-time feature flags"
repository = "https://github.com/Byron/gitoxide"
version = "0.22.4"
authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
license = "MIT/Apache-2.0"
edition = "2018"
[lib]
doctest = false
test = false
[features]
default = []
## Provide traits and utilities for providing progress information. These can then be rendered
## using facilities of the `prodash` crate.
progress = ["prodash"]
## If set, and with the `parallel` feature set, walkdir iterators will be single-threaded.
## This feature exists to avoid [certain side-effects](https://github.com/starship/starship/issues/4251) of rayon threadpool configuration with `jwalk`.
fs-walkdir-single-threaded = []
## Use scoped threads and channels to parallelize common workloads on multiple objects. If enabled, it is used everywhere
## where it makes sense.
## As caches are likely to be used and instantiated per thread, more memory will be used on top of the costs for threads.
## The `threading` module will contain thread-safe primitives for shared ownership and mutation, otherwise these will be their single threaded counterparts.
## This way, single-threaded applications don't have to pay for threaded primitives.
parallel = ["crossbeam-utils", "crossbeam-channel", "num_cpus", "jwalk", "parking_lot"]
#* an in-memory unidirectional pipe using `bytes` as efficient transfer mechanism.
io-pipe = ["bytes"]
## provide a proven and fast `crc32` implementation.
crc32 = ["crc32fast"]
#! ### Mutually Exclusive ZLIB
## Enable the usage of zlib related utilities to compress or decompress data.
## By default it uses a pure rust implementation which is slower than the **zlib-ng-compat** or **zlib-stock** versions, but might be relevant if you prefer a pure-rust build
## and reduced performance is acceptable. **zlib-stock** can be used if dynamic linking of an external zlib library is desired or if cmake is not available.
## Note that a competitive Zlib implementation is critical to `gitoxide's` object database performance.
## Additional backends are supported, each of which overriding the default Rust backend.
zlib = ["flate2", "flate2/rust_backend", "quick-error"]
## Use zlib-ng (libz-ng-sys) with native API (no compat mode) that can co-exist with system libz.
zlib-ng= ["flate2/zlib-ng"]
## Use a C-based backend which can compress and decompress significantly faster than the other options.
zlib-ng-compat = ["flate2/zlib-ng-compat"]
## Use a slower C-based backend which can compress and decompress significantly faster than the rust version.
## Unlike `zlib-ng-compat`, this allows using dynamic linking with system `zlib` libraries and doesn't require cmake.
zlib-stock = ["flate2/zlib"]
## available for completeness even though it's the default - it may be chosen for more specific feature flag names, instead of a bare `zlib`.
zlib-rust-backend = ["flate2/rust_backend"]
#! ### Mutually Exclusive SHA1
## A fast SHA1 implementation is critical to `gitoxide's` object database performance
## A multi-crate implementation that can use hardware acceleration, thus bearing the potential for up to 2Gb/s throughput on
## CPUs that support it, like AMD Ryzen or Intel Core i3, as well as Apple Silicon like M1.
## Takes precedence over `rustsha1` if both are specified.
fast-sha1 = ["sha1"]
## A standard and well performing pure Rust implementation of Sha1. Will significantly slow down various git operations.
rustsha1 = ["sha1_smol"]
#! ### Other
## Count cache hits and misses and print that debug information on drop.
## Caches implement this by default, which costs nothing unless this feature is enabled
cache-efficiency-debug = []
[[test]]
name = "hash"
path = "tests/hash.rs"
required-features = ["sha1_smol"]
[[test]]
name = "parallel"
path = "tests/parallel_threaded.rs"
required-features = ["parallel", "sha1_smol"]
[[test]]
name = "multi-threaded"
path = "tests/parallel_shared_threaded.rs"
required-features = ["parallel", "sha1_smol"]
[[test]]
name = "single-threaded"
path = "tests/parallel_shared.rs"
required-features = ["sha1_smol"]
[[test]]
name = "pipe"
path = "tests/pipe.rs"
required-features = ["io-pipe"]
[dependencies]
#! ### Optional Dependencies
git-hash = { version = "^0.9.9", path = "../git-hash" }
# 'parallel' feature
crossbeam-utils = { version = "0.8.7", optional = true }
crossbeam-channel = { version = "0.5.0", optional = true }
num_cpus = { version = "1.13.0", optional = true }
parking_lot = { version = "0.12.0", default-features = false, optional = true }
jwalk = { version = "0.6.0", optional = true }
## Makes facilities of the `walkdir` crate partially available.
## In conjunction with the **parallel** feature, directory walking will be parallel instead behind a compatible interface.
walkdir = { version = "2.3.2", optional = true } # used when parallel is off
# hashing and 'fast-sha1' feature
sha1_smol = { version = "1.0.0", optional = true }
crc32fast = { version = "1.2.1", optional = true }
sha1 = { version = "0.10.0", optional = true }
# progress
prodash = { version = "20.2.0", optional = true, default-features = false, features = ["unit-bytes", "unit-human"] }
# pipe
bytes = { version = "1.0.0", optional = true }
# zlib module
flate2 = { version = "1.0.17", optional = true, default-features = false }
quick-error = { version = "2.0.0", optional = true }
## If enabled, OnceCell will be made available for interior mutability either in sync or unsync forms.
once_cell = { version = "1.13.0", optional = true }
document-features = { version = "0.2.0", optional = true }
[target.'cfg(unix)'.dependencies]
## for fs::open_options_no_follow()
# TODO: ideally we conditionally import it only if a plumbing crate wants to use the underlying feature. Wanted to avoid to add to feature-toggle complexity.
libc = { version = "0.2.119" }
[dev-dependencies]
bstr = { version = "0.2.15", default-features = false }
# Assembly doesn't yet compile on MSVC on windows, but does on GNU, see https://github.com/RustCrypto/asm-hashes/issues/17
# At this time, only aarch64, x86 and x86_64 are supported.
[target.'cfg(all(any(target_arch = "aarch64", target_arch = "x86", target_arch = "x86_64"), not(target_env = "msvc")))'.dependencies]
sha1 = { version = "0.10.0", optional = true, features = ["asm"] }
[package.metadata.docs.rs]
all-features = true
features = ["document-features"]
rustdoc-args = ["--cfg", "docsrs"]