From 195ca3d1b3065f594a89a3cd40732d049f7b967f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 4 Feb 2026 20:38:35 +0000 Subject: [PATCH 1/2] Initial plan From fe7576963cd45710c9bc38c21162230824858aac Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 4 Feb 2026 20:42:58 +0000 Subject: [PATCH 2/2] Fix tracing feature compilation issue in diskann Co-authored-by: hildebrandmw <24898651+hildebrandmw@users.noreply.github.com> --- diskann/src/graph/index.rs | 2 +- diskann/src/tracing.rs | 44 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/diskann/src/graph/index.rs b/diskann/src/graph/index.rs index 9d9271f5d..1b4b023c1 100644 --- a/diskann/src/graph/index.rs +++ b/diskann/src/graph/index.rs @@ -22,7 +22,6 @@ use futures_util::FutureExt; use hashbrown::HashSet; use thiserror::Error; use tokio::task::JoinSet; -use tracing::{debug, trace}; use super::{ AdjacencyList, Config, ConsolidateKind, InplaceDeleteMethod, RangeSearchParams, SearchParams, @@ -52,6 +51,7 @@ use crate::{ NeighborAccessorMut, SetElement, }, tracked_error, + tracing::{debug, trace}, utils::{ IntoUsize, TryIntoVectorId, VectorId, async_tools::{self, DynamicBalancer, VectorIdBoxSlice}, diff --git a/diskann/src/tracing.rs b/diskann/src/tracing.rs index 8247d8925..ef7d85cf2 100644 --- a/diskann/src/tracing.rs +++ b/diskann/src/tracing.rs @@ -14,6 +14,7 @@ /// /// Upstream handling should first look for these fields and only if they don't exist should /// we inspect the file and line included as part of the tracing record. +#[cfg(feature = "tracing")] #[macro_export] macro_rules! tracked_error { ($($arg:tt)+) => {{ @@ -22,6 +23,13 @@ macro_rules! tracked_error { }}; } +#[cfg(not(feature = "tracing"))] +#[macro_export] +macro_rules! tracked_error { + ($($arg:tt)+) => {{}}; +} + +#[cfg(feature = "tracing")] #[macro_export] macro_rules! tracked_warn { ($($arg:tt)+) => {{ @@ -30,6 +38,13 @@ macro_rules! tracked_warn { }}; } +#[cfg(not(feature = "tracing"))] +#[macro_export] +macro_rules! tracked_warn { + ($($arg:tt)+) => {{}}; +} + +#[cfg(feature = "tracing")] #[macro_export] macro_rules! tracked_debug { ($($arg:tt)+) => {{ @@ -38,6 +53,35 @@ macro_rules! tracked_debug { }}; } +#[cfg(not(feature = "tracing"))] +#[macro_export] +macro_rules! tracked_debug { + ($($arg:tt)+) => {{}}; +} + pub use tracked_debug; pub use tracked_error; pub use tracked_warn; + +// Re-export tracing macros when the feature is enabled +#[cfg(feature = "tracing")] +pub use tracing::{debug, trace}; + +// Define no-op macros when the tracing feature is disabled +#[cfg(not(feature = "tracing"))] +#[macro_export] +macro_rules! debug { + ($($arg:tt)*) => {{}}; +} + +#[cfg(not(feature = "tracing"))] +#[macro_export] +macro_rules! trace { + ($($arg:tt)*) => {{}}; +} + +#[cfg(not(feature = "tracing"))] +pub use debug; + +#[cfg(not(feature = "tracing"))] +pub use trace;