Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ members = [
resolver = "3"

[workspace.package]
version = "5.7.2"
version = "5.7.3"
repository = "https://github.com/cloudflare/foundations"
edition = "2024"
authors = ["Cloudflare"]
Expand All @@ -27,9 +27,10 @@ debug = 1
[workspace.lints.rust.unexpected_cfgs]
level = "warn"
check-cfg = [
'cfg(foundations_generic_telemetry_wrapper)',
'cfg(foundations_unstable)',
'cfg(tokio_unstable)',
'cfg(foundations_jemalloc_disable)',
'cfg(foundations_generic_telemetry_wrapper)',
# for docs.rs builds only
'cfg(foundations_docsrs)',
# slog feature
Expand All @@ -39,8 +40,8 @@ check-cfg = [
[workspace.dependencies]
anyhow = "1.0.102"
backtrace = "0.3.76"
foundations = { version = "5.7.2", path = "./foundations", default-features = false }
foundations-macros = { version = "=5.7.2", path = "./foundations-macros", default-features = false }
foundations = { version = "5.7.3", path = "./foundations", default-features = false }
foundations-macros = { version = "=5.7.3", path = "./foundations-macros", default-features = false }
bindgen = { version = "0.72.1", default-features = false }
cc = "1.2.61"
cf-rustracing = "1.3.0"
Expand Down
5 changes: 5 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@

5.7.3
- 2026-06-10 Add cfg(foundations_jemalloc_disable) to opt out of global jemalloc allocator
- 2026-06-10 Move cfg(foundations_generic_telemetry_wrapper) docs out of lib.rs
- 2026-06-05 Add actions pipeline for trusted publishing to crates.io

5.7.2
- 2026-06-05 fix: strip plain release commits from RELEASE_NOTES.md
- 2026-06-02 Gracefully degrade on metrics encoding failures
Expand Down
4 changes: 2 additions & 2 deletions foundations/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,10 @@ tracing-rs-compat = ["dep:tracing-slog"]

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "foundations_docsrs", "--cfg", "tokio_unstable", "--cfg", "foundations_unstable", "--cfg", "foundations_generic_telemetry_wrapper"]
rustdoc-args = ["--cfg", "foundations_docsrs", "--cfg", "tokio_unstable", "--cfg", "foundations_unstable"]
# it's necessary to _also_ pass `--cfg tokio_unstable` and `--cfg foundations_unstable`
# to rustc, or else dependencies will not be enabled, and the docs build will fail.
rustc-args = ["--cfg", "tokio_unstable", "--cfg", "foundations_unstable", "--cfg", "foundations_generic_telemetry_wrapper"]
rustc-args = ["--cfg", "tokio_unstable", "--cfg", "foundations_unstable"]

[lints]
workspace = true
Expand Down
22 changes: 11 additions & 11 deletions foundations/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,14 @@
//! - **security**: Enables security features. Available only on Linux (x86_64, aarch64) with the `libclang-dev` package installed (for bindgen).
//! - **jemalloc**: Enables [jemalloc] memory allocator which is known to perform much better than
//! system allocators for long living service.
//! - There is an opt-out available by passing `--cfg foundations_jemalloc_disable`
//! to rustc (e.g., via `RUSTFLAGS`). This can be used as a workaround for the additive
//! nature of features.
//! - **memory-profiling**: Enables memory profiling functionality and telemetry. Implicity enables
//! **jemalloc** feature.
//! - **cli**: Enables command line interface (CLI) functionality. Implicitly enabled **settings**
//! feature.
//!
//! # Generic telemetry
//! Foundations currently box the future with TelemetryContext by default. A default generic
//! wrapper is gated behind `--cfg foundations_generic_telemetry_wrapper`.
//!
//! To enable this, you must add `--cfg foundations_generic_telemetry_wrapper` to your RUSTFLAGS
//! environment variable.
//!
//! # Unstable Features
//! Foundations has unstable features which are gated behind `--cfg foundations_unstable`:
//!
Expand Down Expand Up @@ -128,16 +124,20 @@ pub mod reexports_for_macros {

/// Global memory allocator backed by [jemalloc].
///
/// This static variable is exposed solely for the documentation purposes and don't need to be used
/// directly. If **jemalloc** feature is enabled then the service will use jemalloc for all the
/// memory allocations implicitly.
/// This static variable is exposed solely for documentation purposes and doesn't need to be used
/// directly. If the **jemalloc** feature is enabled then the service will use jemalloc for all
/// memory allocations implicitly. This can be disabled again in final builds by passing
/// `--cfg foundations_jemalloc_disable` to rustc (e.g., via `RUSTFLAGS`). Doing so is necessary
/// when the _jemalloc_ feature was mistakenly enabled by a dependency or when debugging with
/// [Address Sanitizer][asan].
///
/// If no Foundations API is being used by your project, you will need to explicitly link foundations crate
/// to your project by adding `extern crate foundations;` to your `main.rs` or `lib.rs`, for jemalloc to
/// be embedded in your binary.
///
/// [jemalloc]: https://github.com/jemalloc/jemalloc
#[cfg(feature = "jemalloc")]
/// [asan]: https://doc.rust-lang.org/beta/unstable-book/compiler-flags/sanitizer.html#addresssanitizer
#[cfg(all(feature = "jemalloc", not(foundations_jemalloc_disable)))]
#[global_allocator]
pub static JEMALLOC_MEMORY_ALLOCATOR: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;

Expand Down
5 changes: 4 additions & 1 deletion foundations/src/telemetry/tracing/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ pub fn get_active_traces() -> String {
/// call lasts.
///
/// The macro works both for sync and async methods and also for the [async_trait] method
/// implementations.
/// implementations. `async fn`s are boxed before wrapping by default, but this can be
/// bypassed by specifying `generic = true` in the macro invocation. To make `generic` the
/// default, you can pass `--cfg foundations_generic_telemetry_wrapper` to rustc (e.g., via
/// `RUSTFLAGS`).
///
/// # Example
/// ```
Expand Down
Loading