[package] name = "bitbazaar" description = "An assortment of publicly available cross-language utilities useful to my projects." version = "0.8.0" edition = "2021" readme = "README.md" license = "MIT" [lib] name = "bitbazaar" crate-type = ["lib", "cdylib"] # cdylib allows things like wasm to compile path = "bitbazaar/lib.rs" # [patch.crates-io] # redis = { path = "../../redis-rs/redis" } [build-dependencies] rustc_version = "0.4.1" [package.metadata.docs.rs] # For the features to show in docs.rs, need to tell it to include them: all-features = true # Add your dependencies here [dependencies] parking_lot = { version = "0.12", features = ["serde"] } tracing = "0.1" error-stack = { version = "0.5", features = ["anyhow", "serde"] } colored = '2' tracing-subscriber = { version = "0.3", features = ["fmt", "std", "time"] } serde = { version = "1", features = ["derive", "rc"] } serde_json = { version = "1" } time = { version = "0.3", features = ["local-offset"] } futures = { version = "0.3", features = [] } itertools = "0.12" tracing-core = "0.1" chrono = { version = '0.4', features = ["serde"] } chrono-humanize = { version = "0.2" } arc-swap = "1" paste = "1" dashmap = "6" cfg-if = "1" send_wrapper = "0.6" # Not in default, but likely used in multiple features: reqwest = { version = "0.12", optional = true } strum = { version = "0.25", features = ["derive"], optional = true } rand = { version = "0.8", optional = true } uuid = { version = "1.11", features = ["v4"], optional = true } axum-extra = { version = "0.9", features = [], optional = true } leptos = { version = "0.7.0-rc1", optional = true } leptos_axum = { version = "0.7.0-rc1", optional = true } http = { version = "1", optional = true } portpicker = { version = '0.1', optional = true } argon2 = { version = "0.5", optional = true } tempfile = { version = '3', optional = true } pin-project-lite = "0.2" # FEAT: collector: # FEAT: tarball: flate2 = { version = "1", optional = true } tar = { version = "0.4", optional = true } # FEAT: aes256: aes-gcm-siv = { version = "0.11", optional = true } bincode = { version = "1", optional = true } # FEAT: md5: md-5 = { version = "0.10", optional = true } # FEAT: sha: sha2 = { version = "0.10", optional = true } # FEAT: password: # FEAT: log-filter: regex = { version = '1', optional = true } # FEAT: timing: comfy-table = { version = "7.1", optional = true } # FEAT: test rstest = { version = "0.23", optional = true } # FEAT: cli: normpath = { version = "1.3", optional = true } conch-parser = { version = "0.1.1", optional = true } homedir = { version = "0.2", optional = true } # FEAT: redis: deadpool-redis = { version = "0.18", features = ["rt_tokio_1"], optional = true } redis = { version = "0.27", default-features = false, features = [ "tokio-comp", "json", ], optional = true } sha1_smol = { version = "1.0", optional = true } # FEAT: opentelemetry-(grpc|http): tracing-log = { version = "0.2", optional = true } # Only needed whilst we're using ot_tracing_bridge.rs tracing-opentelemetry = { version = "0.22", optional = true } opentelemetry-appender-tracing = { version = "0.2.0", optional = true } opentelemetry_sdk = { version = "0.21", features = ["rt-tokio"], optional = true } opentelemetry = { version = "0.21", default-features = false, features = [ "trace", ], optional = true } opentelemetry-otlp = { version = "0.14", default-features = false, features = [ "logs", "trace", "metrics", ], optional = true } opentelemetry-semantic-conventions = { version = "0.13.0", optional = true } # FEAT: system: sysinfo = { version = "0.30", optional = true } # FEAT: rayon: rayon = { version = "1", optional = true } # FEAT: cookies: wasm-cookies = { version = "0.2", optional = true } # These features are included in all builds, need tokio sync feature for mutex and semaphore, which is fine on wasm. # rt needed for local keys # Wasm supported features: https://docs.rs/tokio/latest/tokio/#wasm-support [dependencies.tokio] version = "1" features = ["sync", "rt"] # These are included on top of above features when not wasm: [target.'cfg(not(target_arch = "wasm32"))'.dependencies.tokio] version = "1" features = ["time", "fs", "process", "rt", "io-util", "macros"] [target.'cfg(target_arch = "wasm32")'.dependencies] tracing-subscriber-wasm = "0.1.0" gloo-timers = { version = "0.3", features = ["futures"] } wasm-bindgen-futures = "0.4" web-time = "1" web-sys = { version = "0.3" } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] # This includes threading (non-blocking stuff that can't be used in wasm) tracing-appender = '0.2' hostname = "0.3.1" named-lock = "0.4" percent-encoding = { version = "2" } [dev-dependencies] criterion = { version = "0.3", features = ["html_reports", "async_tokio"] } tokio = { version = '1', features = ["full"] } # When adding new benches, they should be added like this with the name of the file in benches/: [[bench]] name = "bench_default" harness = false [features] collector = ["dep:reqwest", "dep:tempfile", "tarball"] tarball = ["dep:flate2", "dep:tar"] log-filter = ["dep:regex"] aes256 = ['dep:aes-gcm-siv', 'dep:argon2', 'dep:bincode'] md5 = ['dep:md-5'] sha = ['dep:sha2'] password = ['dep:argon2', 'rand/getrandom'] timing = ['dep:comfy-table'] test = ['dep:rstest'] cli = ['dep:normpath', 'dep:conch-parser', 'dep:homedir', 'dep:strum'] system = ['dep:sysinfo'] redis = [ 'dep:deadpool-redis', 'dep:redis', 'dep:sha1_smol', 'dep:rand', 'dep:uuid', 'dep:portpicker', ] opentelemetry-grpc = [ 'dep:tracing-log', 'dep:opentelemetry-appender-tracing', 'dep:opentelemetry_sdk', 'dep:tracing-opentelemetry', 'dep:opentelemetry', 'dep:opentelemetry-otlp', 'dep:opentelemetry-semantic-conventions', 'dep:http', 'opentelemetry-otlp/grpc-tonic', ] opentelemetry-http = [ # In general there's no point with this currently, made for wasm but otlp can't be used on wasm yet (tonic) 'dep:tracing-log', 'dep:opentelemetry-appender-tracing', 'dep:opentelemetry_sdk', 'dep:tracing-opentelemetry', 'dep:opentelemetry', 'dep:opentelemetry-otlp', 'dep:opentelemetry-semantic-conventions', 'dep:http', 'opentelemetry-otlp/grpc-tonic', # Stupid needed but it currently is due to otlp internals 'opentelemetry-otlp/http-proto', 'opentelemetry-otlp/reqwest-client', 'opentelemetry-otlp/reqwest-rustls', # Ssl certs needed for https to work. ] rayon = ['dep:rayon'] # Cookie deps depending on wasm or not: cookies_ssr = ['dep:http', 'dep:axum-extra', 'axum-extra/cookie', 'dep:leptos', 'dep:leptos_axum'] cookies_wasm = ['dep:http', 'dep:wasm-cookies'] [profile.release] strip = "debuginfo" # Note: true or "symbols" seems to break static c linking e.g. with ffmpeg. [profile.profiler] inherits = "release" # Adds on top of the default release profile incremental = true debug = true strip = false