[package] name = "git-features" description = "A crate to integrate various capabilities using compile-time feature flags" repository = "https://github.com/Byron/gitoxide" version = "0.20.0" authors = ["Sebastian Thiel "] 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"] ## 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** version, but might be relevant if you prefer a pure-rust build ## and reduced performance is acceptable. 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 a C-based backend which can compress and decompress significantly faster. zlib-ng-compat = ["flate2/zlib-ng-compat"] ## 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 = ["sha-1"] ## 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"] [[test]] name = "path" path = "tests/path.rs" required-features = ["bstr"] [dependencies] #! ### Optional Dependencies git-hash = { version = "^0.9.3", path = "../git-hash" } # 'parallel' feature crossbeam-utils = { version = "0.8.5", 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.1", 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 } sha-1 = { version = "0.10.0", optional = true } # progress prodash = { version = "19.0.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 } ## make the `time` module available with access to the local time as configured by the system. time = { version = "0.3.2", optional = true, default-features = false, features = ["local-offset"] } # path ## make bstr utilities available in the `path` modules, which itself is gated by the `path` feature. bstr = { version = "0.2.17", optional = true, default-features = false, features = ["std"] } 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 } [package.metadata.docs.rs] features = ["document-features"] all-features = true # Assembly doesn't yet compile on MSVC on windows, but does on GNU, see https://github.com/RustCrypto/asm-hashes/issues/17 [target.'cfg(not(all(target_os = "windows", target_env = "msvc")))'.dependencies] sha-1 = { version = "0.10.0", optional = true, features = ["asm"] }