[package]
name = "stratisd"
version = "3.9.1"
authors.workspace = true
edition.workspace = true
rust-version.workspace = true
build = "build.rs"
description = "Stratis daemon"
license = "MPL-2.0"
repository = "https://github.com/stratis-storage/stratisd/"
keywords = ["Linux", "filesystem", "storage"]
categories = ["filesystem"]
exclude = [
    "/.clippy.toml",
    "/.fmf",
    "/.githooks",
    "/.github",
    "/.gitignore",
    "/.packit.yaml",
    "/.yamlint.yaml",
    "/_typos.toml",
    "/Makefile",
    "/README_tests.md",
    "/docs",
    "/dracut",
    "/plans",
    "/stratisd.conf",
    "/systemd",
    "/tests",
    "/tests-fmf",
    "/udev"
]

[workspace]
members = [".", "stratisd_proc_macros"]

[workspace.package]
authors = ["Stratis Developers <stratis-devel@lists.fedorahosted.org>"]
edition = "2021"
rust-version = "1.87.0"  # LOWEST SUPPORTED RUST TOOLCHAIN

[[bin]]
name = "stratisd"
required-features = ["engine"]

[[bin]]
name = "stratisd-tools"
required-features = ["engine", "extras"]

[[bin]]
name = "stratis-min"
path = "src/bin/stratis-min/stratis-min.rs"
required-features = ["engine", "min"]

[[bin]]
name = "stratisd-min"
path = "src/bin/stratis-min/stratisd-min.rs"
required-features = ["engine", "min"]

[[bin]]
name = "stratis-str-cmp"
path = "src/bin/udev-lib/stratis-str-cmp.rs"
required-features = ["udev_scripts"]

[[bin]]
name = "stratis-base32-decode"
path = "src/bin/udev-lib/stratis-base32-decode.rs"
required-features = ["udev_scripts"]

[[bin]]
name = "stratis-utils"
required-features = ["dbus_enabled", "engine"]

[dependencies.async-trait]
version = "0.1.80"
optional = true

[dependencies.byteorder]
version = "1.2.3"
optional = true

[dependencies.chrono]
version = "0.4.31"
optional = true
default-features = false
features = ["clock", "std"]

[dependencies.clap]
version = "4.5.0"
optional = true
features = ["derive"]

[dependencies.crc]
version = "3.0.0"
optional = true

[dependencies.data-encoding]
version = "2.3.0"
optional = true

[dependencies.devicemapper]
version = "0.34.4"
optional = true

[dependencies.either]
version = "1.6.1"
optional = true

[dependencies.env_logger]
version ="0.11.0"
optional = true

[dependencies.futures]
version = "0.3.31"
optional = true

[dependencies.indexmap]
version = "2.7.0"
optional = true

[dependencies.itertools]
version = "0.14.0"
optional = true

[dependencies.libblkid-rs]
version = "0.4.0"
optional = true

[dependencies.libc]
version = "0.2.180"
optional = true

[dependencies.libcryptsetup-rs]
version = "0.16.1"
features = ["mutex"]
optional = true

[dependencies.libcryptsetup-rs-sys]
version = "0.7.0"
optional = true

[dependencies.libudev]
version = "0.3.0"
optional = true

[dependencies.linux-raw-sys]
version = "0.12.0"
optional = true
features = ["general", "ioctl"]

[dependencies.log]
version = "0.4.20"
optional = true

[dependencies.nix]
version = "0.31.1"
optional = true
features = ["fs", "ioctl", "mount", "poll", "process", "sched", "signal", "socket"]

[dependencies.pretty-hex]
version = "0.4.1"
optional = true

[dependencies.procfs]
version = "0.18.0"
optional = true

[dependencies.rand]
version = "0.10.0"
optional = true

[dependencies.regex]
version = "1.5.5"
optional = true

[dependencies.retry]
version = "2.0.0"
default-features = false
optional = true

[dependencies.semver]
version = "1.0.0"
optional = true

[dependencies.serde]
version = "1.0.200"
optional = true

[dependencies.serde_derive]
version = "1.0.200"
optional = true

[dependencies.serde_json]
version = "1.0.50"
optional = true

[dependencies.sha2]
version = "0.11.0"
optional = true

[dependencies.stratisd_proc_macros]
version = "0.2.2"
optional = true
path = "./stratisd_proc_macros"

[dependencies.strum]
version = "0.28.0"
optional = true

[dependencies.strum_macros]
version = "0.28.0"
optional = true

[dependencies.tempfile]
version = "3.18.0"
optional = true

[dependencies.termios]
version = "0.3.3"
optional = true

[dependencies.tokio]
version = "1.45.1"
optional = true
features = ["sync", "macros", "rt", "rt-multi-thread", "signal", "net", "time"]

[dependencies.uuid]
version = "1.8.0"
optional = true
features = ["serde", "v4"]

[dependencies.zbus]
version = "5.12.0"
optional = true
features = ["tokio"]

[build-dependencies]
pkg-config = "0.3.31"

[build-dependencies.bindgen]
version = "0.72.0"
optional = true

[dev-dependencies]
assert_cmd = "2.0.8"
assert_matches = "1.5.0"
loopdev-3 = "0.5.1"
predicates = "3.0.0"
proptest = "1.0.0"

[features]
engine = [
    "dep:async-trait",
    "dep:byteorder",
    "dep:chrono",
    "dep:clap",
    "dep:crc",
    "dep:data-encoding",
    "dep:devicemapper",
    "dep:either",
    "dep:env_logger",
    "dep:futures",
    "dep:indexmap",
    "dep:itertools",
    "dep:libblkid-rs",
    "dep:libc",
    "dep:libcryptsetup-rs",
    "dep:libcryptsetup-rs-sys",
    "dep:libudev",
    "dep:linux-raw-sys",
    "dep:log",
    "dep:nix",
    "dep:procfs",
    "dep:rand",
    "dep:regex",
    "dep:retry",
    "dep:semver",
    "dep:serde",
    "dep:serde_derive",
    "dep:serde_json",
    "dep:sha2",
    "dep:stratisd_proc_macros",
    "dep:strum",
    "dep:strum_macros",
    "dep:tempfile",
    "dep:tokio",
    "dep:uuid"
]
default = ["dbus_enabled", "engine"]
dbus_enabled = ["dep:zbus"]
extras = ["dep:pretty-hex"]
min = ["dep:termios"]
systemd_compat = ["dep:bindgen"]
udev_scripts = ["dep:data-encoding"]

[lints.rust]
warnings = { level = "deny" }
future_incompatible = { level = "deny", priority = 1 }
unused = { level = "deny", priority = 2}
rust_2018_idioms = { level = "deny", priority = 3 }
nonstandard_style = { level = "deny", priority = 4 }

[lints.clippy]
all = { level = "deny" }
cargo = { level = "deny", priority = 1 }
multiple-crate-versions = { level = "allow", priority = 2 }
from_over_into = { level = "allow", priority = 3 }
upper_case_acronyms = { level = "allow", priority = 3 }
# SOME PEDANTIC OR NURSERY LINTS THAT STRATISD CURRENTLY OBEYS.
# IF ANY OF THESE LINTS ARE DISCOVERED TO BE UNNECESSARILY RESTRICTIVE,
# CHOOSING TO ALLOW THE LINT BY REMOVING THE DENY ENTRY SHOULD BE A MINOR
# DECISION AND EASILY MADE.
cast_lossless = { level = "deny", priority = 4 }
cast_possible_truncation = { level = "deny", priority = 4 }
cast_precision_loss = { level = "deny", priority = 4 }
cast_ptr_alignment = { level = "deny", priority = 4 }
checked_conversions = { level = "deny", priority = 4 }
copy_iterator = { level = "deny", priority = 4 }
enum_glob_use = { level = "deny", priority = 4 }
expl_impl_clone_on_copy = { level = "deny", priority = 4 }
explicit_deref_methods = { level = "deny", priority = 4 }
explicit_into_iter_loop = { level = "deny", priority = 4 }
fn_params_excessive_bools = { level = "deny", priority = 4 }
implicit_hasher = { level = "deny", priority = 4 }
inefficient_to_string = { level = "deny", priority = 4 }
inline_always = { level = "deny", priority = 4 }
invalid_upcast_comparisons = { level = "deny", priority = 4 }
large_digit_groups = { level = "deny", priority = 4 }
large_stack_arrays = { level = "deny", priority = 4 }
large_types_passed_by_value = { level = "deny", priority = 4 }
linkedlist = { level = "deny", priority = 4 }
macro_use_imports = { level = "deny", priority = 4 }
manual_ok_or = { level = "deny", priority = 4 }
match_bool = { level = "deny", priority = 4 }
match_wild_err_arm = { level = "deny", priority = 4 }
maybe_infinite_iter = { level = "deny", priority = 4 }
mut_mut = { level = "deny", priority = 4 }
needless_continue = { level = "deny", priority = 4 }
option_option = { level = "deny", priority = 4 }
range_minus_one = { level = "deny", priority = 4 }
range_plus_one = { level = "deny", priority = 4 }
ref_option_ref = { level = "deny", priority = 4 }
same_functions_in_if_condition = { level = "deny", priority = 4 }
string_add_assign = { level = "deny", priority = 4 }
struct_excessive_bools = { level = "deny", priority = 4 }
trait_duplication_in_bounds = { level = "deny", priority = 4 }
trivially_copy_pass_by_ref = { level = "deny", priority = 4 }
type_repetition_in_bounds = { level = "deny", priority = 4 }
unicode_not_nfc = { level = "deny", priority = 4 }
unnested_or_patterns = { level = "deny", priority = 4 }
unreadable_literal = { level = "deny", priority = 4 }
unsafe_derive_deserialize = { level = "deny", priority = 4 }
unused_self = { level = "deny", priority = 4 }
used_underscore_binding = { level = "deny", priority = 4 }
verbose_bit_mask = { level = "deny", priority = 4 }
wildcard_imports = { level = "deny", priority = 4 }

[package.metadata.vendor-filter]
platforms = ["*-unknown-linux-gnu"]
tier = "2"
all-features = true
exclude-crate-paths = [ { name = "libdbus-sys", exclude = "vendor" } ]
