Fix Labrinth not compiling on Windows due to jemalloc dependency (#3378)

This commit is contained in:
Josiah Glosson
2025-03-10 16:45:36 -05:00
committed by GitHub
parent 4dd33a2f9e
commit d6c8af7ed5
4 changed files with 15 additions and 5 deletions

View File

@@ -352,7 +352,13 @@ pub fn app_config(
.app_data(labrinth_config.active_sockets.clone())
.app_data(labrinth_config.automated_moderation_queue.clone())
.app_data(web::Data::new(labrinth_config.stripe_client.clone()))
.configure(routes::debug::config)
.configure(
#[allow(unused_variables)]
|cfg| {
#[cfg(not(target_env = "msvc"))]
routes::debug::config(cfg)
},
)
.configure(routes::v2::config)
.configure(routes::v3::config)
.configure(routes::internal::config)

View File

@@ -110,6 +110,8 @@ async fn main() -> std::io::Result<()> {
.register_and_set_metrics(&prometheus.registry)
.await
.expect("Failed to register redis metrics");
#[cfg(not(target_env = "msvc"))]
labrinth::routes::debug::jemalloc_mmeory_stats(&prometheus.registry)
.expect("Failed to register jemalloc metrics");

View File

@@ -12,6 +12,7 @@ pub mod internal;
pub mod v2;
pub mod v3;
#[cfg(not(target_env = "msvc"))]
pub mod debug;
pub mod v2_reroute;