| 1 |
lints.workspace = true |
| 2 |
|
| 3 |
[package] |
| 4 |
name = "gix-features" |
| 5 |
description = "A crate to integrate various capabilities using compile-time feature flags" |
| 6 |
repository = "https://github.com/GitoxideLabs/gitoxide" |
| 7 |
version = "0.48.0" |
| 8 |
authors = ["Sebastian Thiel <[email protected]>"] |
| 9 |
license = "MIT OR Apache-2.0" |
| 10 |
edition = "2021" |
| 11 |
rust-version = "1.82" |
| 12 |
include = ["/src/**/*", "/LICENSE-*"] |
| 13 |
|
| 14 |
[lib] |
| 15 |
doctest = false |
| 16 |
test = false |
| 17 |
|
| 18 |
[features] |
| 19 |
|
| 20 |
default = [] |
| 21 |
## Provide traits and utilities for providing progress information. These can then be rendered |
| 22 |
## using facilities of the `prodash` crate. |
| 23 |
progress = ["prodash"] |
| 24 |
## Provide human-readable numbers as well as easier to read byte units for progress bars. |
| 25 |
progress-unit-human-numbers = ["prodash?/unit-human"] |
| 26 |
## Provide human readable byte units for progress bars. |
| 27 |
progress-unit-bytes = ["dep:bytesize", "prodash?/unit-bytes"] |
| 28 |
|
| 29 |
## Provide utilities suitable for working with the `std::fs::read_dir()`. |
| 30 |
fs-read-dir = ["dep:gix-utils"] |
| 31 |
|
| 32 |
## Implement `tracing` with `tracing-core`, which provides applications with valuable performance details if they opt-in to it. |
| 33 |
## |
| 34 |
## Note that this may have overhead as well, thus instrumentations should be used stategically, only providing coarse tracing by default and adding details |
| 35 |
## only where needed while marking them with the appropriate level. |
| 36 |
tracing = ["gix-trace/tracing"] |
| 37 |
|
| 38 |
## If enabled, detailed tracing is also emitted, which can greatly increase insights but at a cost. |
| 39 |
tracing-detail = ["gix-trace/tracing-detail"] |
| 40 |
|
| 41 |
## Use scoped threads and channels to parallelize common workloads on multiple objects. If enabled, it is used everywhere |
| 42 |
## where it makes sense. |
| 43 |
## As caches are likely to be used and instantiated per thread, more memory will be used on top of the costs for threads. |
| 44 |
## The `threading` module will contain thread-safe primitives for shared ownership and mutation, otherwise these will be their single threaded counterparts. |
| 45 |
## This way, single-threaded applications don't have to pay for threaded primitives. |
| 46 |
parallel = ["dep:crossbeam-channel", "dep:parking_lot"] |
| 47 |
## If enabled, OnceCell will be made available for interior mutability either in sync or unsync forms. |
| 48 |
## Note: This still uses once_cell because std::sync::OnceLock::get_or_try_init() is not yet stable. |
| 49 |
once_cell = ["dep:once_cell"] |
| 50 |
## Makes facilities of the `walkdir` crate partially available. |
| 51 |
## In conjunction with the **parallel** feature, directory walking will be parallel instead behind a compatible interface. |
| 52 |
walkdir = ["dep:walkdir", "dep:gix-path", "dep:gix-utils"] |
| 53 |
#* an in-memory unidirectional pipe using `bytes` as efficient transfer mechanism. |
| 54 |
io-pipe = ["dep:bytes"] |
| 55 |
## provide a proven and fast `crc32` implementation. |
| 56 |
crc32 = ["dep:crc32fast"] |
| 57 |
|
| 58 |
## Enable the usage of zlib-related utilities to compress or decompress data. |
| 59 |
## This enables and uses the high-performance `zlib-rs` backend. |
| 60 |
zlib = ["dep:zlib-rs", "dep:thiserror"] |
| 61 |
|
| 62 |
#! ### Other |
| 63 |
|
| 64 |
## Count cache hits and misses and print that debug information on drop. |
| 65 |
## Caches implement this by default, which costs nothing unless this feature is enabled |
| 66 |
cache-efficiency-debug = [] |
| 67 |
|
| 68 |
[[test]] |
| 69 |
name = "parallel" |
| 70 |
path = "tests/parallel_threaded.rs" |
| 71 |
required-features = ["parallel"] |
| 72 |
|
| 73 |
[[test]] |
| 74 |
name = "multi-threaded" |
| 75 |
path = "tests/parallel_shared_threaded.rs" |
| 76 |
required-features = ["parallel"] |
| 77 |
|
| 78 |
[[test]] |
| 79 |
name = "single-threaded" |
| 80 |
path = "tests/parallel_shared.rs" |
| 81 |
|
| 82 |
[[test]] |
| 83 |
name = "pipe" |
| 84 |
path = "tests/pipe.rs" |
| 85 |
required-features = ["io-pipe"] |
| 86 |
|
| 87 |
[dependencies] |
| 88 |
gix-trace = { version = "^0.1.19", path = "../gix-trace" } |
| 89 |
|
| 90 |
# for walkdir |
| 91 |
gix-path = { version = "^0.12.0", path = "../gix-path", optional = true } |
| 92 |
gix-utils = { version = "^0.3.2", path = "../gix-utils", optional = true } |
| 93 |
|
| 94 |
# 'parallel' feature |
| 95 |
crossbeam-channel = { version = "0.5.15", optional = true } |
| 96 |
parking_lot = { version = "0.12.4", default-features = false, optional = true } |
| 97 |
|
| 98 |
walkdir = { version = "2.3.2", optional = true } # used when parallel is off |
| 99 |
|
| 100 |
# hashing |
| 101 |
crc32fast = { version = "1.5.0", optional = true } |
| 102 |
|
| 103 |
# progress |
| 104 |
prodash = { version = "31.0.0", optional = true } |
| 105 |
bytesize = { version = "2.3.1", optional = true } |
| 106 |
|
| 107 |
# pipe |
| 108 |
bytes = { version = "1.11.1", optional = true } |
| 109 |
|
| 110 |
# zlib module |
| 111 |
zlib-rs = { version = "0.6.2", optional = true } |
| 112 |
thiserror = { version = "2.0.18", optional = true } |
| 113 |
|
| 114 |
# Note: once_cell is kept for OnceCell type because std::sync::OnceLock::get_or_try_init() is not yet stable. |
| 115 |
# Once it's stabilized (tracking issue #109737), we can remove this dependency. |
| 116 |
once_cell = { version = "1.21.3", optional = true } |
| 117 |
|
| 118 |
document-features = { version = "0.2.0", optional = true } |
| 119 |
|
| 120 |
[target.'cfg(unix)'.dependencies] |
| 121 |
libc = { version = "0.2.182" } |
| 122 |
|
| 123 |
[dev-dependencies] |
| 124 |
bstr = { version = "1.12.0", default-features = false } |
| 125 |
|
| 126 |
[package.metadata.docs.rs] |
| 127 |
all-features = true |
| 128 |
features = ["document-features"] |