Skip to content

Commit

Permalink
rubicon 3.2.0, compatibility tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fasterthanlime committed Jul 23, 2024
1 parent 2b993f2 commit 2148acf
Show file tree
Hide file tree
Showing 9 changed files with 154 additions and 33 deletions.
2 changes: 1 addition & 1 deletion tracing-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ maintenance = { status = "actively-developed" }

[dependencies]
once_cell = { version = "1.13.0", optional = true }
rubicon = "3.0.1"
rubicon = "3.2.0"

[target.'cfg(tracing_unstable)'.dependencies]
valuable = { version = "0.1.0", optional = true, default-features = false }
Expand Down
7 changes: 7 additions & 0 deletions tracing-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,3 +292,10 @@ pub use self::{metadata::Kind, subscriber::Interest};
mod sealed {
pub trait Sealed {}
}

rubicon::compatibility_check! {
("version", env!("CARGO_PKG_VERSION")),

#[cfg(feature = "std")]
("std", "enabled"),
}
16 changes: 9 additions & 7 deletions tracing-flame/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
[package]
name = "tracing-flame"
version = "0.2.0"
authors = [
"Jane Lusby <[email protected]>",
"Tokio Contributors <[email protected]>"
]
authors = ["Jane Lusby <[email protected]>", "Tokio Contributors <[email protected]>"]
edition = "2018"
license = "MIT"
readme = "README.md"
Expand All @@ -26,10 +23,15 @@ default = ["smallvec"]
smallvec = ["tracing-subscriber/smallvec"]

[dependencies]
tracing-subscriber = { path = "../tracing-subscriber", version = "0.3.0", default-features = false, features = ["registry", "fmt"] }
tracing = { path = "../tracing", version = "0.1.35", default-features = false, features = ["std"] }
tracing-subscriber = { path = "../tracing-subscriber", version = "0.3.0", default-features = false, features = [
"registry",
"fmt",
] }
tracing = { path = "../tracing", version = "0.1.35", default-features = false, features = [
"std",
] }
once_cell = "1.13.0"
rubicon = "3.0.1"
rubicon = "3.2.0"


[dev-dependencies]
Expand Down
4 changes: 1 addition & 3 deletions tracing-flame/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,7 @@ use tracing_subscriber::Layer;

mod error;

rubicon::process_local! {
static START: Lazy<Instant> = Lazy::new(Instant::now);
}
static START: Lazy<Instant> = Lazy::new(Instant::now);

rubicon::thread_local! {
static LAST_EVENT: Cell<Instant> = Cell::new(*START);
Expand Down
11 changes: 4 additions & 7 deletions tracing-log/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ homepage = "https://tokio.rs"
description = """
Provides compatibility between `tracing` and the `log` crate.
"""
categories = [
"development-tools::debugging",
"asynchronous",
]
categories = ["development-tools::debugging", "asynchronous"]
keywords = ["logging", "tracing", "log"]
license = "MIT"
readme = "README.md"
Expand All @@ -24,15 +21,15 @@ log-tracer = []
interest-cache = ["lru", "ahash"]

[dependencies]
tracing-core = { path = "../tracing-core", version = "0.1.28"}
tracing-core = { path = "../tracing-core", version = "0.1.28" }
log = { version = "0.4.17" }
once_cell = "1.13.0"
lru = { version = "0.7.7", optional = true }
ahash = { version = "0.7.7", optional = true }
rubicon = "3.0.1"
rubicon = "3.2.0"

[dev-dependencies]
tracing = { path = "../tracing", version = "0.1.35"}
tracing = { path = "../tracing", version = "0.1.35" }
tracing-subscriber = { path = "../tracing-subscriber" }
criterion = { version = "0.3.6", default-features = false }

Expand Down
39 changes: 32 additions & 7 deletions tracing-subscriber/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,24 @@ rust-version = "1.63.0"
default = ["smallvec", "fmt", "ansi", "tracing-log", "std"]
alloc = []
std = ["alloc", "tracing-core/std"]
env-filter = ["matchers", "regex", "once_cell", "tracing", "std", "thread_local"]
env-filter = [
"matchers",
"regex",
"once_cell",
"tracing",
"std",
"thread_local",
]
fmt = ["registry", "std"]
ansi = ["fmt", "nu-ansi-term"]
registry = ["sharded-slab", "thread_local", "std"]
json = ["tracing-serde", "serde", "serde_json"]
valuable = ["tracing-core/valuable", "valuable_crate", "valuable-serde", "tracing-serde/valuable"]
valuable = [
"tracing-core/valuable",
"valuable_crate",
"valuable-serde",
"tracing-serde/valuable",
]
# Enables support for local time when using the `time` crate timestamp
# formatters.
local-time = ["time/local-offset"]
Expand All @@ -43,12 +55,19 @@ tracing-core = { path = "../tracing-core", version = "0.1.30", default-features
# only required by the filter feature
tracing = { optional = true, path = "../tracing", version = "0.1.35", default-features = false }
matchers = { optional = true, version = "0.1.0" }
regex = { optional = true, version = "1.6.0", default-features = false, features = ["std", "unicode-case", "unicode-perl"] }
regex = { optional = true, version = "1.6.0", default-features = false, features = [
"std",
"unicode-case",
"unicode-perl",
] }
smallvec = { optional = true, version = "1.9.0" }
once_cell = { optional = true, version = "1.13.0" }

# fmt
tracing-log = { path = "../tracing-log", version = "0.2.0", optional = true, default-features = false, features = ["log-tracer", "std"] }
tracing-log = { path = "../tracing-log", version = "0.2.0", optional = true, default-features = false, features = [
"log-tracer",
"std",
] }
nu-ansi-term = { version = "0.46.0", optional = true }
time = { version = "0.3.2", features = ["formatting"], optional = true }

Expand All @@ -59,12 +78,15 @@ tracing-serde = { path = "../tracing-serde", version = "0.1.3", optional = true

# opt-in deps
parking_lot = { version = "0.12.1", optional = true }
chrono = { version = "0.4.26", default-features = false, features = ["clock", "std"], optional = true }
chrono = { version = "0.4.26", default-features = false, features = [
"clock",
"std",
], optional = true }

# registry
sharded-slab = { version = "0.1.4", optional = true }
thread_local = { version = "1.1.4", optional = true }
rubicon = "3.0.1"
rubicon = "3.2.0"

[target.'cfg(tracing_unstable)'.dependencies]
valuable_crate = { package = "valuable", version = "0.1.0", optional = true, default-features = false }
Expand All @@ -77,7 +99,10 @@ log = "0.4.17"
tracing-log = { path = "../tracing-log", version = "0.2.0" }
criterion = { version = "0.3.6", default-features = false }
regex = { version = "1", default-features = false, features = ["std"] }
tracing-futures = { path = "../tracing-futures", version = "0.2.0", default-features = false, features = ["std-future", "std"] }
tracing-futures = { path = "../tracing-futures", version = "0.2.0", default-features = false, features = [
"std-future",
"std",
] }
tokio = { version = "1", features = ["rt", "macros"] }
# Enable the `time` crate's `macros` feature, for examples.
time = { version = "0.3.2", features = ["formatting", "macros"] }
Expand Down
31 changes: 31 additions & 0 deletions tracing-subscriber/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,3 +249,34 @@ feature! {
mod sealed {
pub trait Sealed<A = ()> {}
}

rubicon::compatibility_check! {
("version", env!("CARGO_PKG_VERSION")),

#[cfg(feature = "std")]
("std", "enabled"),

#[cfg(feature = "alloc")]
("alloc", "enabled"),

#[cfg(feature = "env-filter")]
("env-filter", "enabled"),

#[cfg(feature = "fmt")]
("fmt", "enabled"),

#[cfg(feature = "ansi")]
("ansi", "enabled"),

#[cfg(feature = "registry")]
("registry", "enabled"),

#[cfg(feature = "json")]
("json", "enabled"),

#[cfg(feature = "valuable")]
("valuable", "enabled"),

#[cfg(feature = "local-time")]
("local-time", "enabled"),
}
19 changes: 11 additions & 8 deletions tracing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ name = "tracing"
# - Update CHANGELOG.md.
# - Create "v0.1.x" git tag
version = "0.1.40"
authors = ["Eliza Weisman <[email protected]>", "Tokio Contributors <[email protected]>"]
authors = [
"Eliza Weisman <[email protected]>",
"Tokio Contributors <[email protected]>",
]
license = "MIT"
readme = "README.md"
repository = "https://github.com/tokio-rs/tracing"
Expand All @@ -32,7 +35,7 @@ tracing-core = { path = "../tracing-core", version = "0.1.32", default-features
log = { version = "0.4.17", optional = true }
tracing-attributes = { path = "../tracing-attributes", version = "0.1.27", optional = true }
pin-project-lite = "0.2.9"
rubicon = "3.0.1"
rubicon = "3.2.0"

[dev-dependencies]
criterion = { version = "0.3.6", default_features = false }
Expand All @@ -46,17 +49,17 @@ wasm-bindgen-test = "0.3.38"
[features]
default = ["std", "attributes"]

max_level_off = []
max_level_off = []
max_level_error = []
max_level_warn = []
max_level_info = []
max_level_warn = []
max_level_info = []
max_level_debug = []
max_level_trace = []

release_max_level_off = []
release_max_level_off = []
release_max_level_error = []
release_max_level_warn = []
release_max_level_info = []
release_max_level_warn = []
release_max_level_info = []
release_max_level_debug = []
release_max_level_trace = []

Expand Down
58 changes: 58 additions & 0 deletions tracing/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1129,3 +1129,61 @@ pub mod log {
mod sealed {
pub trait Sealed {}
}

rubicon::compatibility_check! {
("version", env!("CARGO_PKG_VERSION")),

#[cfg(feature = "std")]
("std", "enabled"),

#[cfg(feature = "attributes")]
("attributes", "enabled"),

// These are all just compile-time filters

// #[cfg(feature = "max_level_off")]
// ("max_level_off", "enabled"),

// #[cfg(feature = "max_level_error")]
// ("max_level_error", "enabled"),

// #[cfg(feature = "max_level_warn")]
// ("max_level_warn", "enabled"),

// #[cfg(feature = "max_level_info")]
// ("max_level_info", "enabled"),

// #[cfg(feature = "max_level_debug")]
// ("max_level_debug", "enabled"),

// #[cfg(feature = "max_level_trace")]
// ("max_level_trace", "enabled"),

// #[cfg(feature = "release_max_level_off")]
// ("release_max_level_off", "enabled"),

// #[cfg(feature = "release_max_level_error")]
// ("release_max_level_error", "enabled"),

// #[cfg(feature = "release_max_level_warn")]
// ("release_max_level_warn", "enabled"),

// #[cfg(feature = "release_max_level_info")]
// ("release_max_level_info", "enabled"),

// #[cfg(feature = "release_max_level_debug")]
// ("release_max_level_debug", "enabled"),

// #[cfg(feature = "release_max_level_trace")]
// ("release_max_level_trace", "enabled"),

// That one is deprecated
// #[cfg(feature = "async-await")]
// ("async-await", "enabled"),

#[cfg(feature = "log-always")]
("log-always", "enabled"),

#[cfg(feature = "valuable")]
("valuable", "enabled"),
}

0 comments on commit 2148acf

Please sign in to comment.