use qualified crate names from within workspace
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
c99f5770a0
commit
7f448d88a4
9 changed files with 28 additions and 24 deletions
|
@ -3,7 +3,7 @@
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
use clap::{ArgAction, Parser};
|
use clap::{ArgAction, Parser};
|
||||||
use conduwuit::{
|
use conduwuit_core::{
|
||||||
Err, Result,
|
Err, Result,
|
||||||
config::{Figment, FigmentValue},
|
config::{Figment, FigmentValue},
|
||||||
err, toml,
|
err, toml,
|
||||||
|
@ -12,7 +12,12 @@ use conduwuit::{
|
||||||
|
|
||||||
/// Commandline arguments
|
/// Commandline arguments
|
||||||
#[derive(Parser, Debug)]
|
#[derive(Parser, Debug)]
|
||||||
#[clap(version = conduwuit::version(), about, long_about = None, name = "conduwuit")]
|
#[clap(
|
||||||
|
about,
|
||||||
|
long_about = None,
|
||||||
|
name = "conduwuit",
|
||||||
|
version = conduwuit_core::version(),
|
||||||
|
)]
|
||||||
pub(crate) struct Args {
|
pub(crate) struct Args {
|
||||||
#[arg(short, long)]
|
#[arg(short, long)]
|
||||||
/// Path to the config TOML file (optional)
|
/// Path to the config TOML file (optional)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use conduwuit::{
|
use conduwuit_core::{
|
||||||
Result,
|
Result,
|
||||||
config::Config,
|
config::Config,
|
||||||
debug_warn, err,
|
debug_warn, err,
|
||||||
|
|
|
@ -7,11 +7,9 @@ mod sentry;
|
||||||
mod server;
|
mod server;
|
||||||
mod signal;
|
mod signal;
|
||||||
|
|
||||||
extern crate conduwuit_core as conduwuit;
|
|
||||||
|
|
||||||
use std::sync::{Arc, atomic::Ordering};
|
use std::sync::{Arc, atomic::Ordering};
|
||||||
|
|
||||||
use conduwuit::{Error, Result, debug_info, error, rustc_flags_capture};
|
use conduwuit_core::{Error, Result, debug_info, error, rustc_flags_capture};
|
||||||
use server::Server;
|
use server::Server;
|
||||||
|
|
||||||
rustc_flags_capture! {}
|
rustc_flags_capture! {}
|
||||||
|
|
|
@ -9,13 +9,13 @@ use std::{
|
||||||
sync::{Arc, atomic::Ordering},
|
sync::{Arc, atomic::Ordering},
|
||||||
};
|
};
|
||||||
|
|
||||||
use conduwuit::{Error, Result, debug, error, mods};
|
use conduwuit_core::{Error, Result, debug, error, mods};
|
||||||
use conduwuit_service::Services;
|
use conduwuit_service::Services;
|
||||||
|
|
||||||
use crate::Server;
|
use crate::Server;
|
||||||
|
|
||||||
type StartFuncResult = Pin<Box<dyn Future<Output = Result<Arc<Services>>> + Send>>;
|
type StartFuncResult = Pin<Box<dyn Future<Output = Result<Arc<Services>>> + Send>>;
|
||||||
type StartFuncProto = fn(&Arc<conduwuit::Server>) -> StartFuncResult;
|
type StartFuncProto = fn(&Arc<conduwuit_core::Server>) -> StartFuncResult;
|
||||||
|
|
||||||
type RunFuncResult = Pin<Box<dyn Future<Output = Result<()>> + Send>>;
|
type RunFuncResult = Pin<Box<dyn Future<Output = Result<()>> + Send>>;
|
||||||
type RunFuncProto = fn(&Arc<Services>) -> RunFuncResult;
|
type RunFuncProto = fn(&Arc<Services>) -> RunFuncResult;
|
||||||
|
@ -34,8 +34,8 @@ const MODULE_NAMES: &[&str] = &[
|
||||||
];
|
];
|
||||||
|
|
||||||
#[cfg(panic_trap)]
|
#[cfg(panic_trap)]
|
||||||
conduwuit::mod_init! {{
|
conduwuit_core::mod_init! {{
|
||||||
conduwuit::debug::set_panic_trap();
|
conduwuit_core::debug::set_panic_trap();
|
||||||
}}
|
}}
|
||||||
|
|
||||||
pub(crate) async fn run(server: &Arc<Server>, starts: bool) -> Result<(bool, bool), Error> {
|
pub(crate) async fn run(server: &Arc<Server>, starts: bool) -> Result<(bool, bool), Error> {
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
use std::{env, os::unix::process::CommandExt, process::Command};
|
use std::{env, os::unix::process::CommandExt, process::Command};
|
||||||
|
|
||||||
use conduwuit::{debug, info, utils};
|
use conduwuit_core::{debug, info, utils};
|
||||||
|
|
||||||
#[cold]
|
#[cold]
|
||||||
pub(super) fn restart() -> ! {
|
pub(super) fn restart() -> ! {
|
||||||
|
|
|
@ -9,8 +9,8 @@ use std::{
|
||||||
};
|
};
|
||||||
|
|
||||||
#[cfg(all(not(target_env = "msvc"), feature = "jemalloc"))]
|
#[cfg(all(not(target_env = "msvc"), feature = "jemalloc"))]
|
||||||
use conduwuit::result::LogDebugErr;
|
use conduwuit_core::result::LogDebugErr;
|
||||||
use conduwuit::{
|
use conduwuit_core::{
|
||||||
Result, is_true,
|
Result, is_true,
|
||||||
utils::sys::compute::{nth_core_available, set_affinity},
|
utils::sys::compute::{nth_core_available, set_affinity},
|
||||||
};
|
};
|
||||||
|
@ -122,7 +122,7 @@ fn set_worker_affinity() {
|
||||||
|
|
||||||
#[cfg(all(not(target_env = "msvc"), feature = "jemalloc"))]
|
#[cfg(all(not(target_env = "msvc"), feature = "jemalloc"))]
|
||||||
fn set_worker_mallctl(id: usize) {
|
fn set_worker_mallctl(id: usize) {
|
||||||
use conduwuit::alloc::je::{
|
use conduwuit_core::alloc::je::{
|
||||||
is_affine_arena,
|
is_affine_arena,
|
||||||
this_thread::{set_arena, set_muzzy_decay},
|
this_thread::{set_arena, set_muzzy_decay},
|
||||||
};
|
};
|
||||||
|
@ -135,7 +135,8 @@ fn set_worker_mallctl(id: usize) {
|
||||||
.get()
|
.get()
|
||||||
.expect("GC_MUZZY initialized by runtime::new()");
|
.expect("GC_MUZZY initialized by runtime::new()");
|
||||||
|
|
||||||
let muzzy_auto_disable = conduwuit::utils::available_parallelism() >= DISABLE_MUZZY_THRESHOLD;
|
let muzzy_auto_disable =
|
||||||
|
conduwuit_core::utils::available_parallelism() >= DISABLE_MUZZY_THRESHOLD;
|
||||||
if matches!(muzzy_option, Some(false) | None if muzzy_auto_disable) {
|
if matches!(muzzy_option, Some(false) | None if muzzy_auto_disable) {
|
||||||
set_muzzy_decay(-1).log_debug_err().ok();
|
set_muzzy_decay(-1).log_debug_err().ok();
|
||||||
}
|
}
|
||||||
|
@ -188,7 +189,7 @@ fn thread_park() {
|
||||||
|
|
||||||
fn gc_on_park() {
|
fn gc_on_park() {
|
||||||
#[cfg(all(not(target_env = "msvc"), feature = "jemalloc"))]
|
#[cfg(all(not(target_env = "msvc"), feature = "jemalloc"))]
|
||||||
conduwuit::alloc::je::this_thread::decay()
|
conduwuit_core::alloc::je::this_thread::decay()
|
||||||
.log_debug_err()
|
.log_debug_err()
|
||||||
.ok();
|
.ok();
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@ use std::{
|
||||||
sync::{Arc, OnceLock},
|
sync::{Arc, OnceLock},
|
||||||
};
|
};
|
||||||
|
|
||||||
use conduwuit::{config::Config, debug, trace};
|
use conduwuit_core::{config::Config, debug, trace};
|
||||||
use sentry::{
|
use sentry::{
|
||||||
Breadcrumb, ClientOptions, Level,
|
Breadcrumb, ClientOptions, Level,
|
||||||
types::{
|
types::{
|
||||||
|
@ -43,7 +43,7 @@ fn options(config: &Config) -> ClientOptions {
|
||||||
traces_sample_rate: config.sentry_traces_sample_rate,
|
traces_sample_rate: config.sentry_traces_sample_rate,
|
||||||
debug: cfg!(debug_assertions),
|
debug: cfg!(debug_assertions),
|
||||||
release: sentry::release_name!(),
|
release: sentry::release_name!(),
|
||||||
user_agent: conduwuit::version::user_agent().into(),
|
user_agent: conduwuit_core::version::user_agent().into(),
|
||||||
attach_stacktrace: config.sentry_attach_stacktrace,
|
attach_stacktrace: config.sentry_attach_stacktrace,
|
||||||
before_send: Some(Arc::new(before_send)),
|
before_send: Some(Arc::new(before_send)),
|
||||||
before_breadcrumb: Some(Arc::new(before_breadcrumb)),
|
before_breadcrumb: Some(Arc::new(before_breadcrumb)),
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
use std::{path::PathBuf, sync::Arc};
|
use std::{path::PathBuf, sync::Arc};
|
||||||
|
|
||||||
use conduwuit::{
|
use conduwuit_core::{
|
||||||
Error, Result,
|
Error, Result,
|
||||||
config::Config,
|
config::Config,
|
||||||
info,
|
info,
|
||||||
|
@ -14,7 +14,7 @@ use crate::{clap::Args, logging::TracingFlameGuard};
|
||||||
/// Server runtime state; complete
|
/// Server runtime state; complete
|
||||||
pub(crate) struct Server {
|
pub(crate) struct Server {
|
||||||
/// Server runtime state; public portion
|
/// Server runtime state; public portion
|
||||||
pub(crate) server: Arc<conduwuit::Server>,
|
pub(crate) server: Arc<conduwuit_core::Server>,
|
||||||
|
|
||||||
pub(crate) services: Mutex<Option<Arc<conduwuit_service::Services>>>,
|
pub(crate) services: Mutex<Option<Arc<conduwuit_service::Services>>>,
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ pub(crate) struct Server {
|
||||||
|
|
||||||
#[cfg(all(conduwuit_mods, feature = "conduwuit_mods"))]
|
#[cfg(all(conduwuit_mods, feature = "conduwuit_mods"))]
|
||||||
// Module instances; TODO: move to mods::loaded mgmt vector
|
// Module instances; TODO: move to mods::loaded mgmt vector
|
||||||
pub(crate) mods: tokio::sync::RwLock<Vec<conduwuit::mods::Module>>,
|
pub(crate) mods: tokio::sync::RwLock<Vec<conduwuit_core::mods::Module>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Server {
|
impl Server {
|
||||||
|
@ -66,11 +66,11 @@ impl Server {
|
||||||
database_path = ?config.database_path,
|
database_path = ?config.database_path,
|
||||||
log_levels = %config.log,
|
log_levels = %config.log,
|
||||||
"{}",
|
"{}",
|
||||||
conduwuit::version(),
|
conduwuit_core::version(),
|
||||||
);
|
);
|
||||||
|
|
||||||
Ok(Arc::new(Self {
|
Ok(Arc::new(Self {
|
||||||
server: Arc::new(conduwuit::Server::new(config, runtime.cloned(), Log {
|
server: Arc::new(conduwuit_core::Server::new(config, runtime.cloned(), Log {
|
||||||
reload: tracing_reload_handle,
|
reload: tracing_reload_handle,
|
||||||
capture,
|
capture,
|
||||||
})),
|
})),
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use conduwuit::{debug_error, trace, warn};
|
use conduwuit_core::{debug_error, trace, warn};
|
||||||
use tokio::signal;
|
use tokio::signal;
|
||||||
|
|
||||||
use super::server::Server;
|
use super::server::Server;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue