fix smoke from builds produced by --all-features

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2024-05-19 13:02:55 +00:00 committed by June 🍓🦴
parent fdc9a9a1b8
commit 74832bdc47
9 changed files with 21 additions and 22 deletions

View file

@ -63,10 +63,6 @@ brotli_compression = [
]
perf_measurements = []
sentry_telemetry = []
mods = [
"dep:libloading"
]
panic_trap = []
[dependencies]
async-trait.workspace = true
@ -86,7 +82,6 @@ infer.workspace = true
ipaddress.workspace = true
itertools.workspace = true
libloading.workspace = true
libloading.optional = true
log.workspace = true
lru-cache.workspace = true
parking_lot.optional = true

View file

@ -62,7 +62,6 @@ fn panic_handler(info: &PanicInfo<'_>, next: &dyn Fn(&PanicInfo<'_>)) {
}
#[inline(always)]
#[allow(unexpected_cfgs)]
pub fn trap() {
#[cfg(core_intrinsics)]
//SAFETY: embeds llvm intrinsic for hardware breakpoint

View file

@ -14,8 +14,8 @@ pub use pducount::PduCount;
pub use server::Server;
pub use utils::conduwuit_version;
#[cfg(not(feature = "mods"))]
mod mods {
#[cfg(not(conduit_mods))]
pub mod mods {
#[macro_export]
macro_rules! mod_ctor {
() => {};

View file

@ -1,4 +1,4 @@
#![cfg(feature = "mods")]
#![cfg(conduit_mods)]
pub(crate) use libloading::os::unix::{Library, Symbol};

View file

@ -67,8 +67,6 @@ perf_measurements = [
jemalloc = [
"dep:tikv-jemallocator",
]
panic_trap = []
mods = []
[dependencies]
conduit-router.workspace = true

View file

@ -37,7 +37,7 @@ fn main() -> Result<(), Error> {
/// Operate the server normally in release-mode static builds. This will start,
/// run and stop the server within the asynchronous runtime.
#[cfg(not(feature = "mods"))]
#[cfg(not(conduit_mods))]
async fn async_main(server: Arc<Server>) -> Result<(), Error> {
extern crate conduit_router as router;
use tracing::error;
@ -64,7 +64,7 @@ async fn async_main(server: Arc<Server>) -> Result<(), Error> {
/// Operate the server in developer-mode dynamic builds. This will start, run,
/// and hot-reload portions of the server as-needed before returning for an
/// actual shutdown. This is not available in release-mode or static builds.
#[cfg(feature = "mods")]
#[cfg(conduit_mods)]
async fn async_main(server: Arc<Server>) -> Result<(), Error> {
let mut starts = true;
let mut reloads = true;

View file

@ -1,6 +1,4 @@
#![cfg(feature = "mods")]
#[cfg(not(any(clippy, debug_assertions, doctest, test)))]
compile_error!("Feature 'mods' is only available in developer builds");
#![cfg(conduit_mods)]
use std::{
future::Future,
@ -26,7 +24,7 @@ const MODULE_NAMES: &[&str] = &[
"conduit_router",
];
#[cfg(feature = "panic_trap")]
#[cfg(panic_trap)]
conduit::mod_init! {{
conduit::debug::set_panic_trap();
}}

View file

@ -21,8 +21,8 @@ pub(crate) struct Server {
#[cfg(feature = "sentry_telemetry")]
_sentry_guard: Option<sentry::ClientInitGuard>,
#[cfg(conduit_mods)]
// Module instances; TODO: move to mods::loaded mgmt vector
#[cfg(feature = "mods")]
pub(crate) mods: tokio::sync::RwLock<Vec<conduit::mods::Module>>,
}
@ -52,7 +52,7 @@ impl Server {
#[cfg(feature = "sentry_telemetry")]
_sentry_guard: sentry_guard,
#[cfg(feature = "mods")]
#[cfg(conduit_mods)]
mods: tokio::sync::RwLock::new(Vec::new()),
}))
}
@ -109,7 +109,7 @@ fn init_tracing(config: &Config) -> (LogLevelReloadHandles, TracingFlameGuard) {
let mut reload_handles = Vec::<Box<dyn ReloadHandle<EnvFilter> + Send + Sync>>::new();
let subscriber = registry;
#[cfg(feature = "tokio_console")]
#[cfg(all(feature = "tokio_console", tokio_unstable))]
let subscriber = {
let console_layer = console_subscriber::spawn();
subscriber.with(console_layer)
@ -176,7 +176,7 @@ fn init_tracing(config: &Config) -> (LogLevelReloadHandles, TracingFlameGuard) {
tracing::subscriber::set_global_default(subscriber).unwrap();
#[cfg(all(feature = "tokio_console", feature = "release_max_log_level"))]
#[cfg(all(feature = "tokio_console", feature = "release_max_log_level", tokio_unstable))]
tracing::error!(
"'tokio_console' feature and 'release_max_log_level' feature are incompatible, because console-subscriber \
needs access to trace-level events. 'release_max_log_level' must be disabled to use tokio-console."