# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies.
#
# If you are reading this file be aware that the original Cargo.toml
# will likely look very different (and much more reasonable).
# See Cargo.toml.orig for the original contents.

[package]
edition = "2024"
name = "foundations"
version = "5.6.4"
authors = ["Cloudflare"]
build = "build.rs"
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "A Rust service foundations library."
documentation = "https://docs.rs/foundations"
readme = "README.md"
keywords = [
    "service",
    "telemetry",
    "settings",
    "seccomp",
    "metrics",
]
categories = [
    "config",
    "development-tools",
    "external-ffi-bindings",
    "memory-management",
]
license = "BSD-3-Clause"
repository = "https://github.com/cloudflare/foundations"

[package.metadata.release]
pre-release-hook = [
    "git-cliff",
    "-w",
    "..",
    "-o",
    "../RELEASE_NOTES.md",
    "--tag",
    "{{version}}",
]

[package.metadata.docs.rs]
all-features = true
rustdoc-args = [
    "--cfg",
    "foundations_docsrs",
    "--cfg",
    "tokio_unstable",
    "--cfg",
    "foundations_unstable",
    "--cfg",
    "foundations_generic_telemetry_wrapper",
]
rustc-args = [
    "--cfg",
    "tokio_unstable",
    "--cfg",
    "foundations_unstable",
    "--cfg",
    "foundations_generic_telemetry_wrapper",
]

[features]
cli = [
    "settings",
    "dep:clap",
]
client-telemetry = [
    "logging",
    "metrics",
    "tracing",
    "ratelimit",
]
default = [
    "platform-common-default",
    "security",
]
jemalloc = ["dep:tikv-jemallocator"]
logging = [
    "ratelimit",
    "dep:parking_lot",
    "dep:slog-async",
    "dep:slog-json",
    "dep:slog-term",
    "dep:slog",
    "dep:thread_local",
    "dep:futures-util",
    "dep:serde",
    "dep:crossbeam-utils",
]
memory-profiling = [
    "dep:backtrace",
    "dep:once_cell",
    "dep:tikv-jemalloc-ctl",
    "dep:tempfile",
    "dep:tokio",
    "dep:serde",
    "jemalloc",
]
metrics = [
    "dep:foundations-macros",
    "dep:erased-serde",
    "dep:parking_lot",
    "dep:prometheus-client",
    "dep:prometheus",
    "dep:prometools",
    "dep:serde_with",
    "dep:serde",
    "dep:serde_json",
    "dep:futures-util",
]
panic_on_frozen_logger = []
panic_on_too_much_logger_nesting = []
platform-common-default = [
    "settings",
    "jemalloc",
    "telemetry",
    "cli",
    "testing",
    "settings_deny_unknown_fields_by_default",
    "panic_on_frozen_logger",
    "panic_on_too_much_logger_nesting",
    "sentry",
]
ratelimit = [
    "dep:governor",
    "dep:crossbeam-utils",
]
security = [
    "dep:bindgen",
    "dep:cc",
    "dep:once_cell",
]
sentry = [
    "dep:sentry-core",
    "dep:serde",
    "dep:governor",
    "ratelimit",
    "metrics",
]
serde-saphyr = ["dep:serde-saphyr"]
server-client-common-default = [
    "settings",
    "client-telemetry",
    "testing",
]
settings = [
    "dep:foundations-macros",
    "dep:serde_path_to_error",
    "dep:serde_yaml",
    "dep:yaml-merge-keys",
    "dep:serde",
    "dep:indexmap",
    "dep:zeroize",
]
settings_deny_unknown_fields_by_default = ["foundations-macros?/settings_deny_unknown_fields_by_default"]
telemetry = [
    "logging",
    "memory-profiling",
    "metrics",
    "tracing",
    "telemetry-server",
    "client-telemetry",
    "telemetry-otlp-grpc",
]
telemetry-otlp-grpc = [
    "dep:tonic",
    "dep:tonic-prost",
    "dep:tokio",
    "tokio/net",
    "dep:hyper",
]
telemetry-server = [
    "logging",
    "dep:http-body-util",
    "dep:hyper",
    "dep:hyper-util",
    "dep:socket2",
    "dep:percent-encoding",
    "dep:serde",
    "dep:tokio",
    "tokio/net",
    "dep:futures-util",
]
testing = ["dep:foundations-macros"]
tokio-runtime-metrics = [
    "tokio/rt",
    "metrics",
    "serde/rc",
    "dep:slab",
]
tracing = [
    "ratelimit",
    "dep:foundations-macros",
    "dep:parking_lot",
    "dep:rand",
    "dep:cf-rustracing-jaeger",
    "dep:cf-rustracing",
    "dep:opentelemetry-proto",
    "dep:thread_local",
    "dep:futures-util",
    "dep:tokio",
    "dep:serde",
    "dep:slab",
    "dep:libc",
    "dep:http",
    "dep:crossbeam-utils",
]
tracing-rs-compat = ["dep:tracing-slog"]

[lib]
name = "foundations"
path = "src/lib.rs"

[[test]]
name = "logging"
path = "tests/logging.rs"

[[test]]
name = "metrics"
path = "tests/metrics.rs"

[[test]]
name = "metrics_unix_socket"
path = "tests/metrics_unix_socket.rs"

[[test]]
name = "panic_hook"
path = "tests/panic_hook.rs"

[[test]]
name = "sentry_hook"
path = "tests/sentry_hook.rs"

[[test]]
name = "settings"
path = "tests/settings.rs"

[[test]]
name = "telemetry_server"
path = "tests/telemetry_server.rs"

[[test]]
name = "tracing"
path = "tests/tracing.rs"

[[test]]
name = "with_test_telemetry"
path = "tests/with_test_telemetry.rs"

[dependencies.ahash]
version = "0.8.7"
optional = true

[dependencies.annotate-snippets]
version = "0.12.13"
optional = true

[dependencies.anyhow]
version = "1.0.75"
features = [
    "backtrace",
    "std",
]

[dependencies.async-stream]
version = "0.3"
optional = true

[dependencies.backtrace]
version = "0.3"
optional = true

[dependencies.cf-rustracing]
version = "1.3"
optional = true

[dependencies.cf-rustracing-jaeger]
version = "1.3"
optional = true

[dependencies.clap]
version = "4.4"
optional = true

[dependencies.crossbeam-utils]
version = "0.8"
optional = true
default-features = false

[dependencies.encoding_rs_io]
version = "0.1.2"
optional = true

[dependencies.erased-serde]
version = "0.4"
optional = true

[dependencies.foundations-macros]
version = "=5.6.4"
optional = true
default-features = false

[dependencies.futures-util]
version = "0.3"
optional = true

[dependencies.governor]
version = "0.10"
optional = true

[dependencies.http]
version = "1.1.0"
optional = true

[dependencies.http-body-util]
version = "0.1"
optional = true

[dependencies.hyper]
version = "1"
features = [
    "http1",
    "server",
]
optional = true
default-features = false

[dependencies.hyper-util]
version = "0.1"
features = ["tokio"]
optional = true
default-features = false

[dependencies.indexmap]
version = "2.0"
features = ["serde"]
optional = true

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

[dependencies.local-ip-address]
version = "0.6.5"
optional = true

[dependencies.lock_api]
version = "0.4.7"
optional = true

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

[dependencies.once_cell]
version = "1.5"
optional = true

[dependencies.opentelemetry-proto]
version = "0.31"
features = [
    "gen-tonic-messages",
    "trace",
]
optional = true

[dependencies.parking_lot]
version = "0.12"
optional = true

[dependencies.parking_lot_core]
version = "0.9.2"
optional = true

[dependencies.percent-encoding]
version = "2.3"
optional = true

[dependencies.pin-project-lite]
version = "0.2.16"

[dependencies.prometheus]
version = "0.14"
features = ["process"]
optional = true
default-features = false

[dependencies.prometheus-client]
version = "0.18"
optional = true

[dependencies.prometools]
version = "0.2.3"
features = ["serde"]
optional = true

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

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

[dependencies.sentry-core]
version = "0.36"
optional = true
default-features = false

[dependencies.serde]
version = "1.0.198"
features = [
    "derive",
    "rc",
]
optional = true

[dependencies.serde-saphyr]
version = "0.0.22"
optional = true
default-features = false

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

[dependencies.serde_path_to_error]
version = "0.1.17"
optional = true

[dependencies.serde_with]
version = "3.3"
optional = true

[dependencies.serde_yaml]
version = "0.8.26"
optional = true

[dependencies.slab]
version = "0.4.7"
optional = true

[dependencies.slog]
version = "2.8"
features = ["max_level_trace"]
optional = true

[dependencies.slog-async]
version = "2.3"
optional = true

[dependencies.slog-json]
version = "2.3"
optional = true

[dependencies.slog-term]
version = "2.4"
optional = true

[dependencies.socket2]
version = "0.6"
features = ["all"]
optional = true

[dependencies.thiserror]
version = "2.0.12"
optional = true

[dependencies.thread_local]
version = "1.1"
optional = true

[dependencies.tikv-jemallocator]
version = "0.6"
features = [
    "profiling",
    "stats",
    "background_threads",
]
optional = true

[dependencies.tokio]
version = "1.41.0"
features = [
    "sync",
    "rt",
    "macros",
]
optional = true

[dependencies.tonic]
version = "0.14"
features = ["channel"]
optional = true
default-features = false

[dependencies.tonic-prost]
version = "0.14"
optional = true

[dependencies.tower]
version = "0.5.2"
optional = true

[dependencies.tracing-slog]
version = "0.3.0"
optional = true

[dependencies.yaml-merge-keys]
version = "0.5"
features = ["serde_yaml"]
optional = true

[dependencies.zeroize]
version = "1.8"
optional = true

[dev-dependencies.backtrace]
version = "0.3"

[dev-dependencies.ipnetwork]
version = "0.21"
features = ["serde"]

[dev-dependencies.nix]
version = "0.30"
features = ["fs"]

[dev-dependencies.reqwest]
version = "0.12"
default-features = false

[dev-dependencies.sentry]
version = "0.36"
features = [
    "backtrace",
    "contexts",
    "panic",
    "ureq",
    "rustls",
]
default-features = false

[dev-dependencies.serde]
version = "1.0.198"
features = ["rc"]

[dev-dependencies.tempfile]
version = "3.7"

[dev-dependencies.tokio]
version = "1.41.0"
features = [
    "macros",
    "rt-multi-thread",
]

[dev-dependencies.tracing-subscriber]
version = "0.3"

[build-dependencies.bindgen]
version = "0.72"
features = ["runtime"]
optional = true
default-features = false

[build-dependencies.cc]
version = "1.0"
optional = true

[target.'cfg(target_os = "linux")'.dependencies.neli]
version = "0.6.5"
optional = true

[target.'cfg(target_os = "linux")'.dependencies.neli-proc-macros]
version = "0.1.4"
optional = true

[target.'cfg(target_os = "linux")'.dependencies.tempfile]
version = "3.7"
optional = true

[target.'cfg(target_os = "linux")'.dependencies.tikv-jemalloc-ctl]
version = "0.6"
features = ["use_std"]
optional = true

[lints.rust.unexpected_cfgs]
level = "warn"
priority = 0
check-cfg = [
    "cfg(foundations_generic_telemetry_wrapper)",
    "cfg(foundations_unstable)",
    "cfg(tokio_unstable)",
    "cfg(foundations_docsrs)",
    "cfg(integer128)",
]
