fix: reduced app size by a good margin
This commit is contained in:
@@ -4,6 +4,9 @@ edition.workspace = true
|
||||
version.workspace = true
|
||||
license.workspace = true
|
||||
|
||||
[lib]
|
||||
crate-type = ["dylib"]
|
||||
|
||||
[dependencies]
|
||||
bds-core = { workspace = true }
|
||||
bds-editor = { workspace = true }
|
||||
|
||||
9
crates/bds-server/build.rs
Normal file
9
crates/bds-server/build.rs
Normal file
@@ -0,0 +1,9 @@
|
||||
fn main() {
|
||||
// syntect and fastembed both reach onig_sys across separate Rust dylibs.
|
||||
// Keep the vendored static archive on this dylib's final native link line.
|
||||
if std::env::var("CARGO_CFG_TARGET_ENV").as_deref() == Ok("msvc") {
|
||||
println!("cargo:rustc-link-arg=onig.lib");
|
||||
} else {
|
||||
println!("cargo:rustc-link-arg=-lonig");
|
||||
}
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
use std::net::IpAddr;
|
||||
use std::path::PathBuf;
|
||||
|
||||
use bds_server::boot::BootMode;
|
||||
use clap::Parser;
|
||||
|
||||
#[derive(Debug, Parser)]
|
||||
#[command(
|
||||
name = "bds-server",
|
||||
about = "Headless RuDS engine host over authenticated SSH"
|
||||
)]
|
||||
struct Args {
|
||||
/// SSH listen address. Defaults to loopback; external access must be explicit.
|
||||
#[arg(long)]
|
||||
bind: Option<IpAddr>,
|
||||
/// SSH listen port.
|
||||
#[arg(long)]
|
||||
port: Option<u16>,
|
||||
/// Application database path.
|
||||
#[arg(long)]
|
||||
database: Option<PathBuf>,
|
||||
/// Private application data directory containing SSH key material.
|
||||
#[arg(long)]
|
||||
data_dir: Option<PathBuf>,
|
||||
}
|
||||
|
||||
fn main() -> anyhow::Result<()> {
|
||||
let args = Args::parse();
|
||||
let data_root = args
|
||||
.data_dir
|
||||
.unwrap_or_else(bds_core::util::application_data_dir);
|
||||
let database_path = args.database.unwrap_or_else(|| data_root.join("bds.db"));
|
||||
let mut config = bds_server::ServerConfig::from_environment(database_path, data_root)?;
|
||||
if let Some(bind) = args.bind {
|
||||
config.bind = bind;
|
||||
}
|
||||
if let Some(port) = args.port {
|
||||
config.port = port;
|
||||
}
|
||||
bds_server::run_headless(BootMode::Server, config)
|
||||
}
|
||||
Reference in New Issue
Block a user