1- use std:: {
2- collections:: { BTreeMap , BTreeSet } ,
3- hash:: { Hash , Hasher } ,
4- path:: PathBuf ,
5- } ;
6-
71use miette:: Diagnostic ;
2+ use once_cell:: sync:: Lazy ;
83use pathdiff:: diff_paths;
94use pixi_build_discovery:: { CommandSpec , EnabledProtocols } ;
105use pixi_build_frontend:: Backend ;
@@ -14,6 +9,12 @@ use pixi_record::{InputHash, PinnedSourceSpec};
149use pixi_spec:: { SourceAnchor , SourceSpec } ;
1510use rand:: random;
1611use rattler_conda_types:: { ChannelConfig , ChannelUrl } ;
12+ use std:: {
13+ collections:: { BTreeMap , BTreeSet , HashSet } ,
14+ hash:: { Hash , Hasher } ,
15+ path:: PathBuf ,
16+ sync:: Mutex ,
17+ } ;
1718use thiserror:: Error ;
1819use tracing:: instrument;
1920use xxhash_rust:: xxh3:: Xxh3 ;
@@ -29,6 +30,18 @@ use crate::{
2930use pixi_build_discovery:: BackendSpec ;
3031use pixi_build_frontend:: BackendOverride ;
3132
33+ static WARNED_BACKENDS : Lazy < Mutex < HashSet < String > > > = Lazy :: new ( || Mutex :: new ( HashSet :: new ( ) ) ) ;
34+
35+ fn warn_once_per_backend ( backend_name : & str ) {
36+ let mut warned = WARNED_BACKENDS . lock ( ) . unwrap ( ) ;
37+ if warned. insert ( backend_name. to_string ( ) ) {
38+ tracing:: warn!(
39+ "metadata cache disabled for build backend '{}' (system/path-based backends always regenerate metadata)" ,
40+ backend_name
41+ ) ;
42+ }
43+ }
44+
3245/// Represents a request for metadata from a build backend for a particular
3346/// source location. The result of this request is the metadata for that
3447/// particular source.
@@ -145,10 +158,7 @@ impl BuildBackendMetadataSpec {
145158 let backend_name = match & discovered_backend. backend_spec {
146159 BackendSpec :: JsonRpc ( spec) => & spec. name ,
147160 } ;
148- tracing:: warn!(
149- "metadata cache disabled for build backend '{}' (system/path-based backends always regenerate metadata)" ,
150- backend_name
151- ) ;
161+ warn_once_per_backend ( backend_name) ;
152162 }
153163
154164 // Instantiate the backend with the discovered information.
0 commit comments