From 30962b7ee56dd25ee4a32a8b17f3958731fbbdee Mon Sep 17 00:00:00 2001 From: Ryan Levick Date: Thu, 29 Aug 2024 16:56:18 +0200 Subject: [PATCH 01/13] Working generic factors Signed-off-by: Ryan Levick --- Cargo.lock | 4 + Cargo.toml | 2 + crates/factors/src/runtime_factors.rs | 6 +- crates/trigger-http/Cargo.toml | 1 + crates/trigger-http/src/lib.rs | 15 ++- crates/trigger-http/src/outbound_http.rs | 13 ++- crates/trigger-http/src/server.rs | 22 ++-- crates/trigger-http/src/spin.rs | 5 +- crates/trigger-http/src/wagi.rs | 18 +-- crates/trigger-http/src/wasi.rs | 5 +- crates/trigger-redis/Cargo.toml | 1 + crates/trigger-redis/src/lib.rs | 18 +-- crates/trigger/src/cli.rs | 128 +++++++++------------- crates/trigger/src/cli/launch_metadata.rs | 5 +- crates/trigger/src/lib.rs | 26 +++-- src/bin/spin.rs | 82 ++++++++++++-- 16 files changed, 213 insertions(+), 138 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index abb8f2bece..5e11316bb5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7129,12 +7129,14 @@ dependencies = [ "spin-common", "spin-doctor", "spin-expressions", + "spin-factors", "spin-http", "spin-loader", "spin-locked-app", "spin-manifest", "spin-oci", "spin-plugins", + "spin-runtime-config", "spin-telemetry", "spin-templates", "spin-trigger", @@ -7962,6 +7964,7 @@ dependencies = [ "spin-factor-outbound-http", "spin-factor-outbound-networking", "spin-factor-wasi", + "spin-factors", "spin-http", "spin-telemetry", "spin-trigger", @@ -7988,6 +7991,7 @@ dependencies = [ "redis 0.26.1", "serde 1.0.197", "spin-factor-variables", + "spin-factors", "spin-telemetry", "spin-trigger", "spin-world", diff --git a/Cargo.toml b/Cargo.toml index f63752f72b..cf9c4eb63e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,12 +48,14 @@ spin-build = { path = "crates/build" } spin-common = { path = "crates/common" } spin-doctor = { path = "crates/doctor" } spin-expressions = { path = "crates/expressions" } +spin-factors = { path = "crates/factors" } spin-http = { path = "crates/http" } spin-loader = { path = "crates/loader" } spin-locked-app = { path = "crates/locked-app" } spin-manifest = { path = "crates/manifest" } spin-oci = { path = "crates/oci" } spin-plugins = { path = "crates/plugins" } +spin-runtime-config = { path = "crates/runtime-config" } spin-telemetry = { path = "crates/telemetry", features = [ "tracing-log-compat", ] } diff --git a/crates/factors/src/runtime_factors.rs b/crates/factors/src/runtime_factors.rs index 5aa80c8083..51178a2467 100644 --- a/crates/factors/src/runtime_factors.rs +++ b/crates/factors/src/runtime_factors.rs @@ -30,13 +30,13 @@ use crate::{factor::FactorInstanceState, App, ConfiguredApp, Factor}; /// // Instantiate the component /// let instance = linker.instantiate_async(&mut store, &component).await?; /// ``` -pub trait RuntimeFactors: Sized + 'static { +pub trait RuntimeFactors: Send + Sync + Sized + 'static { /// The per application state of all the factors. - type AppState: Sync; + type AppState: Sync + Send; /// The per instance state of the factors. type InstanceState: RuntimeFactorsInstanceState; /// The collection of all the `InstanceBuilder`s of the factors. - type InstanceBuilders; + type InstanceBuilders: Send; /// The runtime configuration of all the factors. type RuntimeConfig: Default; diff --git a/crates/trigger-http/Cargo.toml b/crates/trigger-http/Cargo.toml index f02bea8516..77366baeae 100644 --- a/crates/trigger-http/Cargo.toml +++ b/crates/trigger-http/Cargo.toml @@ -31,6 +31,7 @@ serde = { version = "1.0", features = ["derive"] } serde_json = "1" spin-app = { path = "../app" } spin-core = { path = "../core" } +spin-factors = { path = "../factors" } spin-factor-outbound-http = { path = "../factor-outbound-http" } spin-factor-wasi = { path = "../factor-wasi" } spin-http = { path = "../http" } diff --git a/crates/trigger-http/src/lib.rs b/crates/trigger-http/src/lib.rs index 636bff940c..18e1cdef30 100644 --- a/crates/trigger-http/src/lib.rs +++ b/crates/trigger-http/src/lib.rs @@ -20,6 +20,7 @@ use anyhow::{bail, Context}; use clap::Args; use serde::Deserialize; use spin_app::App; +use spin_factors::RuntimeFactors; use spin_trigger::Trigger; use wasmtime_wasi_http::bindings::wasi::http::types::ErrorCode; @@ -29,8 +30,9 @@ pub use tls::TlsConfig; pub(crate) use wasmtime_wasi_http::body::HyperIncomingBody as Body; -pub(crate) type TriggerApp = spin_trigger::TriggerApp; -pub(crate) type TriggerInstanceBuilder<'a> = spin_trigger::TriggerInstanceBuilder<'a, HttpTrigger>; +pub(crate) type TriggerApp = spin_trigger::TriggerApp; +pub(crate) type TriggerInstanceBuilder<'a, F> = + spin_trigger::TriggerInstanceBuilder<'a, HttpTrigger, F>; #[derive(Args)] pub struct CliArgs { @@ -70,7 +72,7 @@ pub struct HttpTrigger { tls_config: Option, } -impl Trigger for HttpTrigger { +impl Trigger for HttpTrigger { const TYPE: &'static str = "http"; type CliArgs = CliArgs; @@ -80,7 +82,7 @@ impl Trigger for HttpTrigger { Self::new(app, cli_args.address, cli_args.into_tls_config()) } - async fn run(self, trigger_app: TriggerApp) -> anyhow::Result<()> { + async fn run(self, trigger_app: TriggerApp) -> anyhow::Result<()> { let server = self.into_server(trigger_app)?; server.serve().await?; @@ -109,7 +111,10 @@ impl HttpTrigger { } /// Turn this [`HttpTrigger`] into an [`HttpServer`]. - pub fn into_server(self, trigger_app: TriggerApp) -> anyhow::Result> { + pub fn into_server( + self, + trigger_app: TriggerApp, + ) -> anyhow::Result>> { let Self { listen_addr, tls_config, diff --git a/crates/trigger-http/src/outbound_http.rs b/crates/trigger-http/src/outbound_http.rs index 53912106fd..b8abe16615 100644 --- a/crates/trigger-http/src/outbound_http.rs +++ b/crates/trigger-http/src/outbound_http.rs @@ -8,25 +8,28 @@ use spin_factor_outbound_http::{ HostFutureIncomingResponse, InterceptOutcome, OutgoingRequestConfig, Request, }; use spin_factor_outbound_networking::parse_service_chaining_target; +use spin_factors::RuntimeFactors; use spin_http::routes::RouteMatch; use wasmtime_wasi_http::types::IncomingResponse; use crate::HttpServer; /// An outbound HTTP interceptor that handles service chaining requests. -pub struct OutboundHttpInterceptor { - server: Arc, +pub struct OutboundHttpInterceptor { + server: Arc>, } -impl OutboundHttpInterceptor { - pub fn new(server: Arc) -> Self { +impl OutboundHttpInterceptor { + pub fn new(server: Arc>) -> Self { Self { server } } } const CHAINED_CLIENT_ADDR: SocketAddr = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(0, 0, 0, 0)), 0); -impl spin_factor_outbound_http::OutboundHttpInterceptor for OutboundHttpInterceptor { +impl spin_factor_outbound_http::OutboundHttpInterceptor + for OutboundHttpInterceptor +{ fn intercept( &self, request: &mut Request, diff --git a/crates/trigger-http/src/server.rs b/crates/trigger-http/src/server.rs index b9ee135b77..c3ddb815ad 100644 --- a/crates/trigger-http/src/server.rs +++ b/crates/trigger-http/src/server.rs @@ -14,6 +14,7 @@ use hyper::{ use hyper_util::rt::TokioIo; use spin_app::{APP_DESCRIPTION_KEY, APP_NAME_KEY}; use spin_factor_outbound_http::SelfRequestOrigin; +use spin_factors::RuntimeFactors; use spin_http::{ app_info::AppInfo, body, @@ -40,7 +41,7 @@ use crate::{ }; /// An HTTP server which runs Spin apps. -pub struct HttpServer { +pub struct HttpServer { /// The address the server is listening on. listen_addr: SocketAddr, /// The TLS configuration for the server. @@ -48,19 +49,19 @@ pub struct HttpServer { /// Request router. router: Router, /// The app being triggered. - trigger_app: TriggerApp, + trigger_app: TriggerApp, // Component ID -> component trigger config component_trigger_configs: HashMap, // Component ID -> handler type component_handler_types: HashMap, } -impl HttpServer { +impl HttpServer { /// Create a new [`HttpServer`]. pub fn new( listen_addr: SocketAddr, tls_config: Option, - trigger_app: TriggerApp, + trigger_app: TriggerApp, ) -> anyhow::Result { // This needs to be a vec before building the router to handle duplicate routes let component_trigger_configs = Vec::from_iter( @@ -235,10 +236,11 @@ impl HttpServer { let mut instance_builder = self.trigger_app.prepare(component_id)?; // Set up outbound HTTP request origin and service chaining - let outbound_http = instance_builder.factor_builders().outbound_http(); - let origin = SelfRequestOrigin::create(server_scheme, &self.listen_addr)?; - outbound_http.set_self_request_origin(origin); - outbound_http.set_request_interceptor(OutboundHttpInterceptor::new(self.clone()))?; + // TODO: bring back once outbound networking is refactored + // let outbound_http = instance_builder.factor_builders().outbound_http(); + // let origin = SelfRequestOrigin::create(server_scheme, &self.listen_addr)?; + // outbound_http.set_self_request_origin(origin); + // outbound_http.set_request_interceptor(OutboundHttpInterceptor::new(self.clone()))?; // Prepare HTTP executor let trigger_config = self.component_trigger_configs.get(component_id).unwrap(); @@ -448,9 +450,9 @@ fn set_req_uri(req: &mut Request, scheme: Scheme) -> anyhow::Result<()> { /// An HTTP executor. pub(crate) trait HttpExecutor: Clone + Send + Sync + 'static { - fn execute( + fn execute( &self, - instance_builder: TriggerInstanceBuilder, + instance_builder: TriggerInstanceBuilder, route_match: &RouteMatch, req: Request, client_addr: SocketAddr, diff --git a/crates/trigger-http/src/spin.rs b/crates/trigger-http/src/spin.rs index 10c854b200..ce9a7cd12f 100644 --- a/crates/trigger-http/src/spin.rs +++ b/crates/trigger-http/src/spin.rs @@ -3,6 +3,7 @@ use std::net::SocketAddr; use anyhow::Result; use http_body_util::BodyExt; use hyper::{Request, Response}; +use spin_factors::RuntimeFactors; use spin_http::body; use spin_http::routes::RouteMatch; use spin_world::v1::http_types; @@ -20,9 +21,9 @@ pub struct SpinHttpExecutor; impl HttpExecutor for SpinHttpExecutor { #[instrument(name = "spin_trigger_http.execute_wasm", skip_all, err(level = Level::INFO), fields(otel.name = format!("execute_wasm_component {}", route_match.component_id())))] - async fn execute( + async fn execute( &self, - instance_builder: TriggerInstanceBuilder<'_>, + instance_builder: TriggerInstanceBuilder<'_, F>, route_match: &RouteMatch, req: Request, client_addr: SocketAddr, diff --git a/crates/trigger-http/src/wagi.rs b/crates/trigger-http/src/wagi.rs index e447e27e00..a1bc5d15c6 100644 --- a/crates/trigger-http/src/wagi.rs +++ b/crates/trigger-http/src/wagi.rs @@ -3,6 +3,7 @@ use std::{io::Cursor, net::SocketAddr}; use anyhow::{ensure, Result}; use http_body_util::BodyExt; use hyper::{Request, Response}; +use spin_factors::RuntimeFactors; use spin_http::{config::WagiTriggerConfig, routes::RouteMatch, wagi}; use tracing::{instrument, Level}; use wasmtime_wasi::pipe::MemoryOutputPipe; @@ -17,9 +18,9 @@ pub struct WagiHttpExecutor { impl HttpExecutor for WagiHttpExecutor { #[instrument(name = "spin_trigger_http.execute_wagi", skip_all, err(level = Level::INFO), fields(otel.name = format!("execute_wagi_component {}", route_match.component_id())))] - async fn execute( + async fn execute( &self, - mut instance_builder: TriggerInstanceBuilder<'_>, + mut instance_builder: TriggerInstanceBuilder<'_, F>, route_match: &RouteMatch, req: Request, client_addr: SocketAddr, @@ -73,13 +74,14 @@ impl HttpExecutor for WagiHttpExecutor { let stdout = MemoryOutputPipe::new(usize::MAX); - let wasi_builder = instance_builder.factor_builders().wasi(); + // TODO: + // let wasi_builder = instance_builder.factor_builders().wasi(); - // Set up Wagi environment - wasi_builder.args(argv.split(' ')); - wasi_builder.env(headers); - wasi_builder.stdin_pipe(Cursor::new(body)); - wasi_builder.stdout(stdout.clone()); + // // Set up Wagi environment + // wasi_builder.args(argv.split(' ')); + // wasi_builder.env(headers); + // wasi_builder.stdin_pipe(Cursor::new(body)); + // wasi_builder.stdout(stdout.clone()); let (instance, mut store) = instance_builder.instantiate(()).await?; diff --git a/crates/trigger-http/src/wasi.rs b/crates/trigger-http/src/wasi.rs index d61f3bdb21..58c4e5633a 100644 --- a/crates/trigger-http/src/wasi.rs +++ b/crates/trigger-http/src/wasi.rs @@ -6,6 +6,7 @@ use http::{HeaderName, HeaderValue}; use hyper::{Request, Response}; use spin_factor_outbound_http::wasi_2023_10_18::exports::wasi::http::incoming_handler::Guest as IncomingHandler2023_10_18; use spin_factor_outbound_http::wasi_2023_11_10::exports::wasi::http::incoming_handler::Guest as IncomingHandler2023_11_10; +use spin_factors::RuntimeFactors; use spin_http::routes::RouteMatch; use tokio::{sync::oneshot, task}; use tracing::{instrument, Instrument, Level}; @@ -25,9 +26,9 @@ pub struct WasiHttpExecutor { impl HttpExecutor for WasiHttpExecutor { #[instrument(name = "spin_trigger_http.execute_wasm", skip_all, err(level = Level::INFO), fields(otel.name = format!("execute_wasm_component {}", route_match.component_id())))] - async fn execute( + async fn execute( &self, - instance_builder: TriggerInstanceBuilder<'_>, + instance_builder: TriggerInstanceBuilder<'_, F>, route_match: &RouteMatch, mut req: Request, client_addr: SocketAddr, diff --git a/crates/trigger-redis/Cargo.toml b/crates/trigger-redis/Cargo.toml index f399afeb4d..71c5ae526b 100644 --- a/crates/trigger-redis/Cargo.toml +++ b/crates/trigger-redis/Cargo.toml @@ -13,6 +13,7 @@ async-trait = "0.1" futures = "0.3" redis = { version = "0.26.1", features = ["tokio-comp"] } serde = "1.0.188" +spin-factors = { path = "../factors" } spin-factor-variables = { path = "../factor-variables" } spin-telemetry = { path = "../telemetry" } spin-trigger = { path = "../trigger" } diff --git a/crates/trigger-redis/src/lib.rs b/crates/trigger-redis/src/lib.rs index 5932b89392..d7d3d99e30 100644 --- a/crates/trigger-redis/src/lib.rs +++ b/crates/trigger-redis/src/lib.rs @@ -5,6 +5,7 @@ use futures::{StreamExt, TryFutureExt}; use redis::{Client, Msg}; use serde::Deserialize; use spin_factor_variables::VariablesFactor; +use spin_factors::RuntimeFactors; use spin_trigger::{cli::NoCliArgs, App, Trigger, TriggerApp}; use spin_world::exports::fermyon::spin::inbound_redis; use tracing::{instrument, Level}; @@ -30,7 +31,7 @@ struct TriggerConfig { address: Option, } -impl Trigger for RedisTrigger { +impl Trigger for RedisTrigger { const TYPE: &'static str = "redis"; type CliArgs = NoCliArgs; @@ -41,15 +42,16 @@ impl Trigger for RedisTrigger { Ok(Self) } - async fn run(self, trigger_app: spin_trigger::TriggerApp) -> anyhow::Result<()> { + async fn run(self, trigger_app: spin_trigger::TriggerApp) -> anyhow::Result<()> { let app_variables = trigger_app .configured_app() .app_state::() .context("RedisTrigger depends on VariablesFactor")?; let app = trigger_app.app(); + let trigger_type = >::TYPE; let metadata = app - .get_trigger_metadata::(Self::TYPE)? + .get_trigger_metadata::(trigger_type)? .unwrap_or_default(); let default_address_expr = &metadata.address; let default_address = app_variables @@ -64,7 +66,7 @@ impl Trigger for RedisTrigger { // Resolve trigger configs before starting any subscribers for (_, config) in app - .trigger_configs::(Self::TYPE)? + .trigger_configs::(trigger_type)? .into_iter() .collect::>() { @@ -117,16 +119,16 @@ impl Trigger for RedisTrigger { type ChannelComponents = HashMap>; /// Subscribes to channels from a single Redis server. -struct Subscriber { +struct Subscriber { client: Client, - trigger_app: Arc>, + trigger_app: Arc>, channel_components: ChannelComponents, } -impl Subscriber { +impl Subscriber { fn new( address: String, - trigger_app: Arc>, + trigger_app: Arc>, channel_components: ChannelComponents, ) -> anyhow::Result { let client = Client::open(address)?; diff --git a/crates/trigger/src/cli.rs b/crates/trigger/src/cli.rs index c3defd6964..e58e656e51 100644 --- a/crates/trigger/src/cli.rs +++ b/crates/trigger/src/cli.rs @@ -12,6 +12,7 @@ use spin_common::ui::quoted_path; use spin_common::url::parse_file_url; use spin_common::{arg_parser::parse_kv, sloth}; use spin_core::async_trait; +use spin_factors::RuntimeFactors; use spin_factors_executor::{ComponentLoader, FactorsExecutor}; use spin_runtime_config::{ResolvedRuntimeConfig, UserProvidedPath}; use sqlite_statements::SqlStatementExecutorHook; @@ -39,9 +40,9 @@ pub const SPIN_WORKING_DIR: &str = "SPIN_WORKING_DIR"; #[derive(Parser, Debug)] #[clap( usage = "spin [COMMAND] [OPTIONS]", - next_help_heading = help_heading::() + next_help_heading = help_heading::() )] -pub struct FactorsTriggerCommand { +pub struct FactorsTriggerCommand, F: RuntimeFactors> { /// Log directory for the stdout and stderr of components. Setting to /// the empty string disables logging to disk. #[clap( @@ -139,9 +140,11 @@ pub struct FactorsTriggerCommand { #[derive(Args)] pub struct NoCliArgs; -impl FactorsTriggerCommand { +impl, F: RuntimeFactors> FactorsTriggerCommand { /// Create a new TriggerExecutorBuilder from this TriggerExecutorCommand. - pub async fn run(self) -> Result<()> { + pub async fn run>( + self, + ) -> Result<()> { // Handle --help-args-only if self.help_args_only { Self::command() @@ -153,7 +156,7 @@ impl FactorsTriggerCommand { // Handle --launch-metadata-only if self.launch_metadata_only { - let lm = LaunchMetadata::infer::(); + let lm = LaunchMetadata::infer::(); let json = serde_json::to_string_pretty(&lm)?; eprintln!("{json}"); return Ok(()); @@ -182,7 +185,8 @@ impl FactorsTriggerCommand { } let trigger = T::new(self.trigger_args, &app)?; - let mut builder = TriggerAppBuilder::new(trigger, PathBuf::from(working_dir)); + let mut builder: TriggerAppBuilder = + TriggerAppBuilder::new(trigger, PathBuf::from(working_dir)); let config = builder.engine_config(); // Apply --cache / --disable-cache @@ -198,9 +202,9 @@ impl FactorsTriggerCommand { .run( app, TriggerAppOptions { - runtime_config_file: self.runtime_config_file.as_deref(), - state_dir: self.state_dir.as_deref(), - local_app_dir: local_app_dir.as_deref(), + runtime_config_file: self.runtime_config_file.clone(), + state_dir: self.state_dir.clone(), + local_app_dir: local_app_dir.clone(), initial_key_values: self.key_values, sqlite_statements: self.sqlite_statements, allow_transient_write: self.allow_transient_write, @@ -254,8 +258,8 @@ fn warn_if_wasm_build_slothful() -> sloth::SlothGuard { sloth::warn_if_slothful(SLOTH_WARNING_DELAY_MILLIS, format!("{message}\n")) } -fn help_heading() -> Option<&'static str> { - if T::TYPE == help::HelpArgsOnlyTrigger::TYPE { +fn help_heading, F: RuntimeFactors>() -> Option<&'static str> { + if T::TYPE == >::TYPE { Some("TRIGGER OPTIONS") } else { let heading = format!("{} TRIGGER OPTIONS", T::TYPE.to_uppercase()); @@ -265,39 +269,41 @@ fn help_heading() -> Option<&'static str> { } /// A builder for a [`TriggerApp`]. -pub struct TriggerAppBuilder { +pub struct TriggerAppBuilder { engine_config: spin_core::Config, working_dir: PathBuf, pub trigger: T, + _factors: std::marker::PhantomData, } /// Options for building a [`TriggerApp`]. #[derive(Default)] -pub struct TriggerAppOptions<'a> { +pub struct TriggerAppOptions { /// Path to the runtime config file. - runtime_config_file: Option<&'a Path>, + pub runtime_config_file: Option, /// Path to the state directory. - state_dir: Option<&'a str>, + pub state_dir: Option, /// Path to the local app directory. - local_app_dir: Option<&'a str>, + pub local_app_dir: Option, /// Initial key/value pairs to set in the app's default store. - initial_key_values: Vec<(String, String)>, + pub initial_key_values: Vec<(String, String)>, /// SQLite statements to run. - sqlite_statements: Vec, + pub sqlite_statements: Vec, /// Whether to allow transient writes to mounted files - allow_transient_write: bool, + pub allow_transient_write: bool, /// Which components should have their logs followed. - follow_components: FollowComponents, + pub follow_components: FollowComponents, /// Log directory for component stdout/stderr. - log_dir: Option, + pub log_dir: Option, } -impl TriggerAppBuilder { +impl, F: RuntimeFactorsBuilder> TriggerAppBuilder { pub fn new(trigger: T, working_dir: PathBuf) -> Self { Self { engine_config: spin_core::Config::default(), working_dir, trigger, + _factors: Default::default(), } } @@ -309,8 +315,8 @@ impl TriggerAppBuilder { pub async fn build( &mut self, app: App, - options: TriggerAppOptions<'_>, - ) -> anyhow::Result> { + options: F::Options, + ) -> anyhow::Result> { let mut core_engine_builder = { self.trigger.update_core_config(&mut self.engine_config)?; @@ -318,47 +324,7 @@ impl TriggerAppBuilder { }; self.trigger.add_to_linker(core_engine_builder.linker())?; - let runtime_config_path = options.runtime_config_file; - let local_app_dir = options.local_app_dir.map(PathBuf::from); - let state_dir = match options.state_dir { - // Make sure `--state-dir=""` unsets the state dir - Some("") => UserProvidedPath::Unset, - Some(s) => UserProvidedPath::Provided(PathBuf::from(s)), - None => UserProvidedPath::Default, - }; - let log_dir = match &options.log_dir { - // Make sure `--log-dir=""` unsets the log dir - Some(p) if p.as_os_str().is_empty() => UserProvidedPath::Unset, - Some(p) => UserProvidedPath::Provided(p.clone()), - None => UserProvidedPath::Default, - }; - // Hardcode `use_gpu` to true for now - let use_gpu = true; - let runtime_config = - ResolvedRuntimeConfig::::from_optional_file( - runtime_config_path, - local_app_dir, - state_dir, - log_dir, - use_gpu, - )?; - - summarize_runtime_config(&runtime_config, runtime_config_path); - - runtime_config - .set_initial_key_values(&options.initial_key_values) - .await?; - - let log_dir = runtime_config.log_dir(); - let factors = TriggerFactors::new( - runtime_config.state_dir(), - self.working_dir.clone(), - options.allow_transient_write, - runtime_config.key_value_resolver, - runtime_config.sqlite_resolver, - use_gpu, - ) - .context("failed to create factors")?; + let (factors, runtime_config) = F::new().build(self.working_dir.clone(), options)?; // TODO: port the rest of the component loader logic struct SimpleComponentLoader; @@ -432,7 +398,7 @@ impl TriggerAppBuilder { let configured_app = { let _sloth_guard = warn_if_wasm_build_slothful(); executor - .load_app(app, runtime_config.runtime_config, SimpleComponentLoader) + .load_app(app, runtime_config, SimpleComponentLoader) .await? }; @@ -443,13 +409,31 @@ impl TriggerAppBuilder { pub async fn run( mut self, app: App, - options: TriggerAppOptions<'_>, + options: F::Options, ) -> anyhow::Result>> { let configured_app = self.build(app, options).await?; Ok(self.trigger.run(configured_app)) } } +pub trait RuntimeFactorsBuilder { + type Options; + type Factors: RuntimeFactors; + + fn new() -> Self + where + Self: Sized; + + fn build( + self, + working_dir: PathBuf, + options: Self::Options, + ) -> anyhow::Result<( + Self::Factors, + ::RuntimeConfig, + )>; +} + pub mod help { use super::*; @@ -457,7 +441,7 @@ pub mod help { /// a `spin.toml` file. pub struct HelpArgsOnlyTrigger; - impl Trigger for HelpArgsOnlyTrigger { + impl Trigger for HelpArgsOnlyTrigger { const TYPE: &'static str = "help-args-only"; type CliArgs = NoCliArgs; type InstanceState = (); @@ -466,13 +450,7 @@ pub mod help { Ok(Self) } - async fn run( - self, - _configured_app: spin_factors_executor::FactorsExecutorApp< - TriggerFactors, - Self::InstanceState, - >, - ) -> anyhow::Result<()> { + async fn run(self, _configured_app: TriggerApp) -> anyhow::Result<()> { Ok(()) } } diff --git a/crates/trigger/src/cli/launch_metadata.rs b/crates/trigger/src/cli/launch_metadata.rs index be78e3634d..fdae19a705 100644 --- a/crates/trigger/src/cli/launch_metadata.rs +++ b/crates/trigger/src/cli/launch_metadata.rs @@ -1,5 +1,6 @@ use clap::CommandFactory; use serde::{Deserialize, Serialize}; +use spin_factors::RuntimeFactors; use std::ffi::OsString; use crate::{cli::FactorsTriggerCommand, Trigger}; @@ -27,8 +28,8 @@ struct LaunchFlag { } impl LaunchMetadata { - pub fn infer() -> Self { - let all_flags: Vec<_> = FactorsTriggerCommand::::command() + pub fn infer, F: RuntimeFactors>() -> Self { + let all_flags: Vec<_> = FactorsTriggerCommand::::command() .get_arguments() .map(LaunchFlag::infer) .collect(); diff --git a/crates/trigger/src/lib.rs b/crates/trigger/src/lib.rs index b5f1fd3376..8427a0a5db 100644 --- a/crates/trigger/src/lib.rs +++ b/crates/trigger/src/lib.rs @@ -5,26 +5,27 @@ mod stdio; use std::future::Future; use clap::Args; -use factors::{TriggerFactors, TriggerFactorsInstanceState}; use spin_core::Linker; +use spin_factors::RuntimeFactors; use spin_factors_executor::{FactorsExecutorApp, FactorsInstanceBuilder}; +pub use factors::*; pub use spin_app::App; /// Type alias for a [`FactorsExecutorApp`] specialized to a [`Trigger`]. -pub type TriggerApp = FactorsExecutorApp::InstanceState>; +pub type TriggerApp = FactorsExecutorApp>::InstanceState>; -pub type TriggerInstanceBuilder<'a, T> = - FactorsInstanceBuilder<'a, TriggerFactors, ::InstanceState>; +pub type TriggerInstanceBuilder<'a, T, F> = + FactorsInstanceBuilder<'a, F, >::InstanceState>; -pub type Store = spin_core::Store>; +pub type Store = spin_core::Store>; -type TriggerInstanceState = spin_factors_executor::InstanceState< - TriggerFactorsInstanceState, - ::InstanceState, +type TriggerInstanceState = spin_factors_executor::InstanceState< + ::InstanceState, + >::InstanceState, >; -pub trait Trigger: Sized + Send { +pub trait Trigger: Sized + Send { const TYPE: &'static str; type CliArgs: Args; @@ -46,14 +47,17 @@ pub trait Trigger: Sized + Send { /// Update the [`Linker`] for this trigger. fn add_to_linker( &mut self, - linker: &mut Linker>, + linker: &mut Linker>, ) -> anyhow::Result<()> { let _ = linker; Ok(()) } /// Run this trigger. - fn run(self, trigger_app: TriggerApp) -> impl Future> + Send; + fn run( + self, + trigger_app: TriggerApp, + ) -> impl Future> + Send; /// Returns a list of host requirements supported by this trigger specifically. /// diff --git a/src/bin/spin.rs b/src/bin/spin.rs index ce5c83671b..13798e9f21 100644 --- a/src/bin/spin.rs +++ b/src/bin/spin.rs @@ -1,3 +1,5 @@ +use std::path::PathBuf; + use anyhow::{Context, Error}; use clap::{CommandFactory, FromArgMatches, Parser, Subcommand}; use lazy_static::lazy_static; @@ -15,8 +17,10 @@ use spin_cli::commands::{ watch::WatchCommand, }; use spin_cli::{build_info::*, subprocess::ExitStatusError}; +use spin_runtime_config::{ResolvedRuntimeConfig, UserProvidedPath}; use spin_trigger::cli::help::HelpArgsOnlyTrigger; -use spin_trigger::cli::FactorsTriggerCommand; +use spin_trigger::cli::{FactorsTriggerCommand, RuntimeFactorsBuilder, TriggerAppOptions}; +use spin_trigger::{TriggerFactors, TriggerFactorsRuntimeConfig}; use spin_trigger_http::HttpTrigger; use spin_trigger_redis::RedisTrigger; @@ -139,10 +143,10 @@ enum SpinApp { #[derive(Subcommand)] enum TriggerCommands { - Http(FactorsTriggerCommand), - Redis(FactorsTriggerCommand), + Http(FactorsTriggerCommand), + Redis(FactorsTriggerCommand), #[clap(name = spin_cli::HELP_ARGS_ONLY_TRIGGER_TYPE, hide = true)] - HelpArgsOnly(FactorsTriggerCommand), + HelpArgsOnly(FactorsTriggerCommand), } impl SpinApp { @@ -157,9 +161,9 @@ impl SpinApp { Self::Login(cmd) => cmd.run(SpinApp::command()).await, Self::Registry(cmd) => cmd.run().await, Self::Build(cmd) => cmd.run().await, - Self::Trigger(TriggerCommands::Http(cmd)) => cmd.run().await, - Self::Trigger(TriggerCommands::Redis(cmd)) => cmd.run().await, - Self::Trigger(TriggerCommands::HelpArgsOnly(cmd)) => cmd.run().await, + Self::Trigger(TriggerCommands::Http(cmd)) => cmd.run::().await, + Self::Trigger(TriggerCommands::Redis(cmd)) => cmd.run::().await, + Self::Trigger(TriggerCommands::HelpArgsOnly(cmd)) => cmd.run::().await, Self::Plugins(cmd) => cmd.run().await, Self::External(cmd) => execute_external_subcommand(cmd, app).await, Self::Watch(cmd) => cmd.run().await, @@ -168,6 +172,70 @@ impl SpinApp { } } +struct Builder; + +impl RuntimeFactorsBuilder for Builder { + type Options = TriggerAppOptions; + type Factors = TriggerFactors; + + fn new() -> Self + where + Self: Sized, + { + Builder + } + + fn build( + self, + working_dir: PathBuf, + options: Self::Options, + ) -> anyhow::Result<( + Self::Factors, + ::RuntimeConfig, + )> { + let runtime_config_path = options.runtime_config_file; + let local_app_dir = options.local_app_dir.map(PathBuf::from); + let state_dir = match options.state_dir { + // Make sure `--state-dir=""` unsets the state dir + Some(s) if s.is_empty() => UserProvidedPath::Unset, + Some(s) => UserProvidedPath::Provided(PathBuf::from(s)), + None => UserProvidedPath::Default, + }; + let log_dir = match &options.log_dir { + // Make sure `--log-dir=""` unsets the log dir + Some(p) if p.as_os_str().is_empty() => UserProvidedPath::Unset, + Some(p) => UserProvidedPath::Provided(p.clone()), + None => UserProvidedPath::Default, + }; + // Hardcode `use_gpu` to true for now + let use_gpu = true; + let runtime_config = + ResolvedRuntimeConfig::::from_optional_file( + runtime_config_path.as_deref(), + local_app_dir, + state_dir, + log_dir, + use_gpu, + )?; + + // runtime_config + // .set_initial_key_values(&options.initial_key_values) + // .await?; + + let log_dir = runtime_config.log_dir(); + let factors = TriggerFactors::new( + runtime_config.state_dir(), + working_dir, + options.allow_transient_write, + runtime_config.key_value_resolver, + runtime_config.sqlite_resolver, + use_gpu, + ) + .context("failed to create factors")?; + Ok((factors, runtime_config.runtime_config)) + } +} + /// Returns build information, similar to: 0.1.0 (2be4034 2022-03-31). fn build_info() -> String { format!("{SPIN_VERSION} ({SPIN_COMMIT_SHA} {SPIN_COMMIT_DATE})") From cc81c126bb47e306776f7233851ab3c8fd322436 Mon Sep 17 00:00:00 2001 From: Ryan Levick Date: Thu, 29 Aug 2024 17:08:08 +0200 Subject: [PATCH 02/13] Separate common trigger options from Factors specific ones. Signed-off-by: Ryan Levick --- crates/trigger/src/cli.rs | 124 +++++++++------------- crates/trigger/src/cli/launch_metadata.rs | 7 +- crates/trigger/src/factors.rs | 20 ++++ src/bin/spin.rs | 36 +++---- 4 files changed, 88 insertions(+), 99 deletions(-) diff --git a/crates/trigger/src/cli.rs b/crates/trigger/src/cli.rs index e58e656e51..cc06a6d826 100644 --- a/crates/trigger/src/cli.rs +++ b/crates/trigger/src/cli.rs @@ -3,14 +3,14 @@ mod sqlite_statements; mod summary; use std::future::Future; -use std::path::{Path, PathBuf}; +use std::path::PathBuf; use anyhow::{Context, Result}; use clap::{Args, IntoApp, Parser}; use spin_app::App; +use spin_common::sloth; use spin_common::ui::quoted_path; use spin_common::url::parse_file_url; -use spin_common::{arg_parser::parse_kv, sloth}; use spin_core::async_trait; use spin_factors::RuntimeFactors; use spin_factors_executor::{ComponentLoader, FactorsExecutor}; @@ -20,7 +20,6 @@ use summary::{ summarize_runtime_config, KeyValueDefaultStoreSummaryHook, SqliteDefaultStoreSummaryHook, }; -use crate::factors::{TriggerFactors, TriggerFactorsRuntimeConfig}; use crate::stdio::{FollowComponents, StdioLoggingExecutorHooks}; use crate::{Trigger, TriggerApp}; pub use launch_metadata::LaunchMetadata; @@ -40,9 +39,9 @@ pub const SPIN_WORKING_DIR: &str = "SPIN_WORKING_DIR"; #[derive(Parser, Debug)] #[clap( usage = "spin [COMMAND] [OPTIONS]", - next_help_heading = help_heading::() + next_help_heading = help_heading::() )] -pub struct FactorsTriggerCommand, F: RuntimeFactors> { +pub struct FactorsTriggerCommand, B: RuntimeFactorsBuilder> { /// Log directory for the stdout and stderr of components. Setting to /// the empty string disables logging to disk. #[clap( @@ -117,16 +116,8 @@ pub struct FactorsTriggerCommand, F: RuntimeFactors> { #[clap(flatten)] pub trigger_args: T::CliArgs, - /// Set a key/value pair (key=value) in the application's - /// default store. Any existing value will be overwritten. - /// Can be used multiple times. - #[clap(long = "key-value", parse(try_from_str = parse_kv))] - key_values: Vec<(String, String)>, - - /// Run a SQLite statement such as a migration against the default database. - /// To run from a file, prefix the filename with @ e.g. spin up --sqlite @migration.sql - #[clap(long = "sqlite")] - sqlite_statements: Vec, + #[clap(flatten)] + pub builder_args: B::Options, #[clap(long = "help-args-only", hide = true)] pub help_args_only: bool, @@ -135,16 +126,33 @@ pub struct FactorsTriggerCommand, F: RuntimeFactors> { pub launch_metadata_only: bool, } +/// Configuration options that are common to all triggers. +#[derive(Debug)] +pub struct CommonTriggerOptions { + /// The Spin working directory. + pub working_dir: PathBuf, + /// Path to the runtime config file. + pub runtime_config_file: Option, + /// Path to the state directory. + pub state_dir: Option, + /// Path to the local app directory. + pub local_app_dir: Option, + /// Whether to allow transient writes to mounted files + pub allow_transient_write: bool, + /// Which components should have their logs followed. + pub follow_components: FollowComponents, + /// Log directory for component stdout/stderr. + pub log_dir: Option, +} + /// An empty implementation of clap::Args to be used as TriggerExecutor::RunConfig /// for executors that do not need additional CLI args. #[derive(Args)] pub struct NoCliArgs; -impl, F: RuntimeFactors> FactorsTriggerCommand { +impl, B: RuntimeFactorsBuilder> FactorsTriggerCommand { /// Create a new TriggerExecutorBuilder from this TriggerExecutorCommand. - pub async fn run>( - self, - ) -> Result<()> { + pub async fn run(self) -> Result<()> { // Handle --help-args-only if self.help_args_only { Self::command() @@ -156,7 +164,7 @@ impl, F: RuntimeFactors> FactorsTriggerCommand { // Handle --launch-metadata-only if self.launch_metadata_only { - let lm = LaunchMetadata::infer::(); + let lm = LaunchMetadata::infer::(); let json = serde_json::to_string_pretty(&lm)?; eprintln!("{json}"); return Ok(()); @@ -185,8 +193,7 @@ impl, F: RuntimeFactors> FactorsTriggerCommand { } let trigger = T::new(self.trigger_args, &app)?; - let mut builder: TriggerAppBuilder = - TriggerAppBuilder::new(trigger, PathBuf::from(working_dir)); + let mut builder: TriggerAppBuilder = TriggerAppBuilder::new(trigger); let config = builder.engine_config(); // Apply --cache / --disable-cache @@ -198,21 +205,16 @@ impl, F: RuntimeFactors> FactorsTriggerCommand { config.disable_pooling(); } - let run_fut = builder - .run( - app, - TriggerAppOptions { - runtime_config_file: self.runtime_config_file.clone(), - state_dir: self.state_dir.clone(), - local_app_dir: local_app_dir.clone(), - initial_key_values: self.key_values, - sqlite_statements: self.sqlite_statements, - allow_transient_write: self.allow_transient_write, - follow_components, - log_dir: self.log, - }, - ) - .await?; + let common_options = CommonTriggerOptions { + working_dir: PathBuf::from(working_dir), + runtime_config_file: self.runtime_config_file.clone(), + state_dir: self.state_dir.clone(), + local_app_dir: local_app_dir.clone(), + allow_transient_write: self.allow_transient_write, + follow_components, + log_dir: self.log, + }; + let run_fut = builder.run(app, common_options, self.builder_args).await?; let (abortable, abort_handle) = futures::future::abortable(run_fut); ctrlc::set_handler(move || abort_handle.abort())?; @@ -271,37 +273,14 @@ fn help_heading, F: RuntimeFactors>() -> Option<&'static str> { /// A builder for a [`TriggerApp`]. pub struct TriggerAppBuilder { engine_config: spin_core::Config, - working_dir: PathBuf, pub trigger: T, _factors: std::marker::PhantomData, } -/// Options for building a [`TriggerApp`]. -#[derive(Default)] -pub struct TriggerAppOptions { - /// Path to the runtime config file. - pub runtime_config_file: Option, - /// Path to the state directory. - pub state_dir: Option, - /// Path to the local app directory. - pub local_app_dir: Option, - /// Initial key/value pairs to set in the app's default store. - pub initial_key_values: Vec<(String, String)>, - /// SQLite statements to run. - pub sqlite_statements: Vec, - /// Whether to allow transient writes to mounted files - pub allow_transient_write: bool, - /// Which components should have their logs followed. - pub follow_components: FollowComponents, - /// Log directory for component stdout/stderr. - pub log_dir: Option, -} - -impl, F: RuntimeFactorsBuilder> TriggerAppBuilder { - pub fn new(trigger: T, working_dir: PathBuf) -> Self { +impl, B: RuntimeFactorsBuilder> TriggerAppBuilder { + pub fn new(trigger: T) -> Self { Self { engine_config: spin_core::Config::default(), - working_dir, trigger, _factors: Default::default(), } @@ -315,8 +294,9 @@ impl, F: RuntimeFactorsBuilder> TriggerAppBuilder { pub async fn build( &mut self, app: App, - options: F::Options, - ) -> anyhow::Result> { + common_options: CommonTriggerOptions, + options: B::Options, + ) -> anyhow::Result> { let mut core_engine_builder = { self.trigger.update_core_config(&mut self.engine_config)?; @@ -324,7 +304,7 @@ impl, F: RuntimeFactorsBuilder> TriggerAppBuilder { }; self.trigger.add_to_linker(core_engine_builder.linker())?; - let (factors, runtime_config) = F::new().build(self.working_dir.clone(), options)?; + let (factors, runtime_config) = B::build(common_options, options)?; // TODO: port the rest of the component loader logic struct SimpleComponentLoader; @@ -409,24 +389,20 @@ impl, F: RuntimeFactorsBuilder> TriggerAppBuilder { pub async fn run( mut self, app: App, - options: F::Options, + common_options: CommonTriggerOptions, + options: B::Options, ) -> anyhow::Result>> { - let configured_app = self.build(app, options).await?; + let configured_app = self.build(app, common_options, options).await?; Ok(self.trigger.run(configured_app)) } } pub trait RuntimeFactorsBuilder { - type Options; + type Options: clap::Args; type Factors: RuntimeFactors; - fn new() -> Self - where - Self: Sized; - fn build( - self, - working_dir: PathBuf, + common_options: CommonTriggerOptions, options: Self::Options, ) -> anyhow::Result<( Self::Factors, diff --git a/crates/trigger/src/cli/launch_metadata.rs b/crates/trigger/src/cli/launch_metadata.rs index fdae19a705..cbcab49f90 100644 --- a/crates/trigger/src/cli/launch_metadata.rs +++ b/crates/trigger/src/cli/launch_metadata.rs @@ -1,10 +1,11 @@ use clap::CommandFactory; use serde::{Deserialize, Serialize}; -use spin_factors::RuntimeFactors; use std::ffi::OsString; use crate::{cli::FactorsTriggerCommand, Trigger}; +use super::RuntimeFactorsBuilder; + /// Contains information about the trigger flags (and potentially /// in future configuration) that a consumer (such as `spin up`) /// can query using `--launch-metadata-only`. @@ -28,8 +29,8 @@ struct LaunchFlag { } impl LaunchMetadata { - pub fn infer, F: RuntimeFactors>() -> Self { - let all_flags: Vec<_> = FactorsTriggerCommand::::command() + pub fn infer, B: RuntimeFactorsBuilder>() -> Self { + let all_flags: Vec<_> = FactorsTriggerCommand::::command() .get_arguments() .map(LaunchFlag::infer) .collect(); diff --git a/crates/trigger/src/factors.rs b/crates/trigger/src/factors.rs index 3a1b0993a9..b833f497c2 100644 --- a/crates/trigger/src/factors.rs +++ b/crates/trigger/src/factors.rs @@ -1,6 +1,7 @@ use std::path::PathBuf; use anyhow::Context as _; +use spin_common::arg_parser::parse_kv; use spin_factor_key_value::KeyValueFactor; use spin_factor_llm::LlmFactor; use spin_factor_outbound_http::OutboundHttpFactor; @@ -88,3 +89,22 @@ impl TryFrom> for TriggerFactorsRuntimeConfig { Self::from_source(value) } } + +/// Options for building a [`TriggerFactors`]. +#[derive(Default, clap::Args)] +pub struct TriggerAppOptions { + /// Set the static assets of the components in the temporary directory as writable. + #[clap(long = "allow-transient-write")] + pub allow_transient_write: bool, + + /// Set a key/value pair (key=value) in the application's + /// default store. Any existing value will be overwritten. + /// Can be used multiple times. + #[clap(long = "key-value", parse(try_from_str = parse_kv))] + key_values: Vec<(String, String)>, + + /// Run a SQLite statement such as a migration against the default database. + /// To run from a file, prefix the filename with @ e.g. spin up --sqlite @migration.sql + #[clap(long = "sqlite")] + sqlite_statements: Vec, +} diff --git a/src/bin/spin.rs b/src/bin/spin.rs index 13798e9f21..aac246fbf6 100644 --- a/src/bin/spin.rs +++ b/src/bin/spin.rs @@ -19,8 +19,8 @@ use spin_cli::commands::{ use spin_cli::{build_info::*, subprocess::ExitStatusError}; use spin_runtime_config::{ResolvedRuntimeConfig, UserProvidedPath}; use spin_trigger::cli::help::HelpArgsOnlyTrigger; -use spin_trigger::cli::{FactorsTriggerCommand, RuntimeFactorsBuilder, TriggerAppOptions}; -use spin_trigger::{TriggerFactors, TriggerFactorsRuntimeConfig}; +use spin_trigger::cli::{CommonTriggerOptions, FactorsTriggerCommand, RuntimeFactorsBuilder}; +use spin_trigger::{TriggerAppOptions, TriggerFactors, TriggerFactorsRuntimeConfig}; use spin_trigger_http::HttpTrigger; use spin_trigger_redis::RedisTrigger; @@ -143,10 +143,10 @@ enum SpinApp { #[derive(Subcommand)] enum TriggerCommands { - Http(FactorsTriggerCommand), - Redis(FactorsTriggerCommand), + Http(FactorsTriggerCommand), + Redis(FactorsTriggerCommand), #[clap(name = spin_cli::HELP_ARGS_ONLY_TRIGGER_TYPE, hide = true)] - HelpArgsOnly(FactorsTriggerCommand), + HelpArgsOnly(FactorsTriggerCommand), } impl SpinApp { @@ -161,9 +161,9 @@ impl SpinApp { Self::Login(cmd) => cmd.run(SpinApp::command()).await, Self::Registry(cmd) => cmd.run().await, Self::Build(cmd) => cmd.run().await, - Self::Trigger(TriggerCommands::Http(cmd)) => cmd.run::().await, - Self::Trigger(TriggerCommands::Redis(cmd)) => cmd.run::().await, - Self::Trigger(TriggerCommands::HelpArgsOnly(cmd)) => cmd.run::().await, + Self::Trigger(TriggerCommands::Http(cmd)) => cmd.run().await, + Self::Trigger(TriggerCommands::Redis(cmd)) => cmd.run().await, + Self::Trigger(TriggerCommands::HelpArgsOnly(cmd)) => cmd.run().await, Self::Plugins(cmd) => cmd.run().await, Self::External(cmd) => execute_external_subcommand(cmd, app).await, Self::Watch(cmd) => cmd.run().await, @@ -178,30 +178,22 @@ impl RuntimeFactorsBuilder for Builder { type Options = TriggerAppOptions; type Factors = TriggerFactors; - fn new() -> Self - where - Self: Sized, - { - Builder - } - fn build( - self, - working_dir: PathBuf, + common_options: CommonTriggerOptions, options: Self::Options, ) -> anyhow::Result<( Self::Factors, ::RuntimeConfig, )> { - let runtime_config_path = options.runtime_config_file; - let local_app_dir = options.local_app_dir.map(PathBuf::from); - let state_dir = match options.state_dir { + let runtime_config_path = common_options.runtime_config_file; + let local_app_dir = common_options.local_app_dir.map(PathBuf::from); + let state_dir = match common_options.state_dir { // Make sure `--state-dir=""` unsets the state dir Some(s) if s.is_empty() => UserProvidedPath::Unset, Some(s) => UserProvidedPath::Provided(PathBuf::from(s)), None => UserProvidedPath::Default, }; - let log_dir = match &options.log_dir { + let log_dir = match &common_options.log_dir { // Make sure `--log-dir=""` unsets the log dir Some(p) if p.as_os_str().is_empty() => UserProvidedPath::Unset, Some(p) => UserProvidedPath::Provided(p.clone()), @@ -225,7 +217,7 @@ impl RuntimeFactorsBuilder for Builder { let log_dir = runtime_config.log_dir(); let factors = TriggerFactors::new( runtime_config.state_dir(), - working_dir, + common_options.working_dir, options.allow_transient_write, runtime_config.key_value_resolver, runtime_config.sqlite_resolver, From 98027a21175cf3e3d3cf4ab009e22bbda08866eb Mon Sep 17 00:00:00 2001 From: Ryan Levick Date: Thu, 29 Aug 2024 18:13:26 +0200 Subject: [PATCH 03/13] Move where user defined paths are defined Signed-off-by: Ryan Levick --- Cargo.lock | 2 +- crates/runtime-config/Cargo.toml | 1 + crates/runtime-config/src/lib.rs | 16 +++++++--------- crates/trigger/Cargo.toml | 1 - crates/trigger/src/cli.rs | 32 +++++++++++++++++++++++++++----- crates/trigger/src/factors.rs | 9 --------- src/bin/spin.rs | 18 +++--------------- 7 files changed, 39 insertions(+), 40 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5e11316bb5..b7acc095c3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7787,6 +7787,7 @@ dependencies = [ "spin-key-value-redis", "spin-key-value-spin", "spin-sqlite", + "spin-trigger", "toml 0.8.14", ] @@ -7929,7 +7930,6 @@ dependencies = [ "spin-factor-wasi", "spin-factors", "spin-factors-executor", - "spin-runtime-config", "spin-telemetry", "spin-world", "tempfile", diff --git a/crates/runtime-config/Cargo.toml b/crates/runtime-config/Cargo.toml index eacfb2c593..343a32abf8 100644 --- a/crates/runtime-config/Cargo.toml +++ b/crates/runtime-config/Cargo.toml @@ -26,6 +26,7 @@ spin-factor-variables = { path = "../factor-variables" } spin-factor-wasi = { path = "../factor-wasi" } spin-factors = { path = "../factors" } spin-sqlite = { path = "../sqlite" } +spin-trigger = { path = "../trigger" } toml = "0.8" [lints] diff --git a/crates/runtime-config/src/lib.rs b/crates/runtime-config/src/lib.rs index 9967ed491f..3208d45fbc 100644 --- a/crates/runtime-config/src/lib.rs +++ b/crates/runtime-config/src/lib.rs @@ -20,6 +20,7 @@ use spin_factors::{ }; use spin_key_value_spin::{SpinKeyValueRuntimeConfig, SpinKeyValueStore}; use spin_sqlite as sqlite; +use spin_trigger::cli::UserProvidedPath; /// The default state directory for the trigger. pub const DEFAULT_STATE_DIR: &str = ".spin"; @@ -453,13 +454,10 @@ fn sqlite_config_resolver( )) } -/// A user provided option which be either be provided, default, or explicitly none. -#[derive(Clone, Debug)] -pub enum UserProvidedPath { - /// Use the explicitly provided directory. - Provided(PathBuf), - /// Use the default. - Default, - /// Explicitly unset. - Unset, +impl TryFrom> for spin_trigger::TriggerFactorsRuntimeConfig { + type Error = anyhow::Error; + + fn try_from(value: TomlRuntimeConfigSource<'_, '_>) -> Result { + Self::from_source(value) + } } diff --git a/crates/trigger/Cargo.toml b/crates/trigger/Cargo.toml index 66fb9a7646..de45bf2b25 100644 --- a/crates/trigger/Cargo.toml +++ b/crates/trigger/Cargo.toml @@ -39,7 +39,6 @@ spin-factor-variables = { path = "../factor-variables" } spin-factor-wasi = { path = "../factor-wasi" } spin-factors = { path = "../factors" } spin-factors-executor = { path = "../factors-executor" } -spin-runtime-config = { path = "../runtime-config" } spin-telemetry = { path = "../telemetry" } terminal = { path = "../terminal" } tokio = { version = "1.23", features = ["fs", "rt"] } diff --git a/crates/trigger/src/cli.rs b/crates/trigger/src/cli.rs index cc06a6d826..f9273a26b3 100644 --- a/crates/trigger/src/cli.rs +++ b/crates/trigger/src/cli.rs @@ -14,7 +14,6 @@ use spin_common::url::parse_file_url; use spin_core::async_trait; use spin_factors::RuntimeFactors; use spin_factors_executor::{ComponentLoader, FactorsExecutor}; -use spin_runtime_config::{ResolvedRuntimeConfig, UserProvidedPath}; use sqlite_statements::SqlStatementExecutorHook; use summary::{ summarize_runtime_config, KeyValueDefaultStoreSummaryHook, SqliteDefaultStoreSummaryHook, @@ -134,7 +133,7 @@ pub struct CommonTriggerOptions { /// Path to the runtime config file. pub runtime_config_file: Option, /// Path to the state directory. - pub state_dir: Option, + pub state_dir: UserProvidedPath, /// Path to the local app directory. pub local_app_dir: Option, /// Whether to allow transient writes to mounted files @@ -142,7 +141,7 @@ pub struct CommonTriggerOptions { /// Which components should have their logs followed. pub follow_components: FollowComponents, /// Log directory for component stdout/stderr. - pub log_dir: Option, + pub log_dir: UserProvidedPath, } /// An empty implementation of clap::Args to be used as TriggerExecutor::RunConfig @@ -205,14 +204,26 @@ impl, B: RuntimeFactorsBuilder> FactorsTriggerCommand UserProvidedPath::Unset, + Some(s) => UserProvidedPath::Provided(PathBuf::from(s)), + None => UserProvidedPath::Default, + }; + let log_dir = match &self.log { + // Make sure `--log-dir=""` unsets the log dir + Some(p) if p.as_os_str().is_empty() => UserProvidedPath::Unset, + Some(p) => UserProvidedPath::Provided(p.clone()), + None => UserProvidedPath::Default, + }; let common_options = CommonTriggerOptions { working_dir: PathBuf::from(working_dir), runtime_config_file: self.runtime_config_file.clone(), - state_dir: self.state_dir.clone(), + state_dir, local_app_dir: local_app_dir.clone(), allow_transient_write: self.allow_transient_write, follow_components, - log_dir: self.log, + log_dir, }; let run_fut = builder.run(app, common_options, self.builder_args).await?; @@ -431,3 +442,14 @@ pub mod help { } } } + +/// A user provided option which be either be provided, default, or explicitly none. +#[derive(Clone, Debug)] +pub enum UserProvidedPath { + /// Use the explicitly provided directory. + Provided(PathBuf), + /// Use the default. + Default, + /// Explicitly unset. + Unset, +} diff --git a/crates/trigger/src/factors.rs b/crates/trigger/src/factors.rs index b833f497c2..b9a22fe58e 100644 --- a/crates/trigger/src/factors.rs +++ b/crates/trigger/src/factors.rs @@ -14,7 +14,6 @@ use spin_factor_sqlite::SqliteFactor; use spin_factor_variables::VariablesFactor; use spin_factor_wasi::{spin::SpinFilesMounter, WasiFactor}; use spin_factors::RuntimeFactors; -use spin_runtime_config::TomlRuntimeConfigSource; #[derive(RuntimeFactors)] pub struct TriggerFactors { @@ -82,14 +81,6 @@ fn outbound_networking_factor() -> OutboundNetworkingFactor { factor } -impl TryFrom> for TriggerFactorsRuntimeConfig { - type Error = anyhow::Error; - - fn try_from(value: TomlRuntimeConfigSource<'_, '_>) -> Result { - Self::from_source(value) - } -} - /// Options for building a [`TriggerFactors`]. #[derive(Default, clap::Args)] pub struct TriggerAppOptions { diff --git a/src/bin/spin.rs b/src/bin/spin.rs index aac246fbf6..838ec921f9 100644 --- a/src/bin/spin.rs +++ b/src/bin/spin.rs @@ -17,7 +17,7 @@ use spin_cli::commands::{ watch::WatchCommand, }; use spin_cli::{build_info::*, subprocess::ExitStatusError}; -use spin_runtime_config::{ResolvedRuntimeConfig, UserProvidedPath}; +use spin_runtime_config::ResolvedRuntimeConfig; use spin_trigger::cli::help::HelpArgsOnlyTrigger; use spin_trigger::cli::{CommonTriggerOptions, FactorsTriggerCommand, RuntimeFactorsBuilder}; use spin_trigger::{TriggerAppOptions, TriggerFactors, TriggerFactorsRuntimeConfig}; @@ -187,26 +187,14 @@ impl RuntimeFactorsBuilder for Builder { )> { let runtime_config_path = common_options.runtime_config_file; let local_app_dir = common_options.local_app_dir.map(PathBuf::from); - let state_dir = match common_options.state_dir { - // Make sure `--state-dir=""` unsets the state dir - Some(s) if s.is_empty() => UserProvidedPath::Unset, - Some(s) => UserProvidedPath::Provided(PathBuf::from(s)), - None => UserProvidedPath::Default, - }; - let log_dir = match &common_options.log_dir { - // Make sure `--log-dir=""` unsets the log dir - Some(p) if p.as_os_str().is_empty() => UserProvidedPath::Unset, - Some(p) => UserProvidedPath::Provided(p.clone()), - None => UserProvidedPath::Default, - }; // Hardcode `use_gpu` to true for now let use_gpu = true; let runtime_config = ResolvedRuntimeConfig::::from_optional_file( runtime_config_path.as_deref(), local_app_dir, - state_dir, - log_dir, + common_options.state_dir, + common_options.log_dir, use_gpu, )?; From 475330110f4f883ba69d3851b5eeecff12d2c74a Mon Sep 17 00:00:00 2001 From: Ryan Levick Date: Thu, 29 Aug 2024 18:34:08 +0200 Subject: [PATCH 04/13] Feed runtime all the way through Signed-off-by: Ryan Levick --- Cargo.lock | 1 + Cargo.toml | 1 + crates/runtime-config/src/lib.rs | 84 ++++++++++++-------------------- crates/sqlite/src/lib.rs | 1 + crates/trigger/Cargo.toml | 1 + crates/trigger/src/cli.rs | 42 ++++++++-------- crates/trigger/src/factors.rs | 4 +- src/bin/spin.rs | 71 +++++++++++++++++---------- 8 files changed, 103 insertions(+), 102 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b7acc095c3..e1db9552b0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7130,6 +7130,7 @@ dependencies = [ "spin-doctor", "spin-expressions", "spin-factors", + "spin-factors-executor", "spin-http", "spin-loader", "spin-locked-app", diff --git a/Cargo.toml b/Cargo.toml index cf9c4eb63e..0c7c2e9195 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -49,6 +49,7 @@ spin-common = { path = "crates/common" } spin-doctor = { path = "crates/doctor" } spin-expressions = { path = "crates/expressions" } spin-factors = { path = "crates/factors" } +spin-factors-executor = { path = "crates/factors-executor" } spin-http = { path = "crates/http" } spin-loader = { path = "crates/loader" } spin-locked-app = { path = "crates/locked-app" } diff --git a/crates/runtime-config/src/lib.rs b/crates/runtime-config/src/lib.rs index 3208d45fbc..f8d05d8c97 100644 --- a/crates/runtime-config/src/lib.rs +++ b/crates/runtime-config/src/lib.rs @@ -52,73 +52,43 @@ where T: for<'a, 'b> TryFrom>, for<'a, 'b> >>::Error: Into, { - /// Creates a new resolved runtime configuration from an optional runtime config source TOML file. - pub fn from_optional_file( - runtime_config_path: Option<&Path>, - local_app_dir: Option, - provided_state_dir: UserProvidedPath, - provided_log_dir: UserProvidedPath, - use_gpu: bool, - ) -> anyhow::Result { - match runtime_config_path { - Some(runtime_config_path) => Self::from_file( - runtime_config_path, - local_app_dir, - provided_state_dir, - provided_log_dir, - use_gpu, - ), - None => Self::new( - Default::default(), - None, - local_app_dir, - provided_state_dir, - provided_log_dir, - use_gpu, - ), - } - } - /// Creates a new resolved runtime configuration from a runtime config source TOML file. /// /// `provided_state_dir` is the explicitly provided state directory, if any. pub fn from_file( - runtime_config_path: &Path, + runtime_config_path: Option<&Path>, local_app_dir: Option, provided_state_dir: UserProvidedPath, provided_log_dir: UserProvidedPath, use_gpu: bool, ) -> anyhow::Result { - let file = std::fs::read_to_string(runtime_config_path).with_context(|| { - format!( - "failed to read runtime config file '{}'", - runtime_config_path.display() - ) - })?; - let toml = toml::from_str(&file).with_context(|| { - format!( - "failed to parse runtime config file '{}' as toml", - runtime_config_path.display() - ) - })?; - - Self::new( - toml, - Some(runtime_config_path), - local_app_dir, - provided_state_dir, - provided_log_dir, - use_gpu, - ) + let toml = match runtime_config_path { + Some(runtime_config_path) => { + let file = std::fs::read_to_string(runtime_config_path).with_context(|| { + format!( + "failed to read runtime config file '{}'", + runtime_config_path.display() + ) + })?; + toml::from_str(&file).with_context(|| { + format!( + "failed to parse runtime config file '{}' as toml", + runtime_config_path.display() + ) + })? + } + None => Default::default(), + }; + let toml_resolver = + TomlResolver::new(&toml, local_app_dir, provided_state_dir, provided_log_dir); + + Self::new(toml_resolver, runtime_config_path, use_gpu) } /// Creates a new resolved runtime configuration from a TOML table. pub fn new( - toml: toml::Table, + toml_resolver: TomlResolver<'_>, runtime_config_path: Option<&Path>, - local_app_dir: Option, - provided_state_dir: UserProvidedPath, - provided_log_dir: UserProvidedPath, use_gpu: bool, ) -> anyhow::Result { let runtime_config_dir = runtime_config_path @@ -189,6 +159,14 @@ where } } +impl From> + for spin_trigger::TriggerFactorsRuntimeConfig +{ + fn from(value: ResolvedRuntimeConfig) -> Self { + value.runtime_config + } +} + #[derive(Clone, Debug)] /// Resolves runtime configuration from a TOML file. pub struct TomlResolver<'a> { diff --git a/crates/sqlite/src/lib.rs b/crates/sqlite/src/lib.rs index b92eda2c15..eabacf718e 100644 --- a/crates/sqlite/src/lib.rs +++ b/crates/sqlite/src/lib.rs @@ -20,6 +20,7 @@ use tokio::sync::OnceCell; /// /// This type implements how Spin CLI's SQLite implementation is configured /// through the runtime config toml as well as the behavior of the "default" label. +#[derive(Clone, Debug)] pub struct RuntimeConfigResolver { default_database_dir: Option, local_database_dir: PathBuf, diff --git a/crates/trigger/Cargo.toml b/crates/trigger/Cargo.toml index de45bf2b25..66fb9a7646 100644 --- a/crates/trigger/Cargo.toml +++ b/crates/trigger/Cargo.toml @@ -39,6 +39,7 @@ spin-factor-variables = { path = "../factor-variables" } spin-factor-wasi = { path = "../factor-wasi" } spin-factors = { path = "../factors" } spin-factors-executor = { path = "../factors-executor" } +spin-runtime-config = { path = "../runtime-config" } spin-telemetry = { path = "../telemetry" } terminal = { path = "../terminal" } tokio = { version = "1.23", features = ["fs", "rt"] } diff --git a/crates/trigger/src/cli.rs b/crates/trigger/src/cli.rs index f9273a26b3..571cce36e9 100644 --- a/crates/trigger/src/cli.rs +++ b/crates/trigger/src/cli.rs @@ -5,6 +5,7 @@ mod summary; use std::future::Future; use std::path::PathBuf; +pub use crate::stdio::StdioLoggingExecutorHooks; use anyhow::{Context, Result}; use clap::{Args, IntoApp, Parser}; use spin_app::App; @@ -14,12 +15,10 @@ use spin_common::url::parse_file_url; use spin_core::async_trait; use spin_factors::RuntimeFactors; use spin_factors_executor::{ComponentLoader, FactorsExecutor}; -use sqlite_statements::SqlStatementExecutorHook; -use summary::{ - summarize_runtime_config, KeyValueDefaultStoreSummaryHook, SqliteDefaultStoreSummaryHook, -}; +pub use sqlite_statements::SqlStatementExecutorHook; +pub use summary::KeyValueDefaultStoreSummaryHook; -use crate::stdio::{FollowComponents, StdioLoggingExecutorHooks}; +use crate::stdio::FollowComponents; use crate::{Trigger, TriggerApp}; pub use launch_metadata::LaunchMetadata; @@ -315,7 +314,7 @@ impl, B: RuntimeFactorsBuilder> TriggerAppBuilder { }; self.trigger.add_to_linker(core_engine_builder.linker())?; - let (factors, runtime_config) = B::build(common_options, options)?; + let (factors, runtime_config) = B::build(&common_options, &options)?; // TODO: port the rest of the component loader logic struct SimpleComponentLoader; @@ -377,19 +376,12 @@ impl, B: RuntimeFactorsBuilder> TriggerAppBuilder { } let mut executor = FactorsExecutor::new(core_engine_builder, factors)?; - - executor.add_hooks(StdioLoggingExecutorHooks::new( - options.follow_components, - log_dir, - )); - executor.add_hooks(KeyValueDefaultStoreSummaryHook); - executor.add_hooks(SqliteDefaultStoreSummaryHook); - executor.add_hooks(SqlStatementExecutorHook::new(options.sqlite_statements)); + B::configure_app(&mut executor, &runtime_config, &common_options, &options)?; let configured_app = { let _sloth_guard = warn_if_wasm_build_slothful(); executor - .load_app(app, runtime_config, SimpleComponentLoader) + .load_app(app, runtime_config.into(), SimpleComponentLoader) .await? }; @@ -411,14 +403,22 @@ impl, B: RuntimeFactorsBuilder> TriggerAppBuilder { pub trait RuntimeFactorsBuilder { type Options: clap::Args; type Factors: RuntimeFactors; + type RuntimeConfig: Into<::RuntimeConfig>; fn build( - common_options: CommonTriggerOptions, - options: Self::Options, - ) -> anyhow::Result<( - Self::Factors, - ::RuntimeConfig, - )>; + common_options: &CommonTriggerOptions, + options: &Self::Options, + ) -> anyhow::Result<(Self::Factors, Self::RuntimeConfig)>; + + fn configure_app( + executor: &mut FactorsExecutor, + runtime_config: &Self::RuntimeConfig, + common_options: &CommonTriggerOptions, + options: &Self::Options, + ) -> anyhow::Result<()> { + let _ = (executor, runtime_config, common_options, options); + Ok(()) + } } pub mod help { diff --git a/crates/trigger/src/factors.rs b/crates/trigger/src/factors.rs index b9a22fe58e..89f337a449 100644 --- a/crates/trigger/src/factors.rs +++ b/crates/trigger/src/factors.rs @@ -92,10 +92,10 @@ pub struct TriggerAppOptions { /// default store. Any existing value will be overwritten. /// Can be used multiple times. #[clap(long = "key-value", parse(try_from_str = parse_kv))] - key_values: Vec<(String, String)>, + pub key_values: Vec<(String, String)>, /// Run a SQLite statement such as a migration against the default database. /// To run from a file, prefix the filename with @ e.g. spin up --sqlite @migration.sql #[clap(long = "sqlite")] - sqlite_statements: Vec, + pub sqlite_statements: Vec, } diff --git a/src/bin/spin.rs b/src/bin/spin.rs index 838ec921f9..1f426b30b8 100644 --- a/src/bin/spin.rs +++ b/src/bin/spin.rs @@ -17,9 +17,13 @@ use spin_cli::commands::{ watch::WatchCommand, }; use spin_cli::{build_info::*, subprocess::ExitStatusError}; +use spin_factors_executor::FactorsExecutor; use spin_runtime_config::ResolvedRuntimeConfig; use spin_trigger::cli::help::HelpArgsOnlyTrigger; -use spin_trigger::cli::{CommonTriggerOptions, FactorsTriggerCommand, RuntimeFactorsBuilder}; +use spin_trigger::cli::{ + CommonTriggerOptions, FactorsTriggerCommand, KeyValueDefaultStoreSummaryHook, + RuntimeFactorsBuilder, SqlStatementExecutorHook, StdioLoggingExecutorHooks, +}; use spin_trigger::{TriggerAppOptions, TriggerFactors, TriggerFactorsRuntimeConfig}; use spin_trigger_http::HttpTrigger; use spin_trigger_redis::RedisTrigger; @@ -177,42 +181,57 @@ struct Builder; impl RuntimeFactorsBuilder for Builder { type Options = TriggerAppOptions; type Factors = TriggerFactors; + type RuntimeConfig = ResolvedRuntimeConfig; fn build( - common_options: CommonTriggerOptions, - options: Self::Options, - ) -> anyhow::Result<( - Self::Factors, - ::RuntimeConfig, - )> { - let runtime_config_path = common_options.runtime_config_file; - let local_app_dir = common_options.local_app_dir.map(PathBuf::from); + common_options: &CommonTriggerOptions, + options: &Self::Options, + ) -> anyhow::Result<(Self::Factors, Self::RuntimeConfig)> { + let runtime_config_path = common_options.runtime_config_file.clone(); + let local_app_dir = common_options.local_app_dir.clone().map(PathBuf::from); // Hardcode `use_gpu` to true for now let use_gpu = true; - let runtime_config = - ResolvedRuntimeConfig::::from_optional_file( - runtime_config_path.as_deref(), - local_app_dir, - common_options.state_dir, - common_options.log_dir, - use_gpu, - )?; - - // runtime_config - // .set_initial_key_values(&options.initial_key_values) - // .await?; + let runtime_config = ResolvedRuntimeConfig::::from_file( + runtime_config_path.as_deref(), + local_app_dir, + common_options.state_dir.clone(), + common_options.log_dir.clone(), + use_gpu, + )?; - let log_dir = runtime_config.log_dir(); let factors = TriggerFactors::new( runtime_config.state_dir(), - common_options.working_dir, + common_options.working_dir.clone(), options.allow_transient_write, - runtime_config.key_value_resolver, - runtime_config.sqlite_resolver, + runtime_config.key_value_resolver.clone(), + runtime_config.sqlite_resolver.clone(), use_gpu, ) .context("failed to create factors")?; - Ok((factors, runtime_config.runtime_config)) + Ok((factors, runtime_config)) + } + + fn configure_app( + executor: &mut FactorsExecutor, + runtime_config: &Self::RuntimeConfig, + common_options: &CommonTriggerOptions, + options: &Self::Options, + ) -> anyhow::Result<()> { + executor.add_hooks(SqlStatementExecutorHook::new( + options.sqlite_statements.clone(), + )); + executor.add_hooks(StdioLoggingExecutorHooks::new( + common_options.follow_components.clone(), + runtime_config.log_dir(), + )); + executor.add_hooks(KeyValueDefaultStoreSummaryHook); + // TODO: implement initial key values as a hook + // runtime_config + // .set_initial_key_values(&options.initial_key_values) + // .await?; + // builder.hooks(SummariseRuntimeConfigHook::new(&self.runtime_config_file)); + // builder.hooks(SqlitePersistenceMessageHook); + Ok(()) } } From bfd3680129b8968d3e08f9a8cd0b3566ede1e3a6 Mon Sep 17 00:00:00 2001 From: Ryan Levick Date: Fri, 30 Aug 2024 11:06:08 +0200 Subject: [PATCH 05/13] Allow dynamic querying of instance builders Signed-off-by: Ryan Levick --- Cargo.lock | 1 + crates/factors-derive/src/lib.rs | 18 +- crates/factors/src/lib.rs | 4 +- crates/factors/src/runtime_factors.rs | 6 +- crates/trigger-http/src/server.rs | 17 +- crates/trigger-http/src/wagi.rs | 21 +- crates/trigger/src/cli.rs | 21 +- examples/spin-timer/Cargo.lock | 228 +----------------- examples/spin-timer/Cargo.toml | 1 + examples/spin-timer/src/lib.rs | 14 +- examples/spin-timer/src/main.rs | 3 +- src/bin/spin.rs | 70 +----- src/lib.rs | 69 ++++++ tests/testing-framework/Cargo.toml | 1 + .../src/runtimes/in_process_spin.rs | 19 +- 15 files changed, 154 insertions(+), 339 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e1db9552b0..a174938f03 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8336,6 +8336,7 @@ dependencies = [ "regex", "reqwest 0.12.7", "spin-app", + "spin-cli", "spin-factors-executor", "spin-http", "spin-loader", diff --git a/crates/factors-derive/src/lib.rs b/crates/factors-derive/src/lib.rs index df97924482..205d6b9cf6 100644 --- a/crates/factors-derive/src/lib.rs +++ b/crates/factors-derive/src/lib.rs @@ -211,7 +211,6 @@ fn expand_factors(input: &DeriveInput) -> syn::Result { )* } - #[allow(dead_code)] impl #builders_name { #( pub fn #factor_names(&mut self) -> &mut <#factor_types as #Factor>::InstanceBuilder { @@ -220,6 +219,23 @@ fn expand_factors(input: &DeriveInput) -> syn::Result { )* } + impl #factors_path::HasInstanceBuilder for #builders_name { + fn for_factor( + &mut self + ) -> Option<&mut F::InstanceBuilder> { + let type_id = #TypeId::of::(); + #( + if type_id == #TypeId::of::<<#factor_types as #Factor>::InstanceBuilder>() { + let builder = self.#factor_names.as_mut().unwrap(); + return Some( + ::downcast_mut(builder).unwrap() + ); + } + )* + None + } + } + #vis struct #state_name { __table: #ResourceTable, #( diff --git a/crates/factors/src/lib.rs b/crates/factors/src/lib.rs index d73435f215..93c0d39350 100644 --- a/crates/factors/src/lib.rs +++ b/crates/factors/src/lib.rs @@ -14,7 +14,9 @@ pub use crate::{ factor::{ConfigureAppContext, ConfiguredApp, Factor, FactorInstanceState, InitContext}, prepare::{FactorInstanceBuilder, InstanceBuilders, PrepareContext, SelfInstanceBuilder}, runtime_config::{FactorRuntimeConfigSource, RuntimeConfigSourceFinalizer}, - runtime_factors::{AsInstanceState, RuntimeFactors, RuntimeFactorsInstanceState}, + runtime_factors::{ + AsInstanceState, HasInstanceBuilder, RuntimeFactors, RuntimeFactorsInstanceState, + }, }; /// Result wrapper type defaulting to use [`Error`]. diff --git a/crates/factors/src/runtime_factors.rs b/crates/factors/src/runtime_factors.rs index 51178a2467..150a6117af 100644 --- a/crates/factors/src/runtime_factors.rs +++ b/crates/factors/src/runtime_factors.rs @@ -36,7 +36,7 @@ pub trait RuntimeFactors: Send + Sync + Sized + 'static { /// The per instance state of the factors. type InstanceState: RuntimeFactorsInstanceState; /// The collection of all the `InstanceBuilder`s of the factors. - type InstanceBuilders: Send; + type InstanceBuilders: Send + HasInstanceBuilder; /// The runtime configuration of all the factors. type RuntimeConfig: Default; @@ -81,6 +81,10 @@ pub trait RuntimeFactors: Send + Sync + Sized + 'static { ) -> Option>; } +pub trait HasInstanceBuilder { + fn for_factor(&mut self) -> Option<&mut F::InstanceBuilder>; +} + /// Get the state of a particular Factor from the overall InstanceState /// /// Implemented by `#[derive(RuntimeFactors)]` diff --git a/crates/trigger-http/src/server.rs b/crates/trigger-http/src/server.rs index c3ddb815ad..1d798af3b5 100644 --- a/crates/trigger-http/src/server.rs +++ b/crates/trigger-http/src/server.rs @@ -13,8 +13,8 @@ use hyper::{ }; use hyper_util::rt::TokioIo; use spin_app::{APP_DESCRIPTION_KEY, APP_NAME_KEY}; -use spin_factor_outbound_http::SelfRequestOrigin; -use spin_factors::RuntimeFactors; +use spin_factor_outbound_http::{OutboundHttpFactor, SelfRequestOrigin}; +use spin_factors::{HasInstanceBuilder, RuntimeFactors}; use spin_http::{ app_info::AppInfo, body, @@ -236,11 +236,14 @@ impl HttpServer { let mut instance_builder = self.trigger_app.prepare(component_id)?; // Set up outbound HTTP request origin and service chaining - // TODO: bring back once outbound networking is refactored - // let outbound_http = instance_builder.factor_builders().outbound_http(); - // let origin = SelfRequestOrigin::create(server_scheme, &self.listen_addr)?; - // outbound_http.set_self_request_origin(origin); - // outbound_http.set_request_interceptor(OutboundHttpInterceptor::new(self.clone()))?; + if let Some(outbound_http) = instance_builder + .factor_builders() + .for_factor::() + { + let origin = SelfRequestOrigin::create(server_scheme, &self.listen_addr)?; + outbound_http.set_self_request_origin(origin); + outbound_http.set_request_interceptor(OutboundHttpInterceptor::new(self.clone()))?; + } // Prepare HTTP executor let trigger_config = self.component_trigger_configs.get(component_id).unwrap(); diff --git a/crates/trigger-http/src/wagi.rs b/crates/trigger-http/src/wagi.rs index a1bc5d15c6..85b2550881 100644 --- a/crates/trigger-http/src/wagi.rs +++ b/crates/trigger-http/src/wagi.rs @@ -3,7 +3,8 @@ use std::{io::Cursor, net::SocketAddr}; use anyhow::{ensure, Result}; use http_body_util::BodyExt; use hyper::{Request, Response}; -use spin_factors::RuntimeFactors; +use spin_factor_wasi::WasiFactor; +use spin_factors::{HasInstanceBuilder, RuntimeFactors}; use spin_http::{config::WagiTriggerConfig, routes::RouteMatch, wagi}; use tracing::{instrument, Level}; use wasmtime_wasi::pipe::MemoryOutputPipe; @@ -74,14 +75,16 @@ impl HttpExecutor for WagiHttpExecutor { let stdout = MemoryOutputPipe::new(usize::MAX); - // TODO: - // let wasi_builder = instance_builder.factor_builders().wasi(); - - // // Set up Wagi environment - // wasi_builder.args(argv.split(' ')); - // wasi_builder.env(headers); - // wasi_builder.stdin_pipe(Cursor::new(body)); - // wasi_builder.stdout(stdout.clone()); + if let Some(wasi_builder) = instance_builder + .factor_builders() + .for_factor::() + { + // // Set up Wagi environment + wasi_builder.args(argv.split(' ')); + wasi_builder.env(headers); + wasi_builder.stdin_pipe(Cursor::new(body)); + wasi_builder.stdout(stdout.clone()); + } let (instance, mut store) = instance_builder.instantiate(()).await?; diff --git a/crates/trigger/src/cli.rs b/crates/trigger/src/cli.rs index 571cce36e9..869f97e8c8 100644 --- a/crates/trigger/src/cli.rs +++ b/crates/trigger/src/cli.rs @@ -90,10 +90,6 @@ pub struct FactorsTriggerCommand, B: RuntimeFactorsBuilde )] pub silence_component_logs: bool, - /// Set the static assets of the components in the temporary directory as writable. - #[clap(long = "allow-transient-write")] - pub allow_transient_write: bool, - /// Configuration file for config providers and wasmtime config. #[clap( name = RUNTIME_CONFIG_FILE, @@ -125,7 +121,7 @@ pub struct FactorsTriggerCommand, B: RuntimeFactorsBuilde } /// Configuration options that are common to all triggers. -#[derive(Debug)] +#[derive(Debug, Default)] pub struct CommonTriggerOptions { /// The Spin working directory. pub working_dir: PathBuf, @@ -135,8 +131,6 @@ pub struct CommonTriggerOptions { pub state_dir: UserProvidedPath, /// Path to the local app directory. pub local_app_dir: Option, - /// Whether to allow transient writes to mounted files - pub allow_transient_write: bool, /// Which components should have their logs followed. pub follow_components: FollowComponents, /// Log directory for component stdout/stderr. @@ -220,7 +214,6 @@ impl, B: RuntimeFactorsBuilder> FactorsTriggerCommand, F: RuntimeFactors>() -> Option<&'static str> { } /// A builder for a [`TriggerApp`]. -pub struct TriggerAppBuilder { +pub struct TriggerAppBuilder { engine_config: spin_core::Config, pub trigger: T, - _factors: std::marker::PhantomData, + _factors_builder: std::marker::PhantomData, } impl, B: RuntimeFactorsBuilder> TriggerAppBuilder { @@ -292,7 +285,7 @@ impl, B: RuntimeFactorsBuilder> TriggerAppBuilder { Self { engine_config: spin_core::Config::default(), trigger, - _factors: Default::default(), + _factors_builder: Default::default(), } } @@ -400,16 +393,19 @@ impl, B: RuntimeFactorsBuilder> TriggerAppBuilder { } } +/// A builder for runtime factors. pub trait RuntimeFactorsBuilder { type Options: clap::Args; type Factors: RuntimeFactors; type RuntimeConfig: Into<::RuntimeConfig>; + /// Build the factors and runtime config from the given options. fn build( common_options: &CommonTriggerOptions, options: &Self::Options, ) -> anyhow::Result<(Self::Factors, Self::RuntimeConfig)>; + /// Configure the factors in the executor. fn configure_app( executor: &mut FactorsExecutor, runtime_config: &Self::RuntimeConfig, @@ -444,11 +440,12 @@ pub mod help { } /// A user provided option which be either be provided, default, or explicitly none. -#[derive(Clone, Debug)] +#[derive(Clone, Debug, Default)] pub enum UserProvidedPath { /// Use the explicitly provided directory. Provided(PathBuf), /// Use the default. + #[default] Default, /// Explicitly unset. Unset, diff --git a/examples/spin-timer/Cargo.lock b/examples/spin-timer/Cargo.lock index dbd612a5a7..fb8c3ba3c2 100644 --- a/examples/spin-timer/Cargo.lock +++ b/examples/spin-timer/Cargo.lock @@ -305,7 +305,6 @@ dependencies = [ "dyn-clone", "futures", "getrandom 0.2.12", - "hmac", "http-types", "once_cell", "paste", @@ -315,25 +314,6 @@ dependencies = [ "rustc_version", "serde", "serde_json", - "sha2", - "time", - "tracing", - "url", - "uuid", -] - -[[package]] -name = "azure_data_cosmos" -version = "0.20.0" -source = "git+https://github.com/azure/azure-sdk-for-rust?rev=8c4caa251c3903d5eae848b41bb1d02a4d65231c#8c4caa251c3903d5eae848b41bb1d02a4d65231c" -dependencies = [ - "async-trait", - "azure_core", - "bytes", - "futures", - "serde", - "serde_json", - "thiserror", "time", "tracing", "url", @@ -484,9 +464,6 @@ name = "bytes" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" -dependencies = [ - "serde", -] [[package]] name = "cap-fs-ext" @@ -1181,12 +1158,6 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" -[[package]] -name = "fallible-streaming-iterator" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" - [[package]] name = "fastrand" version = "1.9.0" @@ -1535,15 +1506,6 @@ dependencies = [ "serde", ] -[[package]] -name = "hashlink" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" -dependencies = [ - "hashbrown 0.14.3", -] - [[package]] name = "heck" version = "0.4.1" @@ -1727,24 +1689,6 @@ dependencies = [ "tokio-rustls 0.24.1", ] -[[package]] -name = "hyper-rustls" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "399c78f9338483cb7e630c8474b07268983c6bd5acee012e4211f9f7bb21b070" -dependencies = [ - "futures-util", - "http 0.2.12", - "hyper 0.14.30", - "log", - "rustls 0.22.4", - "rustls-native-certs", - "rustls-pki-types", - "tokio", - "tokio-rustls 0.25.0", - "webpki-roots 0.26.3", -] - [[package]] name = "hyper-timeout" version = "0.4.1" @@ -2015,75 +1959,6 @@ dependencies = [ "libc", ] -[[package]] -name = "libsql" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bd17bcc143f2a5be449680dc63b91327d953bcabebe34a69c549fca8934ec9d" -dependencies = [ - "async-stream", - "async-trait", - "base64 0.21.7", - "bitflags 2.4.2", - "bytes", - "fallible-iterator 0.3.0", - "futures", - "http 0.2.12", - "hyper 0.14.30", - "hyper-rustls 0.25.0", - "libsql-hrana", - "libsql-sqlite3-parser", - "serde", - "serde_json", - "thiserror", - "tokio", - "tokio-util", - "tower", - "tracing", -] - -[[package]] -name = "libsql-hrana" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "220a925fe6d49dbfa7523b20f5a5391f579b5d9dcf9dd1225606d00929fcab3a" -dependencies = [ - "base64 0.21.7", - "bytes", - "prost", - "serde", -] - -[[package]] -name = "libsql-sqlite3-parser" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "095d2cf702a5c9c152e48b369f69da30cc44351fa9432621dd8976834abc1752" -dependencies = [ - "bitflags 2.4.2", - "cc", - "fallible-iterator 0.3.0", - "indexmap 2.2.6", - "log", - "memchr", - "phf", - "phf_codegen", - "phf_shared", - "smallvec", - "uncased", -] - -[[package]] -name = "libsqlite3-sys" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afc22eff61b133b115c6e8c74e818c628d6d5e7a502afea6f64dee076dd94326" -dependencies = [ - "cc", - "pkg-config", - "vcpkg", -] - [[package]] name = "linux-raw-sys" version = "0.4.13" @@ -2676,26 +2551,6 @@ dependencies = [ "phf_shared", ] -[[package]] -name = "phf_codegen" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8d39688d359e6b34654d328e262234662d16cc0f60ec8dcbe5e718709342a5a" -dependencies = [ - "phf_generator", - "phf_shared", -] - -[[package]] -name = "phf_generator" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" -dependencies = [ - "phf_shared", - "rand 0.8.5", -] - [[package]] name = "phf_shared" version = "0.11.2" @@ -2703,7 +2558,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" dependencies = [ "siphasher", - "uncased", ] [[package]] @@ -3118,7 +2972,7 @@ dependencies = [ "http 0.2.12", "http-body 0.4.6", "hyper 0.14.30", - "hyper-rustls 0.24.2", + "hyper-rustls", "hyper-tls 0.5.0", "ipnet", "js-sys", @@ -3223,20 +3077,6 @@ dependencies = [ "url", ] -[[package]] -name = "rusqlite" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "549b9d036d571d42e6e85d1c1425e2ac83491075078ca9a15be021c56b1641f2" -dependencies = [ - "bitflags 2.4.2", - "fallible-iterator 0.2.0", - "fallible-streaming-iterator", - "hashlink", - "libsqlite3-sys", - "smallvec", -] - [[package]] name = "rustc-demangle" version = "0.1.23" @@ -4103,52 +3943,6 @@ dependencies = [ "wasm-pkg-common", ] -[[package]] -name = "spin-sqlite" -version = "2.8.0-pre0" -dependencies = [ - "async-trait", - "serde", - "spin-factor-sqlite", - "spin-factors", - "spin-locked-app", - "spin-sqlite-inproc", - "spin-sqlite-libsql", - "spin-world", - "table", - "tokio", - "toml", -] - -[[package]] -name = "spin-sqlite-inproc" -version = "2.8.0-pre0" -dependencies = [ - "anyhow", - "async-trait", - "once_cell", - "rand 0.8.5", - "rusqlite", - "spin-factor-sqlite", - "spin-world", - "tokio", - "tracing", -] - -[[package]] -name = "spin-sqlite-libsql" -version = "2.8.0-pre0" -dependencies = [ - "anyhow", - "async-trait", - "libsql", - "rusqlite", - "spin-world", - "sqlparser", - "tokio", - "tracing", -] - [[package]] name = "spin-telemetry" version = "2.8.0-pre0" @@ -4197,7 +3991,6 @@ dependencies = [ "spin-factor-wasi", "spin-factors", "spin-factors-executor", - "spin-runtime-config", "spin-telemetry", "terminal", "tokio", @@ -4219,15 +4012,6 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b9b39299b249ad65f3b7e96443bad61c02ca5cd3589f46cb6d610a0fd6c0d6a" -[[package]] -name = "sqlparser" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37d3706eefb17039056234df6b566b0014f303f867f2656108334a55b8096f59" -dependencies = [ - "log", -] - [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -4816,6 +4600,7 @@ dependencies = [ "clap", "futures", "serde", + "spin-factors", "spin-trigger", "tokio", "tokio-scoped", @@ -4854,15 +4639,6 @@ dependencies = [ "const_fn", ] -[[package]] -name = "uncased" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1b88fcfe09e89d3866a5c11019378088af2d24c3fbd4f0543f96b479ec90697" -dependencies = [ - "version_check", -] - [[package]] name = "unicode-bidi" version = "0.3.15" diff --git a/examples/spin-timer/Cargo.toml b/examples/spin-timer/Cargo.toml index 5d2d37d4ba..fdc4ae568e 100644 --- a/examples/spin-timer/Cargo.toml +++ b/examples/spin-timer/Cargo.toml @@ -10,6 +10,7 @@ clap = { version = "3.1.15", features = ["derive", "env"] } futures = "0.3.25" serde = "1.0.188" spin-trigger = { path = "../../crates/trigger" } +spin-factors = { path = "../../crates/factors" } tokio = { version = "1.11", features = ["full"] } tokio-scoped = "0.2.0" wasmtime = "22.0.0" diff --git a/examples/spin-timer/src/lib.rs b/examples/spin-timer/src/lib.rs index 58bb7e8e91..ae18f9e30e 100644 --- a/examples/spin-timer/src/lib.rs +++ b/examples/spin-timer/src/lib.rs @@ -2,6 +2,7 @@ use std::collections::HashMap; use clap::Args; use serde::{Deserialize, Serialize}; +use spin_factors::RuntimeFactors; use spin_trigger::{App, Trigger, TriggerApp}; wasmtime::component::bindgen!({ @@ -45,7 +46,7 @@ pub struct TimerTriggerConfig { interval_secs: u64, } -impl Trigger for TimerTrigger { +impl Trigger for TimerTrigger { const TYPE: &'static str = "timer"; type CliArgs = CliArgs; @@ -53,13 +54,14 @@ impl Trigger for TimerTrigger { type InstanceState = (); fn new(cli_args: Self::CliArgs, app: &App) -> anyhow::Result { + let trigger_type = >::TYPE; let metadata = app - .get_trigger_metadata::(Self::TYPE)? + .get_trigger_metadata::(trigger_type)? .unwrap_or_default(); let speedup = metadata.speedup.unwrap_or(1); let component_timings = app - .trigger_configs::(Self::TYPE)? + .trigger_configs::(trigger_type)? .into_iter() .map(|(_, config)| (config.component.clone(), config.interval_secs)) .collect(); @@ -71,7 +73,7 @@ impl Trigger for TimerTrigger { }) } - async fn run(self, trigger_app: TriggerApp) -> anyhow::Result<()> { + async fn run(self, trigger_app: TriggerApp) -> anyhow::Result<()> { if self.test { for component in self.component_timings.keys() { self.handle_timer_event(&trigger_app, component).await?; @@ -108,9 +110,9 @@ impl Trigger for TimerTrigger { } impl TimerTrigger { - async fn handle_timer_event( + async fn handle_timer_event( &self, - trigger_app: &TriggerApp, + trigger_app: &TriggerApp, component_id: &str, ) -> anyhow::Result<()> { let instance_builder = trigger_app.prepare(component_id)?; diff --git a/examples/spin-timer/src/main.rs b/examples/spin-timer/src/main.rs index d9c7203b37..78e51beb87 100644 --- a/examples/spin-timer/src/main.rs +++ b/examples/spin-timer/src/main.rs @@ -1,10 +1,9 @@ use anyhow::Error; -use clap::Parser; use spin_trigger::cli::FactorsTriggerCommand; use trigger_timer::TimerTrigger; -type Command = FactorsTriggerCommand; +type Command = FactorsTriggerCommand; #[tokio::main] async fn main() -> Result<(), Error> { diff --git a/src/bin/spin.rs b/src/bin/spin.rs index 1f426b30b8..57e183c74e 100644 --- a/src/bin/spin.rs +++ b/src/bin/spin.rs @@ -1,5 +1,3 @@ -use std::path::PathBuf; - use anyhow::{Context, Error}; use clap::{CommandFactory, FromArgMatches, Parser, Subcommand}; use lazy_static::lazy_static; @@ -16,15 +14,10 @@ use spin_cli::commands::{ up::UpCommand, watch::WatchCommand, }; +use spin_cli::Builder; use spin_cli::{build_info::*, subprocess::ExitStatusError}; -use spin_factors_executor::FactorsExecutor; -use spin_runtime_config::ResolvedRuntimeConfig; use spin_trigger::cli::help::HelpArgsOnlyTrigger; -use spin_trigger::cli::{ - CommonTriggerOptions, FactorsTriggerCommand, KeyValueDefaultStoreSummaryHook, - RuntimeFactorsBuilder, SqlStatementExecutorHook, StdioLoggingExecutorHooks, -}; -use spin_trigger::{TriggerAppOptions, TriggerFactors, TriggerFactorsRuntimeConfig}; +use spin_trigger::cli::FactorsTriggerCommand; use spin_trigger_http::HttpTrigger; use spin_trigger_redis::RedisTrigger; @@ -176,65 +169,6 @@ impl SpinApp { } } -struct Builder; - -impl RuntimeFactorsBuilder for Builder { - type Options = TriggerAppOptions; - type Factors = TriggerFactors; - type RuntimeConfig = ResolvedRuntimeConfig; - - fn build( - common_options: &CommonTriggerOptions, - options: &Self::Options, - ) -> anyhow::Result<(Self::Factors, Self::RuntimeConfig)> { - let runtime_config_path = common_options.runtime_config_file.clone(); - let local_app_dir = common_options.local_app_dir.clone().map(PathBuf::from); - // Hardcode `use_gpu` to true for now - let use_gpu = true; - let runtime_config = ResolvedRuntimeConfig::::from_file( - runtime_config_path.as_deref(), - local_app_dir, - common_options.state_dir.clone(), - common_options.log_dir.clone(), - use_gpu, - )?; - - let factors = TriggerFactors::new( - runtime_config.state_dir(), - common_options.working_dir.clone(), - options.allow_transient_write, - runtime_config.key_value_resolver.clone(), - runtime_config.sqlite_resolver.clone(), - use_gpu, - ) - .context("failed to create factors")?; - Ok((factors, runtime_config)) - } - - fn configure_app( - executor: &mut FactorsExecutor, - runtime_config: &Self::RuntimeConfig, - common_options: &CommonTriggerOptions, - options: &Self::Options, - ) -> anyhow::Result<()> { - executor.add_hooks(SqlStatementExecutorHook::new( - options.sqlite_statements.clone(), - )); - executor.add_hooks(StdioLoggingExecutorHooks::new( - common_options.follow_components.clone(), - runtime_config.log_dir(), - )); - executor.add_hooks(KeyValueDefaultStoreSummaryHook); - // TODO: implement initial key values as a hook - // runtime_config - // .set_initial_key_values(&options.initial_key_values) - // .await?; - // builder.hooks(SummariseRuntimeConfigHook::new(&self.runtime_config_file)); - // builder.hooks(SqlitePersistenceMessageHook); - Ok(()) - } -} - /// Returns build information, similar to: 0.1.0 (2be4034 2022-03-31). fn build_info() -> String { format!("{SPIN_VERSION} ({SPIN_COMMIT_SHA} {SPIN_COMMIT_DATE})") diff --git a/src/lib.rs b/src/lib.rs index efca501ba0..addc94a47e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -3,4 +3,73 @@ pub mod commands; pub(crate) mod opts; pub mod subprocess; +use std::path::PathBuf; + +use anyhow::Context as _; pub use opts::HELP_ARGS_ONLY_TRIGGER_TYPE; +use spin_factors_executor::FactorsExecutor; +use spin_runtime_config::ResolvedRuntimeConfig; +use spin_trigger::{ + cli::{ + CommonTriggerOptions, KeyValueDefaultStoreSummaryHook, RuntimeFactorsBuilder, + SqlStatementExecutorHook, StdioLoggingExecutorHooks, + }, + TriggerAppOptions, TriggerFactors, TriggerFactorsRuntimeConfig, +}; + +pub struct Builder; + +impl RuntimeFactorsBuilder for Builder { + type Options = TriggerAppOptions; + type Factors = TriggerFactors; + type RuntimeConfig = ResolvedRuntimeConfig; + + fn build( + common_options: &CommonTriggerOptions, + options: &Self::Options, + ) -> anyhow::Result<(Self::Factors, Self::RuntimeConfig)> { + // Hardcode `use_gpu` to true for now + let use_gpu = true; + let runtime_config = ResolvedRuntimeConfig::::from_file( + common_options.runtime_config_file.clone().as_deref(), + common_options.local_app_dir.clone().map(PathBuf::from), + common_options.state_dir.clone(), + common_options.log_dir.clone(), + use_gpu, + )?; + + let factors = TriggerFactors::new( + runtime_config.state_dir(), + common_options.working_dir.clone(), + options.allow_transient_write, + runtime_config.key_value_resolver.clone(), + runtime_config.sqlite_resolver.clone(), + use_gpu, + ) + .context("failed to create factors")?; + Ok((factors, runtime_config)) + } + + fn configure_app( + executor: &mut FactorsExecutor, + runtime_config: &Self::RuntimeConfig, + common_options: &CommonTriggerOptions, + options: &Self::Options, + ) -> anyhow::Result<()> { + executor.add_hooks(SqlStatementExecutorHook::new( + options.sqlite_statements.clone(), + )); + executor.add_hooks(StdioLoggingExecutorHooks::new( + common_options.follow_components.clone(), + runtime_config.log_dir(), + )); + executor.add_hooks(KeyValueDefaultStoreSummaryHook); + // TODO: implement initial key values as a hook + // runtime_config + // .set_initial_key_values(&options.initial_key_values) + // .await?; + // builder.hooks(SummariseRuntimeConfigHook::new(&self.runtime_config_file)); + // builder.hooks(SqlitePersistenceMessageHook); + Ok(()) + } +} diff --git a/tests/testing-framework/Cargo.toml b/tests/testing-framework/Cargo.toml index 8448faaefe..291db350a7 100644 --- a/tests/testing-framework/Cargo.toml +++ b/tests/testing-framework/Cargo.toml @@ -15,6 +15,7 @@ reqwest = { workspace = true } temp-dir = "0.1.11" test-environment = { workspace = true } spin-app = { path = "../../crates/app" } +spin-cli = { path = "../.." } spin-factors-executor = { path = "../../crates/factors-executor" } spin-http = { path = "../../crates/http" } spin-loader = { path = "../../crates/loader" } diff --git a/tests/testing-framework/src/runtimes/in_process_spin.rs b/tests/testing-framework/src/runtimes/in_process_spin.rs index 35a8ce9afb..f903d4b331 100644 --- a/tests/testing-framework/src/runtimes/in_process_spin.rs +++ b/tests/testing-framework/src/runtimes/in_process_spin.rs @@ -1,9 +1,10 @@ //! The Spin runtime running in the same process as the test -use std::{path::PathBuf, sync::Arc}; +use std::sync::Arc; use anyhow::Context as _; -use spin_trigger::cli::{TriggerAppBuilder, TriggerAppOptions}; +use spin_cli::Builder; +use spin_trigger::{cli::TriggerAppBuilder, TriggerAppOptions, TriggerFactors}; use spin_trigger_http::{HttpServer, HttpTrigger}; use test_environment::{ http::{Request, Response}, @@ -15,7 +16,7 @@ use test_environment::{ /// /// Use `runtimes::spin_cli::SpinCli` if you'd rather use Spin as a separate process pub struct InProcessSpin { - server: Arc, + server: Arc>, } impl InProcessSpin { @@ -36,7 +37,7 @@ impl InProcessSpin { } /// Create a new instance of Spin running in the same process as the tests - pub fn new(server: Arc) -> Self { + pub fn new(server: Arc>) -> Self { Self { server } } @@ -104,8 +105,14 @@ async fn initialize_trigger( let app = spin_app::App::new("my-app", locked_app); let trigger = HttpTrigger::new(&app, "127.0.0.1:80".parse().unwrap(), None)?; - let mut builder = TriggerAppBuilder::new(trigger, PathBuf::from(".")); - let trigger_app = builder.build(app, TriggerAppOptions::default()).await?; + let mut builder = TriggerAppBuilder::<_, Builder>::new(trigger); + let trigger_app = builder + .build( + app, + spin_trigger::cli::CommonTriggerOptions::default(), + TriggerAppOptions::default(), + ) + .await?; let server = builder.trigger.into_server(trigger_app)?; Ok(InProcessSpin::new(server)) From 8b7f4978a39991f143d21337f705ebdb02539c3e Mon Sep 17 00:00:00 2001 From: Ryan Levick Date: Fri, 30 Aug 2024 11:49:51 +0200 Subject: [PATCH 06/13] Move Spin CLI runtime factors to their own crate Signed-off-by: Ryan Levick --- Cargo.lock | 35 +- Cargo.toml | 7 +- crates/runtime-config/Cargo.toml | 1 + crates/runtime-config/src/lib.rs | 9 +- crates/runtime-factors/Cargo.toml | 37 + .../factors.rs => runtime-factors/src/lib.rs} | 0 crates/trigger-http/Cargo.toml | 5 - crates/trigger/Cargo.toml | 14 - crates/trigger/src/cli.rs | 9 +- crates/trigger/src/{ => cli}/stdio.rs | 14 +- crates/trigger/src/cli/summary.rs | 5 +- crates/trigger/src/lib.rs | 3 - examples/spin-timer/Cargo.lock | 5645 +++++++++++++++-- examples/spin-timer/Cargo.toml | 1 + examples/spin-timer/src/main.rs | 3 +- src/bin/spin.rs | 8 +- src/lib.rs | 70 +- src/runtime_factors.rs | 67 + tests/testing-framework/Cargo.toml | 1 + .../src/runtimes/in_process_spin.rs | 7 +- 20 files changed, 5402 insertions(+), 539 deletions(-) create mode 100644 crates/runtime-factors/Cargo.toml rename crates/{trigger/src/factors.rs => runtime-factors/src/lib.rs} (100%) rename crates/trigger/src/{ => cli}/stdio.rs (96%) create mode 100644 src/runtime_factors.rs diff --git a/Cargo.lock b/Cargo.lock index a174938f03..644638947a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7138,6 +7138,7 @@ dependencies = [ "spin-oci", "spin-plugins", "spin-runtime-config", + "spin-runtime-factors", "spin-telemetry", "spin-templates", "spin-trigger", @@ -7792,6 +7793,30 @@ dependencies = [ "toml 0.8.14", ] +[[package]] +name = "spin-runtime-factors" +version = "2.8.0-pre0" +dependencies = [ + "anyhow", + "clap 3.2.25", + "spin-common", + "spin-factor-key-value", + "spin-factor-llm", + "spin-factor-outbound-http", + "spin-factor-outbound-mqtt", + "spin-factor-outbound-mysql", + "spin-factor-outbound-networking", + "spin-factor-outbound-pg", + "spin-factor-outbound-redis", + "spin-factor-sqlite", + "spin-factor-variables", + "spin-factor-wasi", + "spin-factors", + "spin-telemetry", + "terminal", + "tracing", +] + [[package]] name = "spin-serde" version = "2.8.0-pre0" @@ -7919,22 +7944,13 @@ dependencies = [ "spin-compose", "spin-core", "spin-factor-key-value", - "spin-factor-llm", - "spin-factor-outbound-http", - "spin-factor-outbound-mqtt", - "spin-factor-outbound-mysql", - "spin-factor-outbound-networking", - "spin-factor-outbound-pg", - "spin-factor-outbound-redis", "spin-factor-sqlite", - "spin-factor-variables", "spin-factor-wasi", "spin-factors", "spin-factors-executor", "spin-telemetry", "spin-world", "tempfile", - "terminal", "tokio", "toml 0.8.14", "tracing", @@ -8340,6 +8356,7 @@ dependencies = [ "spin-factors-executor", "spin-http", "spin-loader", + "spin-runtime-factors", "spin-trigger", "spin-trigger-http", "temp-dir", diff --git a/Cargo.toml b/Cargo.toml index 0c7c2e9195..7dcd852cb7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -57,6 +57,7 @@ spin-manifest = { path = "crates/manifest" } spin-oci = { path = "crates/oci" } spin-plugins = { path = "crates/plugins" } spin-runtime-config = { path = "crates/runtime-config" } +spin-runtime-factors = { path = "crates/runtime-factors" } spin-telemetry = { path = "crates/telemetry", features = [ "tracing-log-compat", ] } @@ -112,9 +113,9 @@ vergen = { version = "^8.2.1", default-features = false, features = [ default = ["llm"] all-tests = ["extern-dependencies-tests"] extern-dependencies-tests = [] -llm = ["spin-trigger-http/llm"] -llm-metal = ["llm", "spin-trigger-http/llm-metal"] -llm-cublas = ["llm", "spin-trigger-http/llm-cublas"] +llm = ["spin-runtime-factors/llm"] +llm-metal = ["llm", "spin-runtime-factors/llm-metal"] +llm-cublas = ["llm", "spin-runtime-factors/llm-cublas"] [workspace] members = [ diff --git a/crates/runtime-config/Cargo.toml b/crates/runtime-config/Cargo.toml index 343a32abf8..25441975ea 100644 --- a/crates/runtime-config/Cargo.toml +++ b/crates/runtime-config/Cargo.toml @@ -25,6 +25,7 @@ spin-factor-sqlite = { path = "../factor-sqlite" } spin-factor-variables = { path = "../factor-variables" } spin-factor-wasi = { path = "../factor-wasi" } spin-factors = { path = "../factors" } +spin-runtime-factors = { path = "../runtime-factors" } spin-sqlite = { path = "../sqlite" } spin-trigger = { path = "../trigger" } toml = "0.8" diff --git a/crates/runtime-config/src/lib.rs b/crates/runtime-config/src/lib.rs index f8d05d8c97..54c447f161 100644 --- a/crates/runtime-config/src/lib.rs +++ b/crates/runtime-config/src/lib.rs @@ -19,6 +19,7 @@ use spin_factors::{ runtime_config::toml::TomlKeyTracker, FactorRuntimeConfigSource, RuntimeConfigSourceFinalizer, }; use spin_key_value_spin::{SpinKeyValueRuntimeConfig, SpinKeyValueStore}; +use spin_runtime_factors::TriggerFactorsRuntimeConfig; use spin_sqlite as sqlite; use spin_trigger::cli::UserProvidedPath; @@ -159,10 +160,8 @@ where } } -impl From> - for spin_trigger::TriggerFactorsRuntimeConfig -{ - fn from(value: ResolvedRuntimeConfig) -> Self { +impl From> for TriggerFactorsRuntimeConfig { + fn from(value: ResolvedRuntimeConfig) -> Self { value.runtime_config } } @@ -432,7 +431,7 @@ fn sqlite_config_resolver( )) } -impl TryFrom> for spin_trigger::TriggerFactorsRuntimeConfig { +impl TryFrom> for TriggerFactorsRuntimeConfig { type Error = anyhow::Error; fn try_from(value: TomlRuntimeConfigSource<'_, '_>) -> Result { diff --git a/crates/runtime-factors/Cargo.toml b/crates/runtime-factors/Cargo.toml new file mode 100644 index 0000000000..0c67b38cae --- /dev/null +++ b/crates/runtime-factors/Cargo.toml @@ -0,0 +1,37 @@ +[package] +name = "spin-runtime-factors" +version.workspace = true +authors.workspace = true +edition.workspace = true +license.workspace = true +homepage.workspace = true +repository.workspace = true +rust-version.workspace = true + +[features] +llm = ["spin-factor-llm/llm"] +llm-metal = ["spin-factor-llm/llm-metal"] +llm-cublas = ["spin-factor-llm/llm-cublas"] + +[dependencies] +anyhow = "1" +clap = { version = "3.1.18", features = ["derive", "env"] } +spin-common = { path = "../common" } +spin-factor-key-value = { path = "../factor-key-value" } +spin-factor-llm = { path = "../factor-llm" } +spin-factor-outbound-http = { path = "../factor-outbound-http" } +spin-factor-outbound-mqtt = { path = "../factor-outbound-mqtt" } +spin-factor-outbound-mysql = { path = "../factor-outbound-mysql" } +spin-factor-outbound-networking = { path = "../factor-outbound-networking" } +spin-factor-outbound-pg = { path = "../factor-outbound-pg" } +spin-factor-outbound-redis = { path = "../factor-outbound-redis" } +spin-factor-sqlite = { path = "../factor-sqlite" } +spin-factor-variables = { path = "../factor-variables" } +spin-factor-wasi = { path = "../factor-wasi" } +spin-factors = { path = "../factors" } +spin-telemetry = { path = "../telemetry" } +terminal = { path = "../terminal" } +tracing = { workspace = true } + +[lints] +workspace = true diff --git a/crates/trigger/src/factors.rs b/crates/runtime-factors/src/lib.rs similarity index 100% rename from crates/trigger/src/factors.rs rename to crates/runtime-factors/src/lib.rs diff --git a/crates/trigger-http/Cargo.toml b/crates/trigger-http/Cargo.toml index 77366baeae..05d66dbf33 100644 --- a/crates/trigger-http/Cargo.toml +++ b/crates/trigger-http/Cargo.toml @@ -7,11 +7,6 @@ edition = { workspace = true } [lib] doctest = false -[features] -llm = ["spin-trigger/llm"] -llm-metal = ["spin-trigger/llm-metal"] -llm-cublas = ["spin-trigger/llm-cublas"] - [dependencies] anyhow = "1.0" async-trait = "0.1" diff --git a/crates/trigger/Cargo.toml b/crates/trigger/Cargo.toml index 66fb9a7646..d4cef028bd 100644 --- a/crates/trigger/Cargo.toml +++ b/crates/trigger/Cargo.toml @@ -8,11 +8,6 @@ homepage.workspace = true repository.workspace = true rust-version.workspace = true -[features] -llm = ["spin-factor-llm/llm"] -llm-metal = ["spin-factor-llm/llm-metal"] -llm-cublas = ["spin-factor-llm/llm-cublas"] - [dependencies] anyhow = "1" clap = { version = "3.1.18", features = ["derive", "env"] } @@ -27,21 +22,12 @@ spin-componentize = { path = "../componentize" } spin-compose = { path = "../compose" } spin-core = { path = "../core" } spin-factor-key-value = { path = "../factor-key-value" } -spin-factor-llm = { path = "../factor-llm" } -spin-factor-outbound-http = { path = "../factor-outbound-http" } -spin-factor-outbound-mqtt = { path = "../factor-outbound-mqtt" } -spin-factor-outbound-mysql = { path = "../factor-outbound-mysql" } -spin-factor-outbound-networking = { path = "../factor-outbound-networking" } -spin-factor-outbound-pg = { path = "../factor-outbound-pg" } -spin-factor-outbound-redis = { path = "../factor-outbound-redis" } spin-factor-sqlite = { path = "../factor-sqlite" } -spin-factor-variables = { path = "../factor-variables" } spin-factor-wasi = { path = "../factor-wasi" } spin-factors = { path = "../factors" } spin-factors-executor = { path = "../factors-executor" } spin-runtime-config = { path = "../runtime-config" } spin-telemetry = { path = "../telemetry" } -terminal = { path = "../terminal" } tokio = { version = "1.23", features = ["fs", "rt"] } toml = "0.8" tracing = { workspace = true } diff --git a/crates/trigger/src/cli.rs b/crates/trigger/src/cli.rs index 869f97e8c8..2bf8c1a891 100644 --- a/crates/trigger/src/cli.rs +++ b/crates/trigger/src/cli.rs @@ -1,11 +1,11 @@ mod launch_metadata; mod sqlite_statements; +mod stdio; mod summary; use std::future::Future; use std::path::PathBuf; -pub use crate::stdio::StdioLoggingExecutorHooks; use anyhow::{Context, Result}; use clap::{Args, IntoApp, Parser}; use spin_app::App; @@ -15,12 +15,13 @@ use spin_common::url::parse_file_url; use spin_core::async_trait; use spin_factors::RuntimeFactors; use spin_factors_executor::{ComponentLoader, FactorsExecutor}; -pub use sqlite_statements::SqlStatementExecutorHook; -pub use summary::KeyValueDefaultStoreSummaryHook; -use crate::stdio::FollowComponents; use crate::{Trigger, TriggerApp}; pub use launch_metadata::LaunchMetadata; +pub use sqlite_statements::SqlStatementExecutorHook; +use stdio::FollowComponents; +pub use stdio::StdioLoggingExecutorHooks; +pub use summary::KeyValueDefaultStoreSummaryHook; pub const APP_LOG_DIR: &str = "APP_LOG_DIR"; pub const DISABLE_WASMTIME_CACHE: &str = "DISABLE_WASMTIME_CACHE"; diff --git a/crates/trigger/src/stdio.rs b/crates/trigger/src/cli/stdio.rs similarity index 96% rename from crates/trigger/src/stdio.rs rename to crates/trigger/src/cli/stdio.rs index 87a7b5b30f..212168f72a 100644 --- a/crates/trigger/src/stdio.rs +++ b/crates/trigger/src/cli/stdio.rs @@ -7,11 +7,11 @@ use std::{ use anyhow::{Context, Result}; use spin_common::ui::quoted_path; use spin_core::async_trait; +use spin_factor_wasi::WasiFactor; +use spin_factors::{HasInstanceBuilder, RuntimeFactors}; use spin_factors_executor::ExecutorHooks; use tokio::io::AsyncWrite; -use crate::factors::TriggerFactors; - /// Which components should have their logs followed on stdout/stderr. #[derive(Clone, Debug, Default)] pub enum FollowComponents { @@ -89,10 +89,10 @@ impl StdioLoggingExecutorHooks { } #[async_trait] -impl ExecutorHooks for StdioLoggingExecutorHooks { +impl ExecutorHooks for StdioLoggingExecutorHooks { async fn configure_app( &mut self, - configured_app: &spin_factors::ConfiguredApp, + configured_app: &spin_factors::ConfiguredApp, ) -> anyhow::Result<()> { self.validate_follows(configured_app.app())?; if let Some(dir) = &self.log_dir { @@ -107,10 +107,12 @@ impl ExecutorHooks for StdioLoggingExecutorHooks { fn prepare_instance( &self, - builder: &mut spin_factors_executor::FactorsInstanceBuilder, + builder: &mut spin_factors_executor::FactorsInstanceBuilder, ) -> anyhow::Result<()> { let component_id = builder.app_component().id().to_string(); - let wasi_builder = builder.factor_builders().wasi(); + let Some(wasi_builder) = builder.factor_builders().for_factor::() else { + return Ok(()); + }; wasi_builder.stdout_pipe(self.component_stdio_writer( &component_id, "stdout", diff --git a/crates/trigger/src/cli/summary.rs b/crates/trigger/src/cli/summary.rs index f8e21eb39a..b7f98b9d92 100644 --- a/crates/trigger/src/cli/summary.rs +++ b/crates/trigger/src/cli/summary.rs @@ -4,6 +4,7 @@ use spin_common::ui::quoted_path; use spin_core::async_trait; use spin_factor_key_value::KeyValueFactor; use spin_factor_sqlite::SqliteFactor; +use spin_factors::RuntimeFactors; use spin_factors_executor::ExecutorHooks; use spin_runtime_config::ResolvedRuntimeConfig; use toml::Value; @@ -51,10 +52,10 @@ pub fn summarize_runtime_config( pub struct KeyValueDefaultStoreSummaryHook; #[async_trait] -impl ExecutorHooks for KeyValueDefaultStoreSummaryHook { +impl ExecutorHooks for KeyValueDefaultStoreSummaryHook { async fn configure_app( &mut self, - configured_app: &spin_factors::ConfiguredApp, + configured_app: &spin_factors::ConfiguredApp, ) -> anyhow::Result<()> { let Ok(kv_app_state) = configured_app.app_state::() else { return Ok(()); diff --git a/crates/trigger/src/lib.rs b/crates/trigger/src/lib.rs index 8427a0a5db..d3720f82c5 100644 --- a/crates/trigger/src/lib.rs +++ b/crates/trigger/src/lib.rs @@ -1,6 +1,4 @@ pub mod cli; -mod factors; -mod stdio; use std::future::Future; @@ -9,7 +7,6 @@ use spin_core::Linker; use spin_factors::RuntimeFactors; use spin_factors_executor::{FactorsExecutorApp, FactorsInstanceBuilder}; -pub use factors::*; pub use spin_app::App; /// Type alias for a [`FactorsExecutorApp`] specialized to a [`Trigger`]. diff --git a/examples/spin-timer/Cargo.lock b/examples/spin-timer/Cargo.lock index fb8c3ba3c2..b6b09dec64 100644 --- a/examples/spin-timer/Cargo.lock +++ b/examples/spin-timer/Cargo.lock @@ -23,6 +23,23 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" +[[package]] +name = "adler32" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" + +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + [[package]] name = "ahash" version = "0.8.11" @@ -35,6 +52,15 @@ dependencies = [ "zerocopy", ] +[[package]] +name = "aho-corasick" +version = "0.7.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" +dependencies = [ + "memchr", +] + [[package]] name = "aho-corasick" version = "1.1.3" @@ -71,18 +97,104 @@ dependencies = [ "libc", ] +[[package]] +name = "ansi_term" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" +dependencies = [ + "winapi", +] + +[[package]] +name = "anstream" +version = "0.6.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" + +[[package]] +name = "anstyle-parse" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" +dependencies = [ + "anstyle", + "windows-sys 0.52.0", +] + [[package]] name = "anyhow" version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" +[[package]] +name = "anymap2" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d301b3b94cb4b2f23d7917810addbbaff90738e0ca2be692bd027e70d7e0330c" + [[package]] name = "arbitrary" version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" +[[package]] +name = "arc-swap" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457" + +[[package]] +name = "arrayvec" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" + +[[package]] +name = "async-broadcast" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c48ccdbf6ca6b121e0f586cbc0e73ae440e56c67c30fa0873b4e110d9c26d2b" +dependencies = [ + "event-listener 2.5.3", + "futures-core", +] + [[package]] name = "async-channel" version = "1.9.0" @@ -119,23 +231,92 @@ dependencies = [ "tokio", ] +[[package]] +name = "async-executor" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7ebdfa2ebdab6b1760375fa7d6f382b9f486eac35fc994625a00e89280bdbb7" +dependencies = [ + "async-task", + "concurrent-queue", + "fastrand 2.1.1", + "futures-lite 2.3.0", + "slab", +] + +[[package]] +name = "async-fs" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "279cf904654eeebfa37ac9bb1598880884924aab82e290aa65c9e77a0e142e06" +dependencies = [ + "async-lock 2.8.0", + "autocfg", + "blocking", + "futures-lite 1.13.0", +] + +[[package]] +name = "async-global-executor" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" +dependencies = [ + "async-channel 2.3.1", + "async-executor", + "async-io 2.3.4", + "async-lock 3.4.0", + "blocking", + "futures-lite 2.3.0", + "once_cell", +] + [[package]] name = "async-io" -version = "2.3.3" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" +dependencies = [ + "async-lock 2.8.0", + "autocfg", + "cfg-if", + "concurrent-queue", + "futures-lite 1.13.0", + "log", + "parking", + "polling 2.8.0", + "rustix 0.37.27", + "slab", + "socket2 0.4.10", + "waker-fn", +] + +[[package]] +name = "async-io" +version = "2.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d6baa8f0178795da0e71bc42c9e5d13261aac7ee549853162e66a241ba17964" +checksum = "444b0228950ee6501b3568d3c93bf1176a1fdbc3b758dcd9475046d30f4dc7e8" dependencies = [ - "async-lock", + "async-lock 3.4.0", "cfg-if", "concurrent-queue", "futures-io", "futures-lite 2.3.0", "parking", - "polling", - "rustix", + "polling 3.7.3", + "rustix 0.38.35", "slab", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.59.0", +] + +[[package]] +name = "async-lock" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" +dependencies = [ + "event-listener 2.5.3", ] [[package]] @@ -149,42 +330,106 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "async-priority-channel" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c21678992e1b21bebfe2bc53ab5f5f68c106eddab31b24e0bb06e9b715a86640" +dependencies = [ + "event-listener 2.5.3", +] + +[[package]] +name = "async-process" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea6438ba0a08d81529c69b36700fa2f95837bfe3e776ab39cde9c14d9149da88" +dependencies = [ + "async-io 1.13.0", + "async-lock 2.8.0", + "async-signal", + "blocking", + "cfg-if", + "event-listener 3.1.0", + "futures-lite 1.13.0", + "rustix 0.38.35", + "windows-sys 0.48.0", +] + [[package]] name = "async-process" -version = "2.2.3" +version = "2.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7eda79bbd84e29c2b308d1dc099d7de8dcc7035e48f4bf5dc4a531a44ff5e2a" +checksum = "a8a07789659a4d385b79b18b9127fc27e1a59e1e89117c78c5ea3b806f016374" dependencies = [ "async-channel 2.3.1", - "async-io", - "async-lock", + "async-io 2.3.4", + "async-lock 3.4.0", "async-signal", "async-task", "blocking", "cfg-if", "event-listener 5.3.1", "futures-lite 2.3.0", - "rustix", + "rustix 0.38.35", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.59.0", +] + +[[package]] +name = "async-recursion" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.76", ] [[package]] name = "async-signal" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfb3634b73397aa844481f814fad23bbf07fdb0eabec10f2eb95e58944b1ec32" +checksum = "637e00349800c0bdf8bfc21ebbc0b6524abea702b0da4168ac00d070d0c0b9f3" dependencies = [ - "async-io", - "async-lock", + "async-io 2.3.4", + "async-lock 3.4.0", "atomic-waker", "cfg-if", "futures-core", "futures-io", - "rustix", + "rustix 0.38.35", "signal-hook-registry", "slab", - "windows-sys 0.52.0", + "windows-sys 0.59.0", +] + +[[package]] +name = "async-std" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d" +dependencies = [ + "async-channel 1.9.0", + "async-global-executor", + "async-io 1.13.0", + "async-lock 2.8.0", + "async-process 1.8.1", + "crossbeam-utils", + "futures-channel", + "futures-core", + "futures-io", + "futures-lite 1.13.0", + "gloo-timers", + "kv-log-macro", + "log", + "memchr", + "once_cell", + "pin-project-lite", + "pin-utils", + "slab", + "wasm-bindgen-futures", ] [[package]] @@ -206,7 +451,20 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", +] + +[[package]] +name = "async-tar" +version = "0.4.2" +source = "git+https://github.com/vdice/async-tar?rev=71e037f9652971e7a55b412a8e47a37b06f9c29d#71e037f9652971e7a55b412a8e47a37b06f9c29d" +dependencies = [ + "async-std", + "filetime", + "libc", + "pin-project", + "redox_syscall 0.2.16", + "xattr 0.2.3", ] [[package]] @@ -217,15 +475,21 @@ checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" [[package]] name = "async-trait" -version = "0.1.77" +version = "0.1.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" +checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] +[[package]] +name = "atomic-take" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8ab6b55fe97976e46f91ddbed8d147d966475dc29b2032757ba47e02376fbc3" + [[package]] name = "atomic-waker" version = "1.1.2" @@ -249,6 +513,33 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +[[package]] +name = "aws-lc-rs" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ae74d9bd0a7530e8afd1770739ad34b36838829d6ad61818f9230f683f5ad77" +dependencies = [ + "aws-lc-sys", + "mirai-annotations", + "paste", + "zeroize", +] + +[[package]] +name = "aws-lc-sys" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f0e249228c6ad2d240c2dc94b714d711629d52bad946075d8e9b2f5391f0703" +dependencies = [ + "bindgen 0.69.4", + "cc", + "cmake", + "dunce", + "fs_extra", + "libc", + "paste", +] + [[package]] name = "axum" version = "0.6.20" @@ -270,7 +561,7 @@ dependencies = [ "percent-encoding", "pin-project-lite", "rustversion", - "serde", + "serde 1.0.203", "sync_wrapper 0.1.2", "tower", "tower-layer", @@ -297,7 +588,7 @@ dependencies = [ [[package]] name = "azure_core" version = "0.20.0" -source = "git+https://github.com/azure/azure-sdk-for-rust?rev=8c4caa251c3903d5eae848b41bb1d02a4d65231c#8c4caa251c3903d5eae848b41bb1d02a4d65231c" +source = "git+https://github.com/azure/azure-sdk-for-rust.git?rev=8c4caa251c3903d5eae848b41bb1d02a4d65231c#8c4caa251c3903d5eae848b41bb1d02a4d65231c" dependencies = [ "async-trait", "base64 0.22.1", @@ -305,15 +596,35 @@ dependencies = [ "dyn-clone", "futures", "getrandom 0.2.12", + "hmac", "http-types", "once_cell", "paste", "pin-project", "rand 0.8.5", - "reqwest 0.12.5", + "reqwest 0.12.7", "rustc_version", - "serde", + "serde 1.0.203", + "serde_json", + "sha2", + "time", + "tracing", + "url", + "uuid", +] + +[[package]] +name = "azure_data_cosmos" +version = "0.20.0" +source = "git+https://github.com/azure/azure-sdk-for-rust.git?rev=8c4caa251c3903d5eae848b41bb1d02a4d65231c#8c4caa251c3903d5eae848b41bb1d02a4d65231c" +dependencies = [ + "async-trait", + "azure_core", + "bytes", + "futures", + "serde 1.0.203", "serde_json", + "thiserror", "time", "tracing", "url", @@ -323,16 +634,16 @@ dependencies = [ [[package]] name = "azure_identity" version = "0.20.0" -source = "git+https://github.com/azure/azure-sdk-for-rust?rev=8c4caa251c3903d5eae848b41bb1d02a4d65231c#8c4caa251c3903d5eae848b41bb1d02a4d65231c" +source = "git+https://github.com/azure/azure-sdk-for-rust.git?rev=8c4caa251c3903d5eae848b41bb1d02a4d65231c#8c4caa251c3903d5eae848b41bb1d02a4d65231c" dependencies = [ - "async-lock", - "async-process", + "async-lock 3.4.0", + "async-process 2.2.4", "async-trait", "azure_core", "futures", "oauth2", "pin-project", - "serde", + "serde 1.0.203", "time", "tracing", "tz-rs", @@ -343,12 +654,12 @@ dependencies = [ [[package]] name = "azure_security_keyvault" version = "0.20.0" -source = "git+https://github.com/azure/azure-sdk-for-rust?rev=8c4caa251c3903d5eae848b41bb1d02a4d65231c#8c4caa251c3903d5eae848b41bb1d02a4d65231c" +source = "git+https://github.com/azure/azure-sdk-for-rust.git?rev=8c4caa251c3903d5eae848b41bb1d02a4d65231c#8c4caa251c3903d5eae848b41bb1d02a4d65231c" dependencies = [ "async-trait", "azure_core", "futures", - "serde", + "serde 1.0.203", "serde_json", "time", ] @@ -368,6 +679,12 @@ dependencies = [ "rustc-demangle", ] +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + [[package]] name = "base64" version = "0.13.1" @@ -386,6 +703,41 @@ version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" +[[package]] +name = "base64ct" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + +[[package]] +name = "beef" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a8241f3ebb85c056b509d4327ad0358fbbba6ffb340bf388f26350aeda225b1" + +[[package]] +name = "bindgen" +version = "0.69.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0" +dependencies = [ + "bitflags 2.4.2", + "cexpr", + "clang-sys", + "itertools 0.12.1", + "lazy_static 1.5.0", + "lazycell", + "log", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn 2.0.76", + "which", +] + [[package]] name = "bindgen" version = "0.70.1" @@ -395,13 +747,13 @@ dependencies = [ "bitflags 2.4.2", "cexpr", "clang-sys", - "itertools", + "itertools 0.12.1", "proc-macro2", "quote", "regex", "rustc-hash", "shlex", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -416,6 +768,15 @@ version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" +[[package]] +name = "bitmaps" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "031043d04099746d8db04daf1fa424b2bc8bd69d92b25962dcde24da39ab64a2" +dependencies = [ + "typenum", +] + [[package]] name = "block-buffer" version = "0.10.4" @@ -426,8 +787,17 @@ dependencies = [ ] [[package]] -name = "blocking" -version = "1.6.1" +name = "block-padding" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8894febbff9f758034a5b8e12d87918f56dfc64a8e1fe757d65e29041538d93" +dependencies = [ + "generic-array", +] + +[[package]] +name = "blocking" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "703f41c54fc768e63e091340b424302bb1c29ef4aa0c7f10fe849dfb114d29ea" dependencies = [ @@ -438,13 +808,24 @@ dependencies = [ "piper", ] +[[package]] +name = "bstr" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40723b8fb387abc38f4f4a37c09073622e41dd12327033091ef8950659e6dc0c" +dependencies = [ + "memchr", + "regex-automata 0.4.7", + "serde 1.0.203", +] + [[package]] name = "btoi" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9dd6407f73a9b8b6162d8a2ef999fe6afd7cc15902ebf42c5cd296addf17e0ad" dependencies = [ - "num-traits", + "num-traits 0.2.19", ] [[package]] @@ -453,6 +834,12 @@ version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" +[[package]] +name = "bytemuck" +version = "1.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773d90827bc3feecfb67fab12e24de0749aad83c74b9504ecde46237b5cd24e2" + [[package]] name = "byteorder" version = "1.5.0" @@ -461,47 +848,254 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.5.0" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" +dependencies = [ + "serde 1.0.203", +] + +[[package]] +name = "bzip2" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8" +dependencies = [ + "bzip2-sys", + "libc", +] + +[[package]] +name = "bzip2-sys" +version = "0.1.11+1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + +[[package]] +name = "cached-path" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "097968e38f1319207f057d0f4d76452e4f4f847a5de61c5215379f297fa034f3" +dependencies = [ + "flate2", + "fs2", + "glob", + "indicatif 0.16.2", + "log", + "rand 0.8.5", + "reqwest 0.11.27", + "serde 1.0.203", + "serde_json", + "sha2", + "tar", + "tempfile", + "thiserror", + "zip", +] + +[[package]] +name = "camino" +version = "1.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" +dependencies = [ + "serde 1.0.203", +] + +[[package]] +name = "candle-core" +version = "0.1.0" +source = "git+https://github.com/huggingface/candle?rev=b80348d22f8f0dadb6cc4101bde031d5de69a9a5#b80348d22f8f0dadb6cc4101bde031d5de69a9a5" +dependencies = [ + "byteorder", + "candle-gemm", + "half", + "memmap2 0.7.1", + "num-traits 0.2.19", + "num_cpus", + "rand 0.8.5", + "safetensors", + "thiserror", + "zip", +] + +[[package]] +name = "candle-gemm" +version = "0.15.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b726a1f6cdd7ff080e95e3d91694701b1e04a58acd198e4a78c39428b2274e" +dependencies = [ + "candle-gemm-c32", + "candle-gemm-c64", + "candle-gemm-common", + "candle-gemm-f16", + "candle-gemm-f32", + "candle-gemm-f64", + "dyn-stack", + "lazy_static 1.5.0", + "num-complex", + "num-traits 0.2.19", + "paste", + "raw-cpuid", + "rayon", + "seq-macro", +] + +[[package]] +name = "candle-gemm-c32" +version = "0.15.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "661470663389f0c99fd8449e620bfae630a662739f830a323eda4dcf80888843" +dependencies = [ + "candle-gemm-common", + "dyn-stack", + "lazy_static 1.5.0", + "num-complex", + "num-traits 0.2.19", + "paste", + "raw-cpuid", + "rayon", + "seq-macro", +] + +[[package]] +name = "candle-gemm-c64" +version = "0.15.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a111ddf61db562854a6d2ff4dfe1e8a84066431b7bc68d3afae4bf60874fda0" +dependencies = [ + "candle-gemm-common", + "dyn-stack", + "lazy_static 1.5.0", + "num-complex", + "num-traits 0.2.19", + "paste", + "raw-cpuid", + "rayon", + "seq-macro", +] + +[[package]] +name = "candle-gemm-common" +version = "0.15.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6dd93783ead7eeef14361667ea32014dc6f716a2fc956b075fe78729e10dd5" +dependencies = [ + "dyn-stack", + "lazy_static 1.5.0", + "num-complex", + "num-traits 0.2.19", + "paste", + "raw-cpuid", + "rayon", + "seq-macro", +] + +[[package]] +name = "candle-gemm-f16" +version = "0.15.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +checksum = "b76499bf4b858cacc526c5c8f948bc7152774247dce8568f174b743ab1363fa4" +dependencies = [ + "candle-gemm-common", + "candle-gemm-f32", + "dyn-stack", + "half", + "lazy_static 1.5.0", + "num-complex", + "num-traits 0.2.19", + "paste", + "raw-cpuid", + "rayon", + "seq-macro", +] + +[[package]] +name = "candle-gemm-f32" +version = "0.15.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bec152e7d36339d3785e0d746d75ee94a4e92968fbb12ddcc91b536b938d016" +dependencies = [ + "candle-gemm-common", + "dyn-stack", + "lazy_static 1.5.0", + "num-complex", + "num-traits 0.2.19", + "paste", + "raw-cpuid", + "rayon", + "seq-macro", +] + +[[package]] +name = "candle-gemm-f64" +version = "0.15.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00f59ac68a5521e2ff71431bb7f1b22126ff0b60c5e66599b1f4676433da6e69" +dependencies = [ + "candle-gemm-common", + "dyn-stack", + "lazy_static 1.5.0", + "num-complex", + "num-traits 0.2.19", + "paste", + "raw-cpuid", + "rayon", + "seq-macro", +] + +[[package]] +name = "candle-nn" +version = "0.1.0" +source = "git+https://github.com/huggingface/candle?rev=b80348d22f8f0dadb6cc4101bde031d5de69a9a5#b80348d22f8f0dadb6cc4101bde031d5de69a9a5" +dependencies = [ + "candle-core", + "safetensors", + "thiserror", +] [[package]] name = "cap-fs-ext" -version = "3.0.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "769f8cd02eb04d57f14e2e371ebb533f96817f9b2525d73a5c72b61ca7973747" +checksum = "eb23061fc1c4ead4e45ca713080fe768e6234e959f5a5c399c39eb41aa34e56e" dependencies = [ "cap-primitives", "cap-std", - "io-lifetimes", + "io-lifetimes 2.0.3", "windows-sys 0.52.0", ] [[package]] name = "cap-net-ext" -version = "3.0.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59ff6d3fb274292a9af283417e383afe6ded1fe66f6472d2c781216d3d80c218" +checksum = "f83ae11f116bcbafc5327c6af250341db96b5930046732e1905f7dc65887e0e1" dependencies = [ "cap-primitives", "cap-std", - "rustix", + "rustix 0.38.35", "smallvec", ] [[package]] name = "cap-primitives" -version = "3.0.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90a0b44fc796b1a84535a63753d50ba3972c4db55c7255c186f79140e63d56d0" +checksum = "6d00bd8d26c4270d950eaaa837387964a2089a1c3c349a690a1fa03221d29531" dependencies = [ "ambient-authority", "fs-set-times", "io-extras", - "io-lifetimes", + "io-lifetimes 2.0.3", "ipnet", "maybe-owned", - "rustix", + "rustix 0.38.35", "windows-sys 0.52.0", "winx", ] @@ -518,30 +1112,70 @@ dependencies = [ [[package]] name = "cap-std" -version = "3.0.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266626ce180cf9709f317d0bf9754e3a5006359d87f4bf792f06c9c5f1b63c0f" +checksum = "19eb8e3d71996828751c1ed3908a439639752ac6bdc874e41469ef7fc15fbd7f" dependencies = [ "cap-primitives", "io-extras", - "io-lifetimes", - "rustix", + "io-lifetimes 2.0.3", + "rustix 0.38.35", ] [[package]] name = "cap-time-ext" -version = "3.0.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1353421ba83c19da60726e35db0a89abef984b3be183ff6f58c5b8084fcd0c5" +checksum = "61142dc51e25b7acc970ca578ce2c3695eac22bbba46c1073f5f583e78957725" dependencies = [ "ambient-authority", "cap-primitives", "iana-time-zone", "once_cell", - "rustix", + "rustix 0.38.35", "winx", ] +[[package]] +name = "cargo-platform" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24b1f0365a6c6bb4020cd05806fd0d33c44d38046b8bd7f0e40814b9763cabfc" +dependencies = [ + "serde 1.0.203", +] + +[[package]] +name = "cargo-target-dep" +version = "0.1.0" +source = "git+https://github.com/fermyon/cargo-target-dep?rev=482f269eceb7b1a7e8fc618bf8c082dd24979cf1#482f269eceb7b1a7e8fc618bf8c082dd24979cf1" +dependencies = [ + "glob", +] + +[[package]] +name = "cargo_metadata" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" +dependencies = [ + "camino", + "cargo-platform", + "semver", + "serde 1.0.203", + "serde_json", + "thiserror", +] + +[[package]] +name = "cbc" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b52a9543ae338f279b96b0b9fed9c8093744685043739079ce85cd58f289a6" +dependencies = [ + "cipher", +] + [[package]] name = "cc" version = "1.0.99" @@ -559,7 +1193,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" dependencies = [ - "nom", + "nom 7.1.3", ] [[package]] @@ -583,10 +1217,20 @@ dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", - "num-traits", - "serde", + "num-traits 0.2.19", + "serde 1.0.203", "wasm-bindgen", - "windows-targets 0.52.5", + "windows-targets 0.52.6", +] + +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", ] [[package]] @@ -608,28 +1252,62 @@ checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" dependencies = [ "atty", "bitflags 1.3.2", - "clap_derive", - "clap_lex", + "clap_derive 3.2.25", + "clap_lex 0.2.4", "indexmap 1.9.3", "once_cell", - "strsim", + "strsim 0.10.0", "termcolor", "textwrap", ] +[[package]] +name = "clap" +version = "4.5.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed6719fffa43d0d87e5fd8caeab59be1554fb028cd30edc88fc4369b17971019" +dependencies = [ + "clap_builder", + "clap_derive 4.5.13", +] + +[[package]] +name = "clap_builder" +version = "4.5.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "216aec2b177652e3846684cbfe25c9964d18ec45234f0f5da5157b207ed1aab6" +dependencies = [ + "anstream", + "anstyle", + "clap_lex 0.7.2", + "strsim 0.11.1", +] + [[package]] name = "clap_derive" version = "3.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae6371b8bdc8b7d3959e9cf7b22d4435ef3e79e138688421ec654acf8c81b008" dependencies = [ - "heck", + "heck 0.4.1", "proc-macro-error", "proc-macro2", "quote", "syn 1.0.109", ] +[[package]] +name = "clap_derive" +version = "4.5.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0" +dependencies = [ + "heck 0.5.0", + "proc-macro2", + "quote", + "syn 2.0.76", +] + [[package]] name = "clap_lex" version = "0.2.4" @@ -639,6 +1317,25 @@ dependencies = [ "os_str_bytes", ] +[[package]] +name = "clap_lex" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" + +[[package]] +name = "clearscreen" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72f3f22f1a586604e62efd23f78218f3ccdecf7a33c4500db2d37d85a24fe994" +dependencies = [ + "nix 0.26.4", + "terminfo", + "thiserror", + "which", + "winapi", +] + [[package]] name = "cmake" version = "0.1.51" @@ -654,6 +1351,12 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" +[[package]] +name = "colorchoice" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" + [[package]] name = "combine" version = "4.6.7" @@ -665,7 +1368,31 @@ dependencies = [ "memchr", "pin-project-lite", "tokio", - "tokio-util", + "tokio-util 0.7.11", +] + +[[package]] +name = "comfy-table" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b103d85ca6e209388771bfb7aa6b68a7aeec4afbf6f0a0264bfbf50360e5212e" +dependencies = [ + "crossterm", + "strum", + "strum_macros", + "unicode-width", +] + +[[package]] +name = "command-group" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5080df6b0f0ecb76cab30808f00d937ba725cebe266a3da8cd89dff92f2a9916" +dependencies = [ + "async-trait", + "nix 0.26.4", + "tokio", + "winapi", ] [[package]] @@ -677,12 +1404,53 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "config" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b1b9d958c2b1368a663f05538fc1b5975adce1e19f435acceae987aceeeb369" +dependencies = [ + "lazy_static 1.5.0", + "nom 5.1.3", + "rust-ini", + "serde 1.0.203", + "serde-hjson", + "serde_json", + "toml 0.5.11", + "yaml-rust", +] + +[[package]] +name = "console" +version = "0.15.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" +dependencies = [ + "encode_unicode", + "lazy_static 1.5.0", + "libc", + "unicode-width", + "windows-sys 0.52.0", +] + +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + [[package]] name = "const_fn" version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "373e9fafaa20882876db20562275ff58d50e0caa2590077fe7ce7bef90211d0d" +[[package]] +name = "constant_time_eq" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" + [[package]] name = "core-foundation" version = "0.9.4" @@ -778,7 +1546,7 @@ version = "0.109.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8cfdc315e5d18997093e040a8d234bea1ac1e118a716d3e30f40d449e78207b" dependencies = [ - "serde", + "serde 1.0.203", "serde_derive", ] @@ -820,7 +1588,7 @@ dependencies = [ "cranelift-codegen", "cranelift-entity", "cranelift-frontend", - "itertools", + "itertools 0.12.1", "log", "smallvec", "wasmparser 0.209.1", @@ -893,38 +1661,91 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" [[package]] -name = "crypto-common" -version = "0.1.6" +name = "crossterm" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +checksum = "a2102ea4f781910f8a5b98dd061f4c2023f479ce7bb1236330099ceb5a93cf17" dependencies = [ - "generic-array", - "typenum", + "bitflags 1.3.2", + "crossterm_winapi", + "libc", + "mio 0.8.11", + "parking_lot", + "signal-hook", + "signal-hook-mio", + "winapi", ] [[package]] -name = "ctrlc" -version = "3.4.4" +name = "crossterm_winapi" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "672465ae37dc1bc6380a6547a8883d5dd397b0f1faaad4f265726cc7042a5345" +checksum = "acdd7c62a3665c7f6830a51635d9ac9b23ed385797f70a83bb8bafe9c572ab2b" dependencies = [ - "nix", - "windows-sys 0.52.0", + "winapi", ] [[package]] -name = "darling" -version = "0.14.4" +name = "crunchy" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" -dependencies = [ - "darling_core", - "darling_macro", -] +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] -name = "darling_core" -version = "0.14.4" +name = "crypto-bigint" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +dependencies = [ + "generic-array", + "rand_core 0.6.4", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "ctrlc" +version = "3.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "672465ae37dc1bc6380a6547a8883d5dd397b0f1faaad4f265726cc7042a5345" +dependencies = [ + "nix 0.28.0", + "windows-sys 0.52.0", +] + +[[package]] +name = "darling" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" +dependencies = [ + "darling_core 0.14.4", + "darling_macro 0.14.4", +] + +[[package]] +name = "darling" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +dependencies = [ + "darling_core 0.20.10", + "darling_macro 0.20.10", +] + +[[package]] +name = "darling_core" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" dependencies = [ @@ -932,21 +1753,46 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim", + "strsim 0.10.0", "syn 1.0.109", ] +[[package]] +name = "darling_core" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim 0.11.1", + "syn 2.0.76", +] + [[package]] name = "darling_macro" version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" dependencies = [ - "darling_core", + "darling_core 0.14.4", "quote", "syn 1.0.109", ] +[[package]] +name = "darling_macro" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +dependencies = [ + "darling_core 0.20.10", + "quote", + "syn 2.0.76", +] + [[package]] name = "debugid" version = "0.8.0" @@ -956,6 +1802,17 @@ dependencies = [ "uuid", ] +[[package]] +name = "der" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +dependencies = [ + "const-oid", + "pem-rfc7468", + "zeroize", +] + [[package]] name = "deranged" version = "0.3.11" @@ -963,7 +1820,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" dependencies = [ "powerfmt", - "serde", + "serde 1.0.203", +] + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] @@ -972,7 +1840,16 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d07adf7be193b71cc36b193d0f5fe60b918a3a9db4dad0449f57bcfd519704a3" dependencies = [ - "derive_builder_macro", + "derive_builder_macro 0.11.2", +] + +[[package]] +name = "derive_builder" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d67778784b508018359cbc8696edb3db78160bab2c2a28ba7f56ef6932997f8" +dependencies = [ + "derive_builder_macro 0.12.0", ] [[package]] @@ -981,7 +1858,19 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f91d4cfa921f1c05904dc3c57b4a32c38aed3340cce209f3a6fd1478babafc4" dependencies = [ - "darling", + "darling 0.14.4", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_builder_core" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c11bdc11a0c47bc7d37d582b5285da6849c96681023680b906673c5707af7b0f" +dependencies = [ + "darling 0.14.4", "proc-macro2", "quote", "syn 1.0.109", @@ -993,10 +1882,45 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f0314b72bed045f3a68671b3c86328386762c93f82d98c65c3cb5e5f573dd68" dependencies = [ - "derive_builder_core", + "derive_builder_core 0.11.2", + "syn 1.0.109", +] + +[[package]] +name = "derive_builder_macro" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebcda35c7a396850a55ffeac740804b40ffec779b98fffbb1738f4033f0ee79e" +dependencies = [ + "derive_builder_core 0.12.0", "syn 1.0.109", ] +[[package]] +name = "dialoguer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59c6f2989294b9a498d3ad5491a79c6deb604617378e1cdc4bfc1c1361fe2f87" +dependencies = [ + "console", + "shell-words", + "tempfile", + "zeroize", +] + +[[package]] +name = "dialoguer" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "658bce805d770f407bc62102fca7c2c64ceef2fbcb2b8bd19d2765ce093980de" +dependencies = [ + "console", + "shell-words", + "tempfile", + "thiserror", + "zeroize", +] + [[package]] name = "digest" version = "0.10.7" @@ -1004,10 +1928,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer", + "const-oid", "crypto-common", "subtle", ] +[[package]] +name = "directories" +version = "4.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f51c5d4ddabd36886dd3e1438cb358cdcb0d7c499cb99cb4ac2e38e18b5cb210" +dependencies = [ + "dirs-sys 0.3.7", +] + [[package]] name = "directories-next" version = "2.0.0" @@ -1018,6 +1952,15 @@ dependencies = [ "dirs-sys-next", ] +[[package]] +name = "dirs" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30baa043103c9d0c2a57cf537cc2f35623889dc0d405e6c3cccfadbc81c71309" +dependencies = [ + "dirs-sys 0.3.7", +] + [[package]] name = "dirs" version = "4.0.0" @@ -1070,30 +2013,130 @@ dependencies = [ "winapi", ] +[[package]] +name = "dkregistry" +version = "0.5.1-alpha.0" +source = "git+https://github.com/fermyon/dkregistry-rs?rev=161cf2b66996ed97c7abaf046e38244484814de3#161cf2b66996ed97c7abaf046e38244484814de3" +dependencies = [ + "async-stream", + "base64 0.13.1", + "bytes", + "futures", + "libflate", + "log", + "mime", + "pin-project", + "regex", + "reqwest 0.11.27", + "serde 1.0.203", + "serde_ignored", + "serde_json", + "sha2", + "strum", + "strum_macros", + "tar", + "thiserror", + "tokio", + "url", +] + +[[package]] +name = "doc-comment" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" + +[[package]] +name = "docker_credential" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31951f49556e34d90ed28342e1df7e1cb7a229c4cab0aecc627b5d91edd41d07" +dependencies = [ + "base64 0.21.7", + "serde 1.0.203", + "serde_json", +] + [[package]] name = "dotenvy" version = "0.15.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" +[[package]] +name = "dunce" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" + [[package]] name = "dyn-clone" version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" +[[package]] +name = "dyn-stack" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fe7f8d7bcc523381d3c437b82cf74805de3931de0da69309ae0fe1bdf7a256e" +dependencies = [ + "bytemuck", + "reborrow", +] + +[[package]] +name = "ecdsa" +version = "0.16.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" +dependencies = [ + "der", + "digest", + "elliptic-curve", + "rfc6979", + "signature", + "spki", +] + [[package]] name = "either" version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "pem-rfc7468", + "pkcs8", + "rand_core 0.6.4", + "sec1", + "subtle", + "zeroize", +] + [[package]] name = "embedded-io" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef1a6892d9eef45c8fa6b9e0086428a2cca8491aca8f787c534a3d6d0bcb3ced" +[[package]] +name = "encode_unicode" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" + [[package]] name = "encoding_rs" version = "0.8.33" @@ -1103,6 +2146,27 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "enumflags2" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d232db7f5956f3f14313dc2f87985c58bd2c695ce124c8cdd984e08e15ac133d" +dependencies = [ + "enumflags2_derive", + "serde 1.0.203", +] + +[[package]] +name = "enumflags2_derive" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de0d48a183585823424a4ce1aa132d174a6a81bd540895822eb4c8373a8e49e8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.76", +] + [[package]] name = "equivalent" version = "1.0.1" @@ -1119,12 +2183,32 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "esaxx-rs" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d817e038c30374a4bcb22f94d0a8a0e216958d4c3dcde369b1439fec4bdda6e6" +dependencies = [ + "cc", +] + [[package]] name = "event-listener" version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" +[[package]] +name = "event-listener" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d93877bcde0eb80ca09131a08d23f0a5c18a620b01db137dba666d18cd9b30c2" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + [[package]] name = "event-listener" version = "5.3.1" @@ -1158,6 +2242,12 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" +[[package]] +name = "fallible-streaming-iterator" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" + [[package]] name = "fastrand" version = "1.9.0" @@ -1169,9 +2259,20 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.1.0" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" + +[[package]] +name = "fd-lock" +version = "3.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" +checksum = "ef033ed5e9bad94e55838ca0ca906db0e043f517adda0c8b79c7a8c66c93c1b5" +dependencies = [ + "cfg-if", + "rustix 0.38.35", + "windows-sys 0.48.0", +] [[package]] name = "fd-lock" @@ -1180,10 +2281,32 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7e5768da2206272c81ef0b5e951a41862938a6070da63bcea197899942d3b947" dependencies = [ "cfg-if", - "rustix", + "rustix 0.38.35", "windows-sys 0.52.0", ] +[[package]] +name = "ff" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +dependencies = [ + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "filetime" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" +dependencies = [ + "cfg-if", + "libc", + "libredox", + "windows-sys 0.59.0", +] + [[package]] name = "fixedbitset" version = "0.4.2" @@ -1192,9 +2315,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.32" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c0596c1eac1f9e04ed902702e9878208b336edc9d6fddc8a48387349bab3666" +checksum = "324a1be68054ef05ad64b861cc9eaf1d623d2d8cb25b4bf2cb9cdd902b4bf253" dependencies = [ "crc32fast", "miniz_oxide 0.8.0", @@ -1247,29 +2370,54 @@ version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "033b337d725b97690d86893f9de22b67b80dcc4e9ad815f348254c38119db8fb" dependencies = [ - "io-lifetimes", - "rustix", + "io-lifetimes 2.0.3", + "rustix 0.38.35", "windows-sys 0.52.0", ] [[package]] -name = "futures" -version = "0.3.30" +name = "fs2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", + "libc", + "winapi", ] [[package]] -name = "futures-channel" -version = "0.3.30" +name = "fs_extra" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" + +[[package]] +name = "fsevent-sys" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76ee7a02da4d231650c7cea31349b889be2f45ddb3ef3032d2ec8185f6313fd2" +dependencies = [ + "libc", +] + +[[package]] +name = "futures" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ @@ -1321,7 +2469,7 @@ version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" dependencies = [ - "fastrand 2.1.0", + "fastrand 2.1.1", "futures-core", "futures-io", "parking", @@ -1336,7 +2484,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -1387,7 +2535,7 @@ dependencies = [ "bitflags 2.4.2", "debugid", "fxhash", - "serde", + "serde 1.0.203", "serde_json", ] @@ -1399,6 +2547,7 @@ checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", + "zeroize", ] [[package]] @@ -1425,6 +2574,24 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "ggml" +version = "0.2.0-dev" +source = "git+https://github.com/rustformers/llm?rev=2f6ffd4435799ceaa1d1bcb5a8790e5b3e0c5663#2f6ffd4435799ceaa1d1bcb5a8790e5b3e0c5663" +dependencies = [ + "ggml-sys", + "memmap2 0.5.10", + "thiserror", +] + +[[package]] +name = "ggml-sys" +version = "0.2.0-dev" +source = "git+https://github.com/rustformers/llm?rev=2f6ffd4435799ceaa1d1bcb5a8790e5b3e0c5663#2f6ffd4435799ceaa1d1bcb5a8790e5b3e0c5663" +dependencies = [ + "cc", +] + [[package]] name = "gimli" version = "0.28.1" @@ -1436,12 +2603,274 @@ dependencies = [ "stable_deref_trait", ] +[[package]] +name = "gix-actor" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc22b0cdc52237667c301dd7cdc6ead8f8f73c9f824e9942c8ebd6b764f6c0bf" +dependencies = [ + "bstr", + "btoi", + "gix-date", + "itoa", + "nom 7.1.3", + "thiserror", +] + +[[package]] +name = "gix-config" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6aa7d7dd60256b7a0c0506a1d708ec92767c2662ee57b3301b538eaa3e064f8a" +dependencies = [ + "bstr", + "gix-config-value", + "gix-features 0.28.1", + "gix-glob", + "gix-path", + "gix-ref", + "gix-sec", + "memchr", + "nom 7.1.3", + "once_cell", + "smallvec", + "thiserror", + "unicode-bom", +] + +[[package]] +name = "gix-config-value" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d09154c0c8677e4da0ec35e896f56ee3e338e741b9599fae06075edd83a4081c" +dependencies = [ + "bitflags 1.3.2", + "bstr", + "gix-path", + "libc", + "thiserror", +] + +[[package]] +name = "gix-date" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b96271912ce39822501616f177dea7218784e6c63be90d5f36322ff3a722aae2" +dependencies = [ + "bstr", + "itoa", + "thiserror", + "time", +] + +[[package]] +name = "gix-features" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b76f9a80f6dd7be66442ae86e1f534effad9546676a392acc95e269d0c21c22" +dependencies = [ + "gix-hash 0.10.4", + "libc", + "sha1_smol", + "walkdir", +] + +[[package]] +name = "gix-features" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf69b0f5c701cc3ae22d3204b671907668f6437ca88862d355eaf9bc47a4f897" +dependencies = [ + "gix-hash 0.11.4", + "libc", +] + +[[package]] +name = "gix-fs" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b37a1832f691fdc09910bd267f9a2e413737c1f9ec68c6e31f9e802616278a9" +dependencies = [ + "gix-features 0.29.0", +] + +[[package]] +name = "gix-glob" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93e43efd776bc543f46f0fd0ca3d920c37af71a764a16f2aebd89765e9ff2993" +dependencies = [ + "bitflags 1.3.2", + "bstr", +] + +[[package]] +name = "gix-hash" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a258595457bc192d1f1c59d0d168a1e34e2be9b97a614e14995416185de41a7" +dependencies = [ + "hex", + "thiserror", +] + +[[package]] +name = "gix-hash" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b422ff2ad9a0628baaad6da468cf05385bf3f5ab495ad5a33cce99b9f41092f" +dependencies = [ + "hex", + "thiserror", +] + +[[package]] +name = "gix-lock" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c693d7f05730fa74a7c467150adc7cea393518410c65f0672f80226b8111555" +dependencies = [ + "gix-tempfile", + "gix-utils", + "thiserror", +] + +[[package]] +name = "gix-object" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df068db9180ee935fbb70504848369e270bdcb576b05c0faa8b9fd3b86fc017" +dependencies = [ + "bstr", + "btoi", + "gix-actor", + "gix-features 0.28.1", + "gix-hash 0.10.4", + "gix-validate", + "hex", + "itoa", + "nom 7.1.3", + "smallvec", + "thiserror", +] + +[[package]] +name = "gix-path" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32370dce200bb951df013e03dff35b4233fc7a89458642b047629b91734a7e19" +dependencies = [ + "bstr", + "thiserror", +] + +[[package]] +name = "gix-ref" +version = "0.27.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4e909396ed3b176823991ccc391c276ae2a015e54edaafa3566d35123cfac9d" +dependencies = [ + "gix-actor", + "gix-features 0.28.1", + "gix-hash 0.10.4", + "gix-lock", + "gix-object", + "gix-path", + "gix-tempfile", + "gix-validate", + "memmap2 0.5.10", + "nom 7.1.3", + "thiserror", +] + +[[package]] +name = "gix-sec" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8ffa5bf0772f9b01de501c035b6b084cf9b8bb07dec41e3afc6a17336a65f47" +dependencies = [ + "bitflags 1.3.2", + "dirs 4.0.0", + "gix-path", + "libc", + "windows", +] + +[[package]] +name = "gix-tempfile" +version = "5.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71a0d32f34e71e86586124225caefd78dabc605d0486de580d717653addf182" +dependencies = [ + "gix-fs", + "libc", + "once_cell", + "parking_lot", + "tempfile", +] + +[[package]] +name = "gix-utils" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35192df7fd0fa112263bad8021e2df7167df4cc2a6e6d15892e1e55621d3d4dc" +dependencies = [ + "fastrand 2.1.1", + "unicode-normalization", +] + +[[package]] +name = "gix-validate" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba9b3737b2cef3dcd014633485f0034b0f1a931ee54aeb7d8f87f177f3c89040" +dependencies = [ + "bstr", + "thiserror", +] + [[package]] name = "glob" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" +[[package]] +name = "globset" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57da3b9b5b85bd66f31093f8c408b90a74431672542466497dcbdfdc02034be1" +dependencies = [ + "aho-corasick 1.1.3", + "bstr", + "log", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", +] + +[[package]] +name = "gloo-timers" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b995a66bb87bebce9a0f4a95aed01daca4872c050bfcb21653361c03bc35e5c" +dependencies = [ + "futures-channel", + "futures-core", + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core 0.6.4", + "subtle", +] + [[package]] name = "h2" version = "0.3.26" @@ -1457,7 +2886,7 @@ dependencies = [ "indexmap 2.2.6", "slab", "tokio", - "tokio-util", + "tokio-util 0.7.11", "tracing", ] @@ -1476,10 +2905,23 @@ dependencies = [ "indexmap 2.2.6", "slab", "tokio", - "tokio-util", + "tokio-util 0.7.11", "tracing", ] +[[package]] +name = "half" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" +dependencies = [ + "cfg-if", + "crunchy", + "num-traits 0.2.19", + "rand 0.8.5", + "rand_distr", +] + [[package]] name = "hashbrown" version = "0.12.3" @@ -1503,7 +2945,25 @@ checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ "ahash", "allocator-api2", - "serde", + "serde 1.0.203", +] + +[[package]] +name = "hashlink" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" +dependencies = [ + "hashbrown 0.14.3", +] + +[[package]] +name = "heck" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" +dependencies = [ + "unicode-segmentation", ] [[package]] @@ -1512,6 +2972,12 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + [[package]] name = "hermit-abi" version = "0.1.19" @@ -1533,6 +2999,21 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac", +] + [[package]] name = "hmac" version = "0.12.1" @@ -1542,6 +3023,15 @@ dependencies = [ "digest", ] +[[package]] +name = "home" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +dependencies = [ + "windows-sys 0.52.0", +] + [[package]] name = "http" version = "0.2.12" @@ -1564,6 +3054,15 @@ dependencies = [ "itoa", ] +[[package]] +name = "http-auth" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "643c9bbf6a4ea8a656d6b4cd53d34f79e3f841ad5203c1a55fb7d761923bc255" +dependencies = [ + "memchr", +] + [[package]] name = "http-body" version = "0.4.6" @@ -1611,7 +3110,7 @@ dependencies = [ "infer", "pin-project-lite", "rand 0.7.3", - "serde", + "serde 1.0.203", "serde_json", "serde_qs", "serde_urlencoded", @@ -1647,7 +3146,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2", + "socket2 0.5.5", "tokio", "tower-service", "tracing", @@ -1690,10 +3189,45 @@ dependencies = [ ] [[package]] -name = "hyper-timeout" -version = "0.4.1" +name = "hyper-rustls" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" +checksum = "399c78f9338483cb7e630c8474b07268983c6bd5acee012e4211f9f7bb21b070" +dependencies = [ + "futures-util", + "http 0.2.12", + "hyper 0.14.30", + "log", + "rustls 0.22.4", + "rustls-native-certs", + "rustls-pki-types", + "tokio", + "tokio-rustls 0.25.0", + "webpki-roots 0.26.3", +] + +[[package]] +name = "hyper-rustls" +version = "0.27.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" +dependencies = [ + "futures-util", + "http 1.1.0", + "hyper 1.4.1", + "hyper-util", + "rustls 0.23.12", + "rustls-pki-types", + "tokio", + "tokio-rustls 0.26.0", + "tower-service", +] + +[[package]] +name = "hyper-timeout" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" dependencies = [ "hyper 0.14.30", "pin-project-lite", @@ -1743,7 +3277,7 @@ dependencies = [ "http-body 1.0.1", "hyper 1.4.1", "pin-project-lite", - "socket2", + "socket2 0.5.5", "tokio", "tower", "tower-service", @@ -1795,6 +3329,51 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "ignore" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b46810df39e66e925525d6e38ce1e7f6e1d208f72dc39757880fcb66e2c58af1" +dependencies = [ + "crossbeam-deque", + "globset", + "log", + "memchr", + "regex-automata 0.4.7", + "same-file", + "walkdir", + "winapi-util", +] + +[[package]] +name = "ignore-files" +version = "1.2.0" +source = "git+https://github.com/watchexec/watchexec.git?rev=8e91d26ef6400c1e60b32a8314cbb144fa33f288#8e91d26ef6400c1e60b32a8314cbb144fa33f288" +dependencies = [ + "futures", + "gix-config", + "ignore", + "miette 5.10.0", + "project-origins", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "im-rc" +version = "15.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af1955a75fa080c677d3972822ec4bad316169ab1cfc6c257a942c2265dbe5fe" +dependencies = [ + "bitmaps", + "rand_core 0.6.4", + "rand_xoshiro", + "sized-chunks", + "typenum", + "version_check", +] + [[package]] name = "indexmap" version = "1.9.3" @@ -1803,6 +3382,7 @@ checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", "hashbrown 0.12.3", + "serde 1.0.203", ] [[package]] @@ -1813,7 +3393,44 @@ checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", "hashbrown 0.14.3", - "serde", + "serde 1.0.203", +] + +[[package]] +name = "indicatif" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7baab56125e25686df467fe470785512329883aab42696d661247aca2a2896e4" +dependencies = [ + "console", + "lazy_static 1.5.0", + "number_prefix 0.3.0", + "regex", +] + +[[package]] +name = "indicatif" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d207dc617c7a380ab07ff572a6e52fa202a2a8f355860ac9c38e23f8196be1b" +dependencies = [ + "console", + "lazy_static 1.5.0", + "number_prefix 0.4.0", + "regex", +] + +[[package]] +name = "indicatif" +version = "0.17.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "763a5a8f45087d6bcea4222e7b72c291a054edf80e4ef6efd2a4979878c7bea3" +dependencies = [ + "console", + "instant", + "number_prefix 0.4.0", + "portable-atomic", + "unicode-width", ] [[package]] @@ -1822,11 +3439,41 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64e9829a50b42bb782c1df523f78d332fe371b10c661e78b7a3c34b0198e9fac" +[[package]] +name = "inotify" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8069d3ec154eb856955c1c0fbffefbf5f3c40a104ec912d4797314c1801abff" +dependencies = [ + "bitflags 1.3.2", + "inotify-sys", + "libc", +] + +[[package]] +name = "inotify-sys" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e05c02b5e89bff3b946cedeca278abc628fe811e604f027c45a8aa3cf793d0eb" +dependencies = [ + "libc", +] + +[[package]] +name = "inout" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" +dependencies = [ + "block-padding", + "generic-array", +] + [[package]] name = "instant" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" dependencies = [ "cfg-if", ] @@ -1837,10 +3484,21 @@ version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c9f046b9af244f13b3bd939f55d16830ac3a201e8a9ba9661bfcb03e2be72b9b" dependencies = [ - "io-lifetimes", + "io-lifetimes 2.0.3", "windows-sys 0.52.0", ] +[[package]] +name = "io-lifetimes" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +dependencies = [ + "hermit-abi 0.3.9", + "libc", + "windows-sys 0.48.0", +] + [[package]] name = "io-lifetimes" version = "2.0.3" @@ -1853,6 +3511,59 @@ version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +[[package]] +name = "is-terminal" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b" +dependencies = [ + "hermit-abi 0.4.0", + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" + +[[package]] +name = "itertools" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f56a2d0bc861f9165be4eb3442afd3c236d8a98afd426f65d92324ae1091a484" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +dependencies = [ + "either", +] + [[package]] name = "itertools" version = "0.12.1" @@ -1906,6 +3617,21 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "jwt" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6204285f77fe7d9784db3fdc449ecce1a0114927a51d5a41c4c7a292011c015f" +dependencies = [ + "base64 0.13.1", + "crypto-common", + "digest", + "hmac", + "serde 1.0.203", + "serde_json", + "sha2", +] + [[package]] name = "keyed_priority_queue" version = "0.4.2" @@ -1916,109 +3642,466 @@ dependencies = [ ] [[package]] -name = "lazy_static" -version = "1.5.0" +name = "keyring" +version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +checksum = "363387f0019d714aa60cc30ab4fe501a747f4c08fc58f069dd14be971bd495a0" +dependencies = [ + "byteorder", + "lazy_static 1.5.0", + "linux-keyutils", + "secret-service", + "security-framework", + "windows-sys 0.52.0", +] [[package]] -name = "leb128" -version = "0.2.5" +name = "kqueue" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" +checksum = "7447f1ca1b7b563588a205fe93dea8df60fd981423a768bc1c0ded35ed147d0c" +dependencies = [ + "kqueue-sys", + "libc", +] [[package]] -name = "libc" -version = "0.2.153" +name = "kqueue-sys" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "ed9625ffda8729b85e45cf04090035ac368927b8cebc34898e7c120f52e4838b" +dependencies = [ + "bitflags 1.3.2", + "libc", +] [[package]] -name = "libloading" -version = "0.8.5" +name = "kstring" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" +checksum = "8b310ccceade8121d7d77fee406160e457c2f4e7c7982d589da3499bc7ea4526" dependencies = [ - "cfg-if", - "windows-targets 0.48.5", + "serde 1.0.203", ] [[package]] -name = "libm" -version = "0.2.8" +name = "kv-log-macro" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" +checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" +dependencies = [ + "log", +] [[package]] -name = "libredox" -version = "0.1.3" +name = "lazy_static" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" -dependencies = [ - "bitflags 2.4.2", - "libc", -] +checksum = "76f033c7ad61445c5b347c7382dd1237847eb1bce590fe50365dcb33d546be73" [[package]] -name = "linux-raw-sys" -version = "0.4.13" +name = "lazy_static" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] -name = "lock_api" -version = "0.4.11" +name = "lazycell" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" -dependencies = [ - "autocfg", - "scopeguard", -] +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] -name = "log" -version = "0.4.22" +name = "leb128" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" [[package]] -name = "lru" -version = "0.9.0" +name = "levenshtein" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71e7d46de488603ffdd5f30afbc64fbba2378214a2c3a2fb83abf3d33126df17" -dependencies = [ - "hashbrown 0.13.2", -] +checksum = "db13adb97ab515a3691f56e4dbab09283d0b86cb45abd991d8634a9d6f501760" [[package]] -name = "lru" -version = "0.12.4" +name = "lexical-core" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37ee39891760e7d94734f6f63fedc29a2e4a152f836120753a72503f09fcf904" +checksum = "6607c62aa161d23d17a9072cc5da0be67cdfc89d3afb1e8d9c842bebc2525ffe" dependencies = [ - "hashbrown 0.14.3", + "arrayvec", + "bitflags 1.3.2", + "cfg-if", + "ryu", + "static_assertions", ] [[package]] -name = "mach2" -version = "0.4.2" +name = "libc" +version = "0.2.158" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b955cdeb2a02b9117f121ce63aa52d08ade45de53e48fe6a38b39c10f6f709" -dependencies = [ - "libc", -] +checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" [[package]] -name = "matchers" -version = "0.1.0" +name = "libflate" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +checksum = "05605ab2bce11bcfc0e9c635ff29ef8b2ea83f29be257ee7d730cac3ee373093" dependencies = [ - "regex-automata 0.1.10", + "adler32", + "crc32fast", + "libflate_lz77", ] [[package]] -name = "matchit" +name = "libflate_lz77" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a52d3a8bfc85f250440e4424db7d857e241a3aebbbe301f3eb606ab15c39acbf" +dependencies = [ + "rle-decode-fast", +] + +[[package]] +name = "libloading" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" +dependencies = [ + "cfg-if", + "windows-targets 0.48.5", +] + +[[package]] +name = "libm" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" + +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.4.2", + "libc", + "redox_syscall 0.5.3", +] + +[[package]] +name = "libsql" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bd17bcc143f2a5be449680dc63b91327d953bcabebe34a69c549fca8934ec9d" +dependencies = [ + "async-stream", + "async-trait", + "base64 0.21.7", + "bitflags 2.4.2", + "bytes", + "fallible-iterator 0.3.0", + "futures", + "http 0.2.12", + "hyper 0.14.30", + "hyper-rustls 0.25.0", + "libsql-hrana", + "libsql-sqlite3-parser", + "serde 1.0.203", + "serde_json", + "thiserror", + "tokio", + "tokio-util 0.7.11", + "tower", + "tracing", +] + +[[package]] +name = "libsql-hrana" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "220a925fe6d49dbfa7523b20f5a5391f579b5d9dcf9dd1225606d00929fcab3a" +dependencies = [ + "base64 0.21.7", + "bytes", + "prost", + "serde 1.0.203", +] + +[[package]] +name = "libsql-sqlite3-parser" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "095d2cf702a5c9c152e48b369f69da30cc44351fa9432621dd8976834abc1752" +dependencies = [ + "bitflags 2.4.2", + "cc", + "fallible-iterator 0.3.0", + "indexmap 2.2.6", + "log", + "memchr", + "phf", + "phf_codegen", + "phf_shared", + "smallvec", + "uncased", +] + +[[package]] +name = "libsqlite3-sys" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afc22eff61b133b115c6e8c74e818c628d6d5e7a502afea6f64dee076dd94326" +dependencies = [ + "cc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "linked-hash-map" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" + +[[package]] +name = "linux-keyutils" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "761e49ec5fd8a5a463f9b84e877c373d888935b71c6be78f3767fe2ae6bed18e" +dependencies = [ + "bitflags 2.4.2", + "libc", +] + +[[package]] +name = "linux-raw-sys" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" + +[[package]] +name = "linux-raw-sys" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" + +[[package]] +name = "liquid" +version = "0.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26e930310cf4334c4936ae18737500a57739c69442b5c42bae114d619af54b82" +dependencies = [ + "doc-comment", + "kstring", + "liquid-core", + "liquid-derive", + "liquid-lib", + "serde 1.0.203", +] + +[[package]] +name = "liquid-core" +version = "0.23.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eae470f061bfc53607283906de925ab67ed57a341e827146e3b241699a1dcde" +dependencies = [ + "anymap2", + "chrono", + "itertools 0.10.5", + "kstring", + "liquid-derive", + "num-traits 0.2.19", + "pest", + "pest_derive", + "serde 1.0.203", +] + +[[package]] +name = "liquid-derive" +version = "0.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6510e456700da1afe07603913b0da5a2595f2482656ade07abf719aae7501f0a" +dependencies = [ + "proc-macro2", + "proc-quote", + "syn 1.0.109", +] + +[[package]] +name = "liquid-lib" +version = "0.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6341259f779ff663bdf1fc478bddb2ca51fda25414006dc69395eddfac07e0a4" +dependencies = [ + "chrono", + "itertools 0.10.5", + "kstring", + "liquid-core", + "once_cell", + "percent-encoding", + "regex", + "unicode-segmentation", +] + +[[package]] +name = "llm" +version = "0.2.0-dev" +source = "git+https://github.com/rustformers/llm?rev=2f6ffd4435799ceaa1d1bcb5a8790e5b3e0c5663#2f6ffd4435799ceaa1d1bcb5a8790e5b3e0c5663" +dependencies = [ + "llm-base", + "llm-llama", + "serde 1.0.203", + "tracing", +] + +[[package]] +name = "llm-base" +version = "0.2.0-dev" +source = "git+https://github.com/rustformers/llm?rev=2f6ffd4435799ceaa1d1bcb5a8790e5b3e0c5663#2f6ffd4435799ceaa1d1bcb5a8790e5b3e0c5663" +dependencies = [ + "bytemuck", + "ggml", + "half", + "llm-samplers", + "memmap2 0.5.10", + "partial_sort", + "rand 0.8.5", + "regex", + "serde 1.0.203", + "serde_bytes", + "thiserror", + "tokenizers", + "tracing", +] + +[[package]] +name = "llm-llama" +version = "0.2.0-dev" +source = "git+https://github.com/rustformers/llm?rev=2f6ffd4435799ceaa1d1bcb5a8790e5b3e0c5663#2f6ffd4435799ceaa1d1bcb5a8790e5b3e0c5663" +dependencies = [ + "llm-base", + "tracing", +] + +[[package]] +name = "llm-samplers" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7553f60d113c9cdc6a5402456a31cd9a273bef79f6f16d8a4f7b4bedf5f754b2" +dependencies = [ + "anyhow", + "num-traits 0.2.19", + "rand 0.8.5", + "thiserror", +] + +[[package]] +name = "lock_api" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +dependencies = [ + "value-bag", +] + +[[package]] +name = "logos" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff1ceb190eb9bdeecdd8f1ad6a71d6d632a50905948771718741b5461fb01e13" +dependencies = [ + "logos-derive", +] + +[[package]] +name = "logos-codegen" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90be66cb7bd40cb5cc2e9cfaf2d1133b04a3d93b72344267715010a466e0915a" +dependencies = [ + "beef", + "fnv", + "lazy_static 1.5.0", + "proc-macro2", + "quote", + "regex-syntax 0.8.4", + "syn 2.0.76", +] + +[[package]] +name = "logos-derive" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45154231e8e96586b39494029e58f12f8ffcb5ecf80333a603a13aa205ea8cbd" +dependencies = [ + "logos-codegen", +] + +[[package]] +name = "lru" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71e7d46de488603ffdd5f30afbc64fbba2378214a2c3a2fb83abf3d33126df17" +dependencies = [ + "hashbrown 0.13.2", +] + +[[package]] +name = "lru" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37ee39891760e7d94734f6f63fedc29a2e4a152f836120753a72503f09fcf904" +dependencies = [ + "hashbrown 0.14.3", +] + +[[package]] +name = "mach2" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b955cdeb2a02b9117f121ce63aa52d08ade45de53e48fe6a38b39c10f6f709" +dependencies = [ + "libc", +] + +[[package]] +name = "macro_rules_attribute" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf0c9b980bf4f3a37fd7b1c066941dd1b1d0152ce6ee6e8fe8c49b9f6810d862" +dependencies = [ + "macro_rules_attribute-proc_macro", + "paste", +] + +[[package]] +name = "macro_rules_attribute-proc_macro" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58093314a45e00c77d5c508f76e77c3396afbbc0d01506e7fae47b018bac2b1d" + +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] + +[[package]] +name = "matchit" version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" @@ -2051,7 +4134,43 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" dependencies = [ - "rustix", + "rustix 0.38.35", +] + +[[package]] +name = "memmap2" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" +dependencies = [ + "libc", +] + +[[package]] +name = "memmap2" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f49388d20533534cd19360ad3d6a7dadc885944aa802ba3995040c5ec11288c6" +dependencies = [ + "libc", +] + +[[package]] +name = "memoffset" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +dependencies = [ + "autocfg", +] + +[[package]] +name = "memoffset" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" +dependencies = [ + "autocfg", ] [[package]] @@ -2063,12 +4182,68 @@ dependencies = [ "autocfg", ] +[[package]] +name = "miette" +version = "5.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59bb584eaeeab6bd0226ccf3509a69d7936d148cf3d036ad350abe35e8c6856e" +dependencies = [ + "miette-derive 5.10.0", + "once_cell", + "thiserror", + "unicode-width", +] + +[[package]] +name = "miette" +version = "7.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4edc8853320c2a0dab800fbda86253c8938f6ea88510dc92c5f1ed20e794afc1" +dependencies = [ + "cfg-if", + "miette-derive 7.2.0", + "thiserror", + "unicode-width", +] + +[[package]] +name = "miette-derive" +version = "5.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.76", +] + +[[package]] +name = "miette-derive" +version = "7.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcf09caffaac8068c346b6df2a7fc27a177fd20b39421a39ce0a211bde679a6c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.76", +] + [[package]] name = "mime" version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" +[[package]] +name = "mime_guess" +version = "2.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" +dependencies = [ + "mime", + "unicase", +] + [[package]] name = "minimal-lexical" version = "0.2.1" @@ -2105,6 +4280,51 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "mio" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" +dependencies = [ + "hermit-abi 0.3.9", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.52.0", +] + +[[package]] +name = "mirai-annotations" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9be0862c1b3f26a88803c4a49de6889c10e608b3ee9344e6ef5b45fb37ad3d1" + +[[package]] +name = "monostate" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d208407d7552cd041d8cdb69a1bc3303e029c598738177a3d87082004dc0e1e" +dependencies = [ + "monostate-impl", + "serde 1.0.203", +] + +[[package]] +name = "monostate-impl" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7ce64b975ed4f123575d11afd9491f2e37bbd5813fbfbc0f09ae1fbddea74e0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.76", +] + +[[package]] +name = "multimap" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defc4c55412d89136f966bbb339008b474350e5e6e78d2714439c386b3137a03" + [[package]] name = "mysql_async" version = "0.33.0" @@ -2118,9 +4338,9 @@ dependencies = [ "futures-sink", "futures-util", "keyed_priority_queue", - "lazy_static", + "lazy_static 1.5.0", "lru 0.12.4", - "mio", + "mio 0.8.11", "mysql_common", "native-tls", "once_cell", @@ -2128,13 +4348,13 @@ dependencies = [ "percent-encoding", "pin-project", "rand 0.8.5", - "serde", + "serde 1.0.203", "serde_json", - "socket2", + "socket2 0.5.5", "thiserror", "tokio", "tokio-native-tls", - "tokio-util", + "tokio-util 0.7.11", "twox-hash", "url", ] @@ -2146,7 +4366,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06f19e4cfa0ab5a76b627cec2d81331c49b034988eaf302c3bafeada684eadef" dependencies = [ "base64 0.21.7", - "bindgen", + "bindgen 0.70.1", "bitflags 2.4.2", "btoi", "byteorder", @@ -2155,13 +4375,13 @@ dependencies = [ "cmake", "crc32fast", "flate2", - "lazy_static", + "lazy_static 1.5.0", "num-bigint", - "num-traits", + "num-traits 0.2.19", "rand 0.8.5", "regex", "saturating", - "serde", + "serde 1.0.203", "serde_json", "sha1 0.10.6", "sha2", @@ -2189,6 +4409,31 @@ dependencies = [ "tempfile", ] +[[package]] +name = "nix" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069" +dependencies = [ + "bitflags 1.3.2", + "cfg-if", + "libc", + "memoffset 0.6.5", +] + +[[package]] +name = "nix" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" +dependencies = [ + "bitflags 1.3.2", + "cfg-if", + "libc", + "memoffset 0.7.1", + "pin-utils", +] + [[package]] name = "nix" version = "0.28.0" @@ -2201,14 +4446,67 @@ dependencies = [ "libc", ] +[[package]] +name = "nom" +version = "5.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08959a387a676302eebf4ddbcbc611da04285579f76f88ee0506c63b1a61dd4b" +dependencies = [ + "lexical-core", + "memchr", + "version_check", +] + [[package]] name = "nom" version = "7.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "nom8" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae01545c9c7fc4486ab7debaf2aad7003ac19431791868fb2e8066df97fad2f8" +dependencies = [ + "memchr", +] + +[[package]] +name = "normalize-path" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5438dd2b2ff4c6df6e1ce22d825ed2fa93ee2922235cc45186991717f0a892d" + +[[package]] +name = "normpath" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8911957c4b1549ac0dc74e30db9c8b0e66ddcd6d7acc33098f4c63a64a6d7ed" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "notify" +version = "5.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "729f63e1ca555a43fe3efa4f3efdf4801c479da85b432242a7b726f353c88486" dependencies = [ - "memchr", - "minimal-lexical", + "bitflags 1.3.2", + "crossbeam-channel", + "filetime", + "fsevent-sys", + "inotify", + "kqueue", + "libc", + "mio 0.8.11", + "walkdir", + "windows-sys 0.45.0", ] [[package]] @@ -2221,6 +4519,20 @@ dependencies = [ "winapi", ] +[[package]] +name = "num" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" +dependencies = [ + "num-bigint", + "num-complex", + "num-integer", + "num-iter", + "num-rational", + "num-traits 0.2.19", +] + [[package]] name = "num-bigint" version = "0.4.6" @@ -2228,7 +4540,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" dependencies = [ "num-integer", - "num-traits", + "num-traits 0.2.19", +] + +[[package]] +name = "num-complex" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" +dependencies = [ + "num-traits 0.2.19", ] [[package]] @@ -2243,7 +4564,38 @@ version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ - "num-traits", + "num-traits 0.2.19", +] + +[[package]] +name = "num-iter" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" +dependencies = [ + "autocfg", + "num-integer", + "num-traits 0.2.19", +] + +[[package]] +name = "num-rational" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" +dependencies = [ + "num-bigint", + "num-integer", + "num-traits 0.2.19", +] + +[[package]] +name = "num-traits" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31" +dependencies = [ + "num-traits 0.2.19", ] [[package]] @@ -2253,6 +4605,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", + "libm", ] [[package]] @@ -2274,6 +4627,18 @@ dependencies = [ "libc", ] +[[package]] +name = "number_prefix" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17b02fc0ff9a9e4b35b3342880f48e896ebf69f2967921fe8646bf5b7125956a" + +[[package]] +name = "number_prefix" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" + [[package]] name = "oauth2" version = "4.4.2" @@ -2285,7 +4650,7 @@ dependencies = [ "getrandom 0.2.12", "http 0.2.12", "rand 0.8.5", - "serde", + "serde 1.0.203", "serde_json", "serde_path_to_error", "sha2", @@ -2314,12 +4679,111 @@ dependencies = [ "memchr", ] +[[package]] +name = "oci-distribution" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b95a2c51531af0cb93761f66094044ca6ea879320bccd35ab747ff3fcab3f422" +dependencies = [ + "bytes", + "chrono", + "futures-util", + "http 1.1.0", + "http-auth", + "jwt", + "lazy_static 1.5.0", + "olpc-cjson", + "regex", + "reqwest 0.12.7", + "serde 1.0.203", + "serde_json", + "sha2", + "thiserror", + "tokio", + "tracing", + "unicase", +] + +[[package]] +name = "oci-distribution" +version = "0.11.0" +source = "git+https://github.com/fermyon/oci-distribution?rev=7e4ce9be9bcd22e78a28f06204931f10c44402ba#7e4ce9be9bcd22e78a28f06204931f10c44402ba" +dependencies = [ + "bytes", + "chrono", + "futures-util", + "http 1.1.0", + "http-auth", + "jwt", + "lazy_static 1.5.0", + "olpc-cjson", + "regex", + "reqwest 0.12.7", + "serde 1.0.203", + "serde_json", + "sha2", + "thiserror", + "tokio", + "tracing", + "unicase", +] + +[[package]] +name = "oci-wasm" +version = "0.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a91502e5352f927156f2b6a28d2558cc59558b1f441b681df3f706ced6937e07" +dependencies = [ + "anyhow", + "chrono", + "oci-distribution 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.203", + "serde_json", + "sha2", + "tokio", + "wit-component 0.209.1", + "wit-parser 0.209.1", +] + +[[package]] +name = "olpc-cjson" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d637c9c15b639ccff597da8f4fa968300651ad2f1e968aefc3b4927a6fb2027a" +dependencies = [ + "serde 1.0.203", + "serde_json", + "unicode-normalization", +] + [[package]] name = "once_cell" version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +[[package]] +name = "onig" +version = "6.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c4b31c8722ad9171c6d77d3557db078cab2bd50afcc9d09c8b315c59df8ca4f" +dependencies = [ + "bitflags 1.3.2", + "libc", + "once_cell", + "onig_sys", +] + +[[package]] +name = "onig_sys" +version = "69.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b829e3d7e9cc74c7e315ee8edb185bf4190da5acde74afd7fc59c35b1f086e7" +dependencies = [ + "cc", + "pkg-config", +] + [[package]] name = "openssl" version = "0.10.66" @@ -2343,7 +4807,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -2445,7 +4909,7 @@ dependencies = [ "glob", "once_cell", "opentelemetry", - "ordered-float", + "ordered-float 4.2.2", "percent-encoding", "rand 0.8.5", "serde_json", @@ -2460,13 +4924,32 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" +[[package]] +name = "ordered-float" +version = "2.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68f19d67e5a2795c94e73e0bb1cc1a7edeb2e28efd39e2e1c9b7a40c1108b11c" +dependencies = [ + "num-traits 0.2.19", +] + [[package]] name = "ordered-float" version = "4.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a91171844676f8c7990ce64959210cd2eaef32c2612c50f9fae9f8aaa6065a6" dependencies = [ - "num-traits", + "num-traits 0.2.19", +] + +[[package]] +name = "ordered-stream" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aa2b01e1d916879f73a53d01d1d6cee68adbb31d6d9177a8cfce093cced1d50" +dependencies = [ + "futures-core", + "pin-project-lite", ] [[package]] @@ -2481,6 +4964,18 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" +[[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "ecdsa", + "elliptic-curve", + "primeorder", + "sha2", +] + [[package]] name = "parking" version = "2.2.0" @@ -2505,17 +5000,107 @@ checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.4.1", "smallvec", "windows-targets 0.48.5", ] +[[package]] +name = "partial_sort" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7924d1d0ad836f665c9065e26d016c673ece3993f30d340068b16f282afc1156" + +[[package]] +name = "password-hash" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" +dependencies = [ + "base64ct", + "rand_core 0.6.4", + "subtle", +] + [[package]] name = "paste" version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" +[[package]] +name = "path-absolutize" +version = "3.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4af381fe79fa195b4909485d99f73a80792331df0625188e707854f0b3383f5" +dependencies = [ + "path-dedot", +] + +[[package]] +name = "path-dedot" +version = "3.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07ba0ad7e047712414213ff67533e6dd477af0a4e1d14fb52343e53d30ea9397" +dependencies = [ + "once_cell", +] + +[[package]] +name = "pathdiff" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" + +[[package]] +name = "pbjson" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1030c719b0ec2a2d25a5df729d6cff1acf3cc230bf766f4f97833591f7577b90" +dependencies = [ + "base64 0.21.7", + "serde 1.0.203", +] + +[[package]] +name = "pbjson-build" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2580e33f2292d34be285c5bc3dba5259542b083cfad6037b6d70345f24dcb735" +dependencies = [ + "heck 0.4.1", + "itertools 0.11.0", + "prost", + "prost-types", +] + +[[package]] +name = "pbjson-types" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18f596653ba4ac51bdecbb4ef6773bc7f56042dc13927910de1684ad3d32aa12" +dependencies = [ + "bytes", + "chrono", + "pbjson", + "pbjson-build", + "prost", + "prost-build", + "serde 1.0.203", +] + +[[package]] +name = "pbkdf2" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" +dependencies = [ + "digest", + "hmac", + "password-hash", + "sha2", +] + [[package]] name = "pem" version = "3.0.4" @@ -2523,7 +5108,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e459365e590736a54c3fa561947c84837534b8e9af6fc5bf781307e82658fae" dependencies = [ "base64 0.22.1", - "serde", + "serde 1.0.203", +] + +[[package]] +name = "pem-rfc7468" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" +dependencies = [ + "base64ct", ] [[package]] @@ -2532,6 +5126,51 @@ version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +[[package]] +name = "pest" +version = "2.7.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd53dff83f26735fdc1ca837098ccf133605d794cdae66acfc2bfac3ec809d95" +dependencies = [ + "memchr", + "thiserror", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.7.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a548d2beca6773b1c244554d36fcf8548a8a58e74156968211567250e48e49a" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.7.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c93a82e8d145725dcbaf44e5ea887c8a869efdcc28706df2d08c69e17077183" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn 2.0.76", +] + +[[package]] +name = "pest_meta" +version = "2.7.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a941429fea7e08bedec25e4f6785b6ffaacc6b755da98df5ef3e7dcf4a124c4f" +dependencies = [ + "once_cell", + "pest", + "sha2", +] + [[package]] name = "petgraph" version = "0.6.5" @@ -2551,6 +5190,26 @@ dependencies = [ "phf_shared", ] +[[package]] +name = "phf_codegen" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8d39688d359e6b34654d328e262234662d16cc0f60ec8dcbe5e718709342a5a" +dependencies = [ + "phf_generator", + "phf_shared", +] + +[[package]] +name = "phf_generator" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" +dependencies = [ + "phf_shared", + "rand 0.8.5", +] + [[package]] name = "phf_shared" version = "0.11.2" @@ -2558,6 +5217,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" dependencies = [ "siphasher", + "uncased", ] [[package]] @@ -2577,7 +5237,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -2594,36 +5254,68 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "piper" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae1d5c74c9876f070d3e8fd503d748c7d974c3e48da8f41350fa5222ef9b4391" +checksum = "96c8c490f422ef9a4efd2cb5b42b76c8613d7e7dfc1caf667b8a3350a5acc066" dependencies = [ "atomic-waker", - "fastrand 2.1.0", + "fastrand 2.1.1", "futures-io", ] +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + [[package]] name = "pkg-config" version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" +checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" + +[[package]] +name = "polling" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" +dependencies = [ + "autocfg", + "bitflags 1.3.2", + "cfg-if", + "concurrent-queue", + "libc", + "log", + "pin-project-lite", + "windows-sys 0.48.0", +] [[package]] name = "polling" -version = "3.7.2" +version = "3.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3ed00ed3fbf728b5816498ecd316d1716eecaced9c0c8d2c5a6740ca214985b" +checksum = "cc2790cd301dec6cd3b7a025e4815cf825724a51c98dccfe6a3e55f05ffb6511" dependencies = [ "cfg-if", "concurrent-queue", "hermit-abi 0.4.0", "pin-project-lite", - "rustix", + "rustix 0.38.35", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] +[[package]] +name = "portable-atomic" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da544ee218f0d287a911e9c99a39a8c9bc8fcad3cb8db5959940044ecfc67265" + [[package]] name = "postcard" version = "1.0.8" @@ -2632,7 +5324,7 @@ checksum = "a55c51ee6c0db07e68448e336cf8ea4131a620edefebf9893e759b2d793420f8" dependencies = [ "cobs", "embedded-io", - "serde", + "serde 1.0.203", ] [[package]] @@ -2692,6 +5384,35 @@ dependencies = [ "zerocopy", ] +[[package]] +name = "prettyplease" +version = "0.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479cf940fbbb3426c32c5d5176f62ad57549a0bb84773423ba8be9d089f5faba" +dependencies = [ + "proc-macro2", + "syn 2.0.76", +] + +[[package]] +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] + +[[package]] +name = "proc-macro-crate" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +dependencies = [ + "once_cell", + "toml_edit 0.19.15", +] + [[package]] name = "proc-macro-error" version = "1.0.4" @@ -2716,6 +5437,12 @@ dependencies = [ "version_check", ] +[[package]] +name = "proc-macro-hack" +version = "0.5.20+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" + [[package]] name = "proc-macro2" version = "1.0.86" @@ -2725,6 +5452,40 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "proc-quote" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e84ab161de78c915302ca325a19bee6df272800e2ae1a43fe3ef430bab2a100" +dependencies = [ + "proc-macro-hack", + "proc-macro2", + "proc-quote-impl", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "proc-quote-impl" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fb3ec628b063cdbcf316e06a8b8c1a541d28fa6c0a8eacd2bfb2b7f49e88aa0" +dependencies = [ + "proc-macro-hack", + "proc-macro2", + "quote", +] + +[[package]] +name = "project-origins" +version = "1.2.0" +source = "git+https://github.com/watchexec/watchexec.git?rev=8e91d26ef6400c1e60b32a8314cbb144fa33f288#8e91d26ef6400c1e60b32a8314cbb144fa33f288" +dependencies = [ + "futures", + "tokio", + "tokio-stream", +] + [[package]] name = "prost" version = "0.12.6" @@ -2735,6 +5496,27 @@ dependencies = [ "prost-derive", ] +[[package]] +name = "prost-build" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22505a5c94da8e3b7c2996394d1c933236c4d743e81a410bcca4e6989fc066a4" +dependencies = [ + "bytes", + "heck 0.4.1", + "itertools 0.12.1", + "log", + "multimap", + "once_cell", + "petgraph", + "prettyplease", + "prost", + "prost-types", + "regex", + "syn 2.0.76", + "tempfile", +] + [[package]] name = "prost-derive" version = "0.12.6" @@ -2742,10 +5524,59 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" dependencies = [ "anyhow", - "itertools", + "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", +] + +[[package]] +name = "prost-reflect" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f5eec97d5d34bdd17ad2db2219aabf46b054c6c41bd5529767c9ce55be5898f" +dependencies = [ + "logos", + "miette 7.2.0", + "once_cell", + "prost", + "prost-types", +] + +[[package]] +name = "prost-types" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0" +dependencies = [ + "prost", +] + +[[package]] +name = "protox" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac532509cee918d40f38c3e12f8ef9230f215f017d54de7dd975015538a42ce7" +dependencies = [ + "bytes", + "miette 7.2.0", + "prost", + "prost-reflect", + "prost-types", + "protox-parse", + "thiserror", +] + +[[package]] +name = "protox-parse" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f6c33f43516fe397e2f930779d720ca12cd057f7da4cd6326a0ef78d69dee96" +dependencies = [ + "logos", + "miette 7.2.0", + "prost-types", + "thiserror", ] [[package]] @@ -2757,6 +5588,22 @@ dependencies = [ "cc", ] +[[package]] +name = "ptree" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0de80796b316aec75344095a6d2ef68ec9b8f573b9e7adc821149ba3598e270" +dependencies = [ + "ansi_term", + "atty", + "config", + "directories", + "petgraph", + "serde 1.0.203", + "serde-value", + "tint", +] + [[package]] name = "quote" version = "1.0.35" @@ -2828,6 +5675,16 @@ dependencies = [ "getrandom 0.2.12", ] +[[package]] +name = "rand_distr" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32cb0b9bc82b0a0876c2dd994a7e7a2683d3e7390ca40e6886785ef0c7e3ee31" +dependencies = [ + "num-traits 0.2.19", + "rand 0.8.5", +] + [[package]] name = "rand_hc" version = "0.2.0" @@ -2837,6 +5694,24 @@ dependencies = [ "rand_core 0.5.1", ] +[[package]] +name = "rand_xoshiro" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f97cdb2a36ed4183de61b2f824cc45c9f1037f28afe0a322e9fff4c108b5aaa" +dependencies = [ + "rand_core 0.6.4", +] + +[[package]] +name = "raw-cpuid" +version = "10.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c297679cb867470fa8c9f67dbba74a78d78e3e98d7cf2b08d6d71540f797332" +dependencies = [ + "bitflags 1.3.2", +] + [[package]] name = "rayon" version = "1.8.1" @@ -2847,6 +5722,17 @@ dependencies = [ "rayon-core", ] +[[package]] +name = "rayon-cond" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd1259362c9065e5ea39a789ef40b1e3fd934c94beb7b5ab3ac6629d3b5e7cb7" +dependencies = [ + "either", + "itertools 0.8.2", + "rayon", +] + [[package]] name = "rayon-core" version = "1.12.1" @@ -2857,6 +5743,12 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "reborrow" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03251193000f4bd3b042892be858ee50e8b3719f2b08e5833ac4353724632430" + [[package]] name = "redis" version = "0.21.7" @@ -2875,10 +5767,42 @@ dependencies = [ "sha1 0.6.1", "tokio", "tokio-native-tls", - "tokio-util", + "tokio-util 0.7.11", + "url", +] + +[[package]] +name = "redis" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e902a69d09078829137b4a5d9d082e0490393537badd7c91a3d69d14639e115f" +dependencies = [ + "arc-swap", + "async-trait", + "bytes", + "combine", + "futures-util", + "itoa", + "num-bigint", + "percent-encoding", + "pin-project-lite", + "ryu", + "sha1_smol", + "socket2 0.5.5", + "tokio", + "tokio-util 0.7.11", "url", ] +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags 1.3.2", +] + [[package]] name = "redox_syscall" version = "0.4.1" @@ -2888,6 +5812,15 @@ dependencies = [ "bitflags 1.3.2", ] +[[package]] +name = "redox_syscall" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" +dependencies = [ + "bitflags 2.4.2", +] + [[package]] name = "redox_users" version = "0.4.5" @@ -2918,7 +5851,7 @@ version = "1.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" dependencies = [ - "aho-corasick", + "aho-corasick 1.1.3", "memchr", "regex-automata 0.4.7", "regex-syntax 0.8.4", @@ -2939,7 +5872,7 @@ version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ - "aho-corasick", + "aho-corasick 1.1.3", "memchr", "regex-syntax 0.8.4", ] @@ -2950,6 +5883,12 @@ version = "0.6.29" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" +[[package]] +name = "regex-syntax" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" + [[package]] name = "regex-syntax" version = "0.8.4" @@ -2972,7 +5911,7 @@ dependencies = [ "http 0.2.12", "http-body 0.4.6", "hyper 0.14.30", - "hyper-rustls", + "hyper-rustls 0.24.2", "hyper-tls 0.5.0", "ipnet", "js-sys", @@ -2984,38 +5923,43 @@ dependencies = [ "pin-project-lite", "rustls 0.21.12", "rustls-pemfile 1.0.4", - "serde", + "serde 1.0.203", "serde_json", "serde_urlencoded", "sync_wrapper 0.1.2", - "system-configuration", + "system-configuration 0.5.1", "tokio", "tokio-native-tls", "tokio-rustls 0.24.1", - "tokio-util", + "tokio-util 0.7.11", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", + "wasm-streams", "web-sys", "webpki-roots 0.25.4", - "winreg 0.50.0", + "winreg", ] [[package]] name = "reqwest" -version = "0.12.5" +version = "0.12.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7d6d2a27d57148378eb5e111173f4276ad26340ecc5c49a4a2152167a2d6a37" +checksum = "f8f4955649ef5c38cc7f9e8aa41761d48fb9677197daea9984dc54f56aad5e63" dependencies = [ "base64 0.22.1", "bytes", + "encoding_rs", + "futures-channel", "futures-core", "futures-util", + "h2 0.4.6", "http 1.1.0", "http-body 1.0.1", "http-body-util", "hyper 1.4.1", + "hyper-rustls 0.27.2", "hyper-tls 0.6.0", "hyper-util", "ipnet", @@ -3027,20 +5971,32 @@ dependencies = [ "percent-encoding", "pin-project-lite", "rustls-pemfile 2.1.3", - "serde", + "serde 1.0.203", "serde_json", "serde_urlencoded", "sync_wrapper 1.0.1", + "system-configuration 0.6.1", "tokio", "tokio-native-tls", - "tokio-util", + "tokio-socks", + "tokio-util 0.7.11", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "wasm-streams", "web-sys", - "winreg 0.52.0", + "windows-registry", +] + +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac", + "subtle", ] [[package]] @@ -3058,6 +6014,43 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "rle-decode-fast" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3582f63211428f83597b51b2ddb88e2a91a9d52d12831f9d08f5e624e8977422" + +[[package]] +name = "routefinder" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0971d3c8943a6267d6bd0d782fdc4afa7593e7381a92a3df950ff58897e066b5" +dependencies = [ + "smartcow", + "smartstring", +] + +[[package]] +name = "rpassword" +version = "7.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80472be3c897911d0137b2d2b9055faf6eeac5b14e324073d83bc17b191d7e3f" +dependencies = [ + "libc", + "rtoolbox", + "windows-sys 0.48.0", +] + +[[package]] +name = "rtoolbox" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c247d24e63230cdb56463ae328478bd5eac8b8faa8c69461a77e8e323afac90e" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + [[package]] name = "rumqttc" version = "0.24.0" @@ -3070,13 +6063,33 @@ dependencies = [ "log", "rustls-native-certs", "rustls-pemfile 2.1.3", - "rustls-webpki 0.102.6", + "rustls-webpki 0.102.7", "thiserror", "tokio", "tokio-rustls 0.25.0", "url", ] +[[package]] +name = "rusqlite" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "549b9d036d571d42e6e85d1c1425e2ac83491075078ca9a15be021c56b1641f2" +dependencies = [ + "bitflags 2.4.2", + "fallible-iterator 0.2.0", + "fallible-streaming-iterator", + "hashlink", + "libsqlite3-sys", + "smallvec", +] + +[[package]] +name = "rust-ini" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e52c148ef37f8c375d49d5a73aa70713125b7f19095948a923f80afdeb22ec2" + [[package]] name = "rustc-demangle" version = "0.1.23" @@ -3091,9 +6104,9 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustc_version" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ "semver", ] @@ -3110,7 +6123,7 @@ dependencies = [ "http 0.2.12", "reqwest 0.11.27", "rustify_derive", - "serde", + "serde 1.0.203", "serde_json", "serde_urlencoded", "thiserror", @@ -3134,15 +6147,29 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.31" +version = "0.37.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2" +dependencies = [ + "bitflags 1.3.2", + "errno", + "io-lifetimes 1.0.11", + "libc", + "linux-raw-sys 0.3.8", + "windows-sys 0.48.0", +] + +[[package]] +name = "rustix" +version = "0.38.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" +checksum = "a85d50532239da68e9addb745ba38ff4612a242c1c7ceea689c4bc7c2f43c36f" dependencies = [ "bitflags 2.4.2", "errno", "itoa", "libc", - "linux-raw-sys", + "linux-raw-sys 0.4.14", "once_cell", "windows-sys 0.52.0", ] @@ -3168,7 +6195,7 @@ dependencies = [ "log", "ring", "rustls-pki-types", - "rustls-webpki 0.102.6", + "rustls-webpki 0.102.7", "subtle", "zeroize", ] @@ -3179,20 +6206,21 @@ version = "0.23.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c58f8c84392efc0a126acce10fa59ff7b3d2ac06ab451a33f2741989b806b044" dependencies = [ + "aws-lc-rs", "log", "once_cell", "ring", "rustls-pki-types", - "rustls-webpki 0.102.6", + "rustls-webpki 0.102.7", "subtle", "zeroize", ] [[package]] name = "rustls-native-certs" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04182dffc9091a404e0fc069ea5cd60e5b866c3adf881eff99a32d048242dffa" +checksum = "e5bfb394eeed242e909609f56089eecfe5fda225042e8b171791b9c95f5931e5" dependencies = [ "openssl-probe", "rustls-pemfile 2.1.3", @@ -3238,10 +6266,11 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.102.6" +version = "0.102.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e6b52d4fda176fd835fdc55a835d4a89b8499cad995885a21149d5ad62f852e" +checksum = "84678086bd54edf2b415183ed7a94d0efb049f1b646a33e22a36f3794be6ae56" dependencies = [ + "aws-lc-rs", "ring", "rustls-pki-types", "untrusted", @@ -3251,13 +6280,32 @@ dependencies = [ name = "rustversion" version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" + +[[package]] +name = "ryu" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" + +[[package]] +name = "safetensors" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d93279b86b3de76f820a8854dd06cbc33cfa57a417b19c47f6a25280112fb1df" +dependencies = [ + "serde 1.0.203", + "serde_json", +] [[package]] -name = "ryu" -version = "1.0.16" +name = "same-file" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] [[package]] name = "sanitize-filename" @@ -3265,7 +6313,7 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2ed72fbaf78e6f2d41744923916966c4fbe3d7c74e3037a8ee482f1115572603" dependencies = [ - "lazy_static", + "lazy_static 1.5.0", "regex", ] @@ -3300,6 +6348,49 @@ dependencies = [ "untrusted", ] +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "pkcs8", + "subtle", + "zeroize", +] + +[[package]] +name = "secrecy" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bd1c54ea06cfd2f6b63219704de0b9b4f72dcc2b8fdef820be6cd799780e91e" +dependencies = [ + "serde 1.0.203", + "zeroize", +] + +[[package]] +name = "secret-service" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5204d39df37f06d1944935232fd2dfe05008def7ca599bf28c0800366c8a8f9" +dependencies = [ + "aes", + "cbc", + "futures-util", + "generic-array", + "hkdf", + "num", + "once_cell", + "rand 0.8.5", + "serde 1.0.203", + "sha2", + "zbus", +] + [[package]] name = "security-framework" version = "2.10.0" @@ -3329,9 +6420,21 @@ version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" dependencies = [ - "serde", + "serde 1.0.203", ] +[[package]] +name = "seq-macro" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3f0bf26fd526d2a95683cd0f87bf103b8539e2ca1ef48ce002d67aad59aa0b4" + +[[package]] +name = "serde" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dad3f759919b92c3068c696c15c3d17238234498bbdcc80f2c469606f948ac8" + [[package]] name = "serde" version = "1.0.203" @@ -3341,6 +6444,37 @@ dependencies = [ "serde_derive", ] +[[package]] +name = "serde-hjson" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a3a4e0ea8a88553209f6cc6cfe8724ecad22e1acf372793c27d995290fe74f8" +dependencies = [ + "lazy_static 1.5.0", + "num-traits 0.1.43", + "regex", + "serde 0.8.23", +] + +[[package]] +name = "serde-value" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3a1a3341211875ef120e117ea7fd5228530ae7e7036a779fdc9117be6b3282c" +dependencies = [ + "ordered-float 2.10.1", + "serde 1.0.203", +] + +[[package]] +name = "serde_bytes" +version = "0.11.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "387cc504cb06bb40a96c8e04e951fe01854cf6bc921053c954e4a606d9675c6a" +dependencies = [ + "serde 1.0.203", +] + [[package]] name = "serde_derive" version = "1.0.203" @@ -3349,7 +6483,16 @@ checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", +] + +[[package]] +name = "serde_ignored" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8e319a36d1b52126a0d608f24e93b2d81297091818cd70625fcf50a15d84ddf" +dependencies = [ + "serde 1.0.203", ] [[package]] @@ -3360,7 +6503,7 @@ checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" dependencies = [ "itoa", "ryu", - "serde", + "serde 1.0.203", ] [[package]] @@ -3370,7 +6513,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" dependencies = [ "itoa", - "serde", + "serde 1.0.203", ] [[package]] @@ -3380,17 +6523,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7715380eec75f029a4ef7de39a9200e0a63823176b759d055b613f5a87df6a6" dependencies = [ "percent-encoding", - "serde", + "serde 1.0.203", "thiserror", ] +[[package]] +name = "serde_repr" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.76", +] + [[package]] name = "serde_spanned" version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0" dependencies = [ - "serde", + "serde 1.0.203", ] [[package]] @@ -3402,7 +6556,50 @@ dependencies = [ "form_urlencoded", "itoa", "ryu", - "serde", + "serde 1.0.203", +] + +[[package]] +name = "serde_with" +version = "3.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cecfa94848272156ea67b2b1a53f20fc7bc638c4a46d2f8abde08f05f4b857" +dependencies = [ + "base64 0.22.1", + "chrono", + "hex", + "indexmap 1.9.3", + "indexmap 2.2.6", + "serde 1.0.203", + "serde_derive", + "serde_json", + "serde_with_macros", + "time", +] + +[[package]] +name = "serde_with_macros" +version = "3.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8fee4991ef4f274617a51ad4af30519438dacb2f56ac773b08a1922ff743350" +dependencies = [ + "darling 0.20.10", + "proc-macro2", + "quote", + "syn 2.0.76", +] + +[[package]] +name = "serde_yaml" +version = "0.9.34+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" +dependencies = [ + "indexmap 2.2.6", + "itoa", + "ryu", + "serde 1.0.203", + "unsafe-libyaml", ] [[package]] @@ -3442,15 +6639,34 @@ dependencies = [ "digest", ] +[[package]] +name = "sha256" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18278f6a914fa3070aa316493f7d2ddfb9ac86ebc06fa3b83bffda487e9065b0" +dependencies = [ + "async-trait", + "bytes", + "hex", + "sha2", + "tokio", +] + [[package]] name = "sharded-slab" version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" dependencies = [ - "lazy_static", + "lazy_static 1.5.0", ] +[[package]] +name = "shell-words" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" + [[package]] name = "shellexpand" version = "2.1.2" @@ -3460,12 +6676,42 @@ dependencies = [ "dirs 4.0.0", ] +[[package]] +name = "shellexpand" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da03fa3b94cc19e3ebfc88c4229c49d8f08cdbd1228870a45f0ffdf84988e14b" +dependencies = [ + "dirs 5.0.1", +] + [[package]] name = "shlex" version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" +[[package]] +name = "signal-hook" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8621587d4798caf8eb44879d42e56b9a93ea5dcd315a6487c357130095b62801" +dependencies = [ + "libc", + "signal-hook-registry", +] + +[[package]] +name = "signal-hook-mio" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34db1a06d485c9142248b7a054f034b349b212551f3dfd19c94d45a754a217cd" +dependencies = [ + "libc", + "mio 0.8.11", + "signal-hook", +] + [[package]] name = "signal-hook-registry" version = "1.4.1" @@ -3475,12 +6721,38 @@ dependencies = [ "libc", ] +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest", + "rand_core 0.6.4", +] + +[[package]] +name = "similar" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1de1d4f81173b03af4c0cbed3c898f6bff5b870e4a7f5d6f4057d62a7a4b686e" + [[package]] name = "siphasher" version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" +[[package]] +name = "sized-chunks" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16d69225bde7a69b235da73377861095455d298f2b970996eec25ddbb42b3d1e" +dependencies = [ + "bitmaps", + "typenum", +] + [[package]] name = "slab" version = "0.4.9" @@ -3502,7 +6774,37 @@ version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" dependencies = [ - "serde", + "serde 1.0.203", +] + +[[package]] +name = "smartcow" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "656fcb1c1fca8c4655372134ce87d8afdf5ec5949ebabe8d314be0141d8b5da2" +dependencies = [ + "smartstring", +] + +[[package]] +name = "smartstring" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fb72c633efbaa2dd666986505016c32c3044395ceaf881518399d2f4127ee29" +dependencies = [ + "autocfg", + "static_assertions", + "version_check", +] + +[[package]] +name = "socket2" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" +dependencies = [ + "libc", + "winapi", ] [[package]] @@ -3539,12 +6841,100 @@ version = "2.8.0-pre0" dependencies = [ "anyhow", "async-trait", - "serde", + "serde 1.0.203", "serde_json", "spin-locked-app", "thiserror", ] +[[package]] +name = "spin-build" +version = "2.8.0-pre0" +dependencies = [ + "anyhow", + "futures", + "serde 1.0.203", + "spin-common", + "spin-manifest", + "subprocess", + "terminal", + "tokio", + "toml 0.5.11", + "tracing", +] + +[[package]] +name = "spin-cli" +version = "2.8.0-pre0" +dependencies = [ + "anyhow", + "async-trait", + "bytes", + "cargo-target-dep", + "chrono", + "clap 3.2.25", + "clearscreen", + "comfy-table", + "command-group", + "ctrlc", + "dialoguer 0.10.4", + "dirs 4.0.0", + "dunce", + "futures", + "glob", + "indicatif 0.17.8", + "is-terminal", + "itertools 0.11.0", + "lazy_static 1.5.0", + "levenshtein", + "nix 0.24.3", + "openssl", + "path-absolutize", + "rand 0.8.5", + "regex", + "reqwest 0.12.7", + "rpassword", + "semver", + "serde 1.0.203", + "serde_json", + "sha2", + "spin-app", + "spin-build", + "spin-common", + "spin-doctor", + "spin-expressions", + "spin-factors", + "spin-factors-executor", + "spin-http", + "spin-key-value", + "spin-key-value-sqlite", + "spin-loader", + "spin-locked-app", + "spin-manifest", + "spin-oci", + "spin-plugins", + "spin-runtime-config", + "spin-runtime-factors", + "spin-telemetry", + "spin-templates", + "spin-trigger", + "spin-trigger-http", + "spin-trigger-redis", + "subprocess", + "tempfile", + "terminal", + "tokio", + "toml 0.6.0", + "tracing", + "url", + "uuid", + "vergen", + "wasmtime", + "watchexec", + "watchexec-filterer-globset", + "wit-component 0.19.1", +] + [[package]] name = "spin-common" version = "2.8.0-pre0" @@ -3566,7 +6956,7 @@ dependencies = [ "wasm-encoder 0.200.0", "wasm-metadata 0.200.0", "wasmparser 0.200.0", - "wit-component", + "wit-component 0.200.0", "wit-parser 0.200.0", ] @@ -3596,6 +6986,25 @@ dependencies = [ "wasmtime", ] +[[package]] +name = "spin-doctor" +version = "2.8.0-pre0" +dependencies = [ + "anyhow", + "async-trait", + "reqwest 0.11.27", + "serde 1.0.203", + "similar", + "spin-common", + "spin-manifest", + "tempfile", + "terminal", + "tokio", + "toml 0.8.14", + "toml_edit 0.20.7", + "tracing", +] + [[package]] name = "spin-expressions" version = "2.8.0-pre0" @@ -3604,7 +7013,7 @@ dependencies = [ "async-trait", "dotenvy", "once_cell", - "serde", + "serde 1.0.203", "spin-locked-app", "thiserror", ] @@ -3632,13 +7041,14 @@ version = "2.8.0-pre0" dependencies = [ "anyhow", "async-trait", - "serde", + "serde 1.0.203", "spin-factors", + "spin-llm-local", "spin-llm-remote-http", "spin-locked-app", "spin-world", "tokio", - "toml", + "toml 0.8.14", "tracing", "url", ] @@ -3748,7 +7158,7 @@ name = "spin-factor-outbound-redis" version = "2.8.0-pre0" dependencies = [ "anyhow", - "redis", + "redis 0.21.7", "spin-core", "spin-factor-outbound-networking", "spin-factors", @@ -3762,13 +7172,13 @@ name = "spin-factor-sqlite" version = "2.8.0-pre0" dependencies = [ "async-trait", - "serde", + "serde 1.0.203", "spin-factors", "spin-locked-app", "spin-world", "table", "tokio", - "toml", + "toml 0.8.14", ] [[package]] @@ -3779,12 +7189,12 @@ dependencies = [ "azure_identity", "azure_security_keyvault", "dotenvy", - "serde", + "serde 1.0.203", "spin-expressions", "spin-factors", "spin-world", "tokio", - "toml", + "toml 0.8.14", "tracing", "vaultrs", ] @@ -3808,11 +7218,11 @@ name = "spin-factors" version = "2.8.0-pre0" dependencies = [ "anyhow", - "serde", + "serde 1.0.203", "spin-app", "spin-factors-derive", "thiserror", - "toml", + "toml 0.8.14", "tracing", "wasmtime", ] @@ -3823,7 +7233,7 @@ version = "2.8.0-pre0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -3882,6 +7292,73 @@ dependencies = [ "tracing", ] +[[package]] +name = "spin-key-value-azure" +version = "2.8.0-pre0" +dependencies = [ + "anyhow", + "azure_data_cosmos", + "azure_identity", + "futures", + "serde 1.0.203", + "spin-core", + "spin-key-value", + "tokio", + "tracing", + "url", +] + +[[package]] +name = "spin-key-value-redis" +version = "2.8.0-pre0" +dependencies = [ + "anyhow", + "redis 0.21.7", + "spin-core", + "spin-key-value", + "spin-world", + "tokio", + "tracing", + "url", +] + +[[package]] +name = "spin-key-value-sqlite" +version = "2.8.0-pre0" +dependencies = [ + "anyhow", + "once_cell", + "rusqlite", + "spin-core", + "spin-key-value", + "spin-world", + "tokio", + "tracing", +] + +[[package]] +name = "spin-llm-local" +version = "2.8.0-pre0" +dependencies = [ + "anyhow", + "candle-core", + "candle-nn", + "chrono", + "llm", + "lru 0.9.0", + "num_cpus", + "rand 0.8.5", + "safetensors", + "serde 1.0.203", + "spin-common", + "spin-core", + "spin-world", + "terminal", + "tokenizers", + "tokio", + "tracing", +] + [[package]] name = "spin-llm-remote-http" version = "2.8.0-pre0" @@ -3889,20 +7366,59 @@ dependencies = [ "anyhow", "http 0.2.12", "reqwest 0.11.27", - "serde", + "serde 1.0.203", "serde_json", "spin-telemetry", "spin-world", "tracing", ] +[[package]] +name = "spin-loader" +version = "2.8.0-pre0" +dependencies = [ + "anyhow", + "async-trait", + "bytes", + "dirs 4.0.0", + "dunce", + "futures", + "glob", + "indexmap 1.9.3", + "itertools 0.10.5", + "lazy_static 1.5.0", + "mime_guess", + "path-absolutize", + "regex", + "reqwest 0.11.27", + "semver", + "serde 1.0.203", + "serde_json", + "sha2", + "shellexpand 3.1.0", + "spin-common", + "spin-locked-app", + "spin-manifest", + "spin-outbound-networking", + "spin-serde", + "tempfile", + "terminal", + "thiserror", + "tokio", + "tokio-util 0.6.10", + "toml 0.8.14", + "tracing", + "walkdir", + "wasm-pkg-loader", +] + [[package]] name = "spin-locked-app" version = "2.8.0-pre0" dependencies = [ "anyhow", "async-trait", - "serde", + "serde 1.0.203", "serde_json", "spin-serde", "thiserror", @@ -3932,6 +7448,82 @@ dependencies = [ "toml", ] +[[package]] +name = "spin-plugins" +version = "2.8.0-pre0" +dependencies = [ + "anyhow", + "bytes", + "chrono", + "dirs 4.0.0", + "fd-lock 3.0.13", + "flate2", + "is-terminal", + "path-absolutize", + "reqwest 0.11.27", + "semver", + "serde 1.0.203", + "serde_json", + "spin-common", + "tar", + "tempfile", + "terminal", + "thiserror", + "tokio", + "tracing", + "url", +] + +[[package]] +name = "spin-runtime-config" +version = "2.8.0-pre0" +dependencies = [ + "anyhow", + "spin-factor-key-value", + "spin-factor-key-value-azure", + "spin-factor-key-value-redis", + "spin-factor-key-value-spin", + "spin-factor-llm", + "spin-factor-outbound-http", + "spin-factor-outbound-mqtt", + "spin-factor-outbound-mysql", + "spin-factor-outbound-networking", + "spin-factor-outbound-pg", + "spin-factor-outbound-redis", + "spin-factor-sqlite", + "spin-factor-variables", + "spin-factor-wasi", + "spin-factors", + "spin-runtime-factors", + "spin-sqlite", + "spin-trigger", + "toml 0.8.14", +] + +[[package]] +name = "spin-runtime-factors" +version = "2.8.0-pre0" +dependencies = [ + "anyhow", + "clap 3.2.25", + "spin-common", + "spin-factor-key-value", + "spin-factor-llm", + "spin-factor-outbound-http", + "spin-factor-outbound-mqtt", + "spin-factor-outbound-mysql", + "spin-factor-outbound-networking", + "spin-factor-outbound-pg", + "spin-factor-outbound-redis", + "spin-factor-sqlite", + "spin-factor-variables", + "spin-factor-wasi", + "spin-factors", + "spin-telemetry", + "terminal", + "tracing", +] + [[package]] name = "spin-serde" version = "2.8.0-pre0" @@ -3939,10 +7531,56 @@ dependencies = [ "anyhow", "base64 0.22.1", "semver", - "serde", + "serde 1.0.203", "wasm-pkg-common", ] +[[package]] +name = "spin-sqlite" +version = "2.8.0-pre0" +dependencies = [ + "async-trait", + "serde 1.0.203", + "spin-factor-sqlite", + "spin-factors", + "spin-locked-app", + "spin-sqlite-inproc", + "spin-sqlite-libsql", + "spin-world", + "table", + "tokio", + "toml 0.8.14", +] + +[[package]] +name = "spin-sqlite-inproc" +version = "2.8.0-pre0" +dependencies = [ + "anyhow", + "async-trait", + "once_cell", + "rand 0.8.5", + "rusqlite", + "spin-factor-sqlite", + "spin-world", + "tokio", + "tracing", +] + +[[package]] +name = "spin-sqlite-libsql" +version = "2.8.0-pre0" +dependencies = [ + "anyhow", + "async-trait", + "libsql", + "rusqlite", + "spin-world", + "sqlparser", + "tokio", + "tracing", +] + [[package]] name = "spin-telemetry" version = "2.8.0-pre0" @@ -3963,36 +7601,121 @@ dependencies = [ ] [[package]] -name = "spin-trigger" +name = "spin-templates" +version = "2.8.0-pre0" +dependencies = [ + "anyhow", + "async-trait", + "bytes", + "console", + "dialoguer 0.10.4", + "dirs 3.0.2", + "fs_extra", + "heck 0.4.1", + "indexmap 1.9.3", + "itertools 0.10.5", + "lazy_static 1.5.0", + "liquid", + "liquid-core", + "liquid-derive", + "liquid-lib", + "path-absolutize", + "pathdiff", + "regex", + "semver", + "serde 1.0.203", + "spin-common", + "spin-manifest", + "tempfile", + "tokio", + "toml 0.5.11", + "toml_edit 0.20.7", + "url", + "walkdir", +] + +[[package]] +name = "spin-trigger" +version = "2.8.0-pre0" +dependencies = [ + "anyhow", + "clap 3.2.25", + "ctrlc", + "futures", + "sanitize-filename", + "serde 1.0.203", + "serde_json", + "spin-app", + "spin-common", + "spin-componentize", + "spin-compose", + "spin-core", + "spin-factor-key-value", + "spin-factor-sqlite", + "spin-factor-wasi", + "spin-factors", + "spin-factors-executor", + "spin-telemetry", + "tokio", + "tracing", +] + +[[package]] +name = "spin-trigger-http" +version = "2.8.0-pre0" +dependencies = [ + "anyhow", + "async-trait", + "clap 3.2.25", + "futures", + "futures-util", + "http 1.1.0", + "http-body-util", + "hyper 1.4.1", + "hyper-util", + "indexmap 1.9.3", + "percent-encoding", + "rustls 0.22.4", + "rustls-pemfile 2.1.3", + "rustls-pki-types", + "serde 1.0.203", + "serde_json", + "spin-app", + "spin-core", + "spin-factor-outbound-http", + "spin-factor-wasi", + "spin-factors", + "spin-http", + "spin-outbound-networking", + "spin-telemetry", + "spin-trigger", + "spin-world", + "terminal", + "tls-listener", + "tokio", + "tokio-rustls 0.25.0", + "tracing", + "url", + "wasmtime", + "wasmtime-wasi", + "wasmtime-wasi-http", + "webpki-roots 0.26.3", +] + +[[package]] +name = "spin-trigger-redis" version = "2.8.0-pre0" dependencies = [ "anyhow", - "clap", - "ctrlc", + "async-trait", "futures", - "sanitize-filename", - "serde", - "serde_json", - "spin-app", - "spin-common", - "spin-componentize", - "spin-compose", - "spin-core", - "spin-factor-key-value", - "spin-factor-llm", - "spin-factor-outbound-http", - "spin-factor-outbound-mqtt", - "spin-factor-outbound-mysql", - "spin-factor-outbound-networking", - "spin-factor-outbound-pg", - "spin-factor-outbound-redis", - "spin-factor-sqlite", + "redis 0.26.1", + "serde 1.0.203", "spin-factor-variables", - "spin-factor-wasi", "spin-factors", - "spin-factors-executor", "spin-telemetry", - "terminal", + "spin-trigger", + "spin-world", "tokio", "toml", "tracing", @@ -4006,12 +7729,43 @@ dependencies = [ "wasmtime", ] +[[package]] +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "spm_precompiled" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5851699c4033c63636f7ea4cf7b7c1f1bf06d0cc03cfb42e711de5a5c46cf326" +dependencies = [ + "base64 0.13.1", + "nom 7.1.3", + "serde 1.0.203", + "unicode-segmentation", +] + [[package]] name = "sptr" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b9b39299b249ad65f3b7e96443bad61c02ca5cd3589f46cb6d610a0fd6c0d6a" +[[package]] +name = "sqlparser" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37d3706eefb17039056234df6b566b0014f303f867f2656108334a55b8096f59" +dependencies = [ + "log", +] + [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -4041,6 +7795,31 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "strum" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cae14b91c7d11c9a851d3fbc80a963198998c2a64eec840477fa92d8ce9b70bb" + +[[package]] +name = "strum_macros" +version = "0.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5bb0dc7ee9c15cea6199cde9a127fa16a4c5819af85395457ad72d68edc85a38" +dependencies = [ + "heck 0.3.3", + "proc-macro2", + "quote", + "rustversion", + "syn 1.0.109", +] + [[package]] name = "subprocess" version = "0.2.9" @@ -4070,9 +7849,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.75" +version = "2.0.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6af063034fc1935ede7be0122941bafa9bacb949334d090b77ca98b5817c7d9" +checksum = "578e081a14e0cefc3279b0472138c513f37b41a08d5a3cca9b6e4e8ceb6cd525" dependencies = [ "proc-macro2", "quote", @@ -4090,6 +7869,9 @@ name = "sync_wrapper" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +dependencies = [ + "futures-core", +] [[package]] name = "synstructure" @@ -4111,7 +7893,18 @@ checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" dependencies = [ "bitflags 1.3.2", "core-foundation", - "system-configuration-sys", + "system-configuration-sys 0.5.0", +] + +[[package]] +name = "system-configuration" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" +dependencies = [ + "bitflags 2.4.2", + "core-foundation", + "system-configuration-sys 0.6.0", ] [[package]] @@ -4124,6 +7917,16 @@ dependencies = [ "libc", ] +[[package]] +name = "system-configuration-sys" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "system-interface" version = "0.27.2" @@ -4133,9 +7936,9 @@ dependencies = [ "bitflags 2.4.2", "cap-fs-ext", "cap-std", - "fd-lock", - "io-lifetimes", - "rustix", + "fd-lock 4.0.2", + "io-lifetimes 2.0.3", + "rustix 0.38.35", "windows-sys 0.52.0", "winx", ] @@ -4144,6 +7947,17 @@ dependencies = [ name = "table" version = "2.8.0-pre0" +[[package]] +name = "tar" +version = "0.4.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb797dad5fb5b76fcf519e702f4a589483b5ef06567f160c392832c1f5e44909" +dependencies = [ + "filetime", + "libc", + "xattr 1.3.1", +] + [[package]] name = "target-lexicon" version = "0.12.13" @@ -4152,13 +7966,14 @@ checksum = "69758bda2e78f098e4ccb393021a0963bb3442eac05f135c30f61b7370bbafae" [[package]] name = "tempfile" -version = "3.10.1" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +checksum = "b8fcd239983515c23a32fb82099f97d0b11b8c72f654ed659363a95c3dad7a53" dependencies = [ "cfg-if", - "fastrand 2.1.0", - "rustix", + "fastrand 2.1.1", + "once_cell", + "rustix 0.38.35", "windows-sys 0.52.0", ] @@ -4180,6 +7995,19 @@ dependencies = [ "termcolor", ] +[[package]] +name = "terminfo" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "666cd3a6681775d22b200409aad3b089c5b99fb11ecdd8a204d9d62f8148498f" +dependencies = [ + "dirs 4.0.0", + "fnv", + "nom 7.1.3", + "phf", + "phf_codegen", +] + [[package]] name = "textwrap" version = "0.16.0" @@ -4203,7 +8031,7 @@ checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -4229,7 +8057,7 @@ dependencies = [ "num-conv", "num_threads", "powerfmt", - "serde", + "serde 1.0.203", "time-core", "time-macros", ] @@ -4250,6 +8078,15 @@ dependencies = [ "time-core", ] +[[package]] +name = "tint" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7af24570664a3074673dbbf69a65bdae0ae0b72f2949b1adfbacb736ee4d6896" +dependencies = [ + "lazy_static 0.2.11", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -4265,23 +8102,71 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" +[[package]] +name = "tls-listener" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83a296135fdab7b3a1f708c338c50bab570bcd77d44080cde9341df45c0c6d73" +dependencies = [ + "futures-util", + "pin-project-lite", + "thiserror", + "tokio", + "tokio-rustls 0.26.0", +] + +[[package]] +name = "tokenizers" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aea68938177975ab09da68552b720eac941779ff386baceaf77e0f5f9cea645f" +dependencies = [ + "aho-corasick 0.7.20", + "cached-path", + "clap 4.5.16", + "derive_builder 0.12.0", + "dirs 4.0.0", + "esaxx-rs", + "getrandom 0.2.12", + "indicatif 0.15.0", + "itertools 0.9.0", + "lazy_static 1.5.0", + "log", + "macro_rules_attribute", + "monostate", + "onig", + "paste", + "rand 0.8.5", + "rayon", + "rayon-cond", + "regex", + "regex-syntax 0.7.5", + "reqwest 0.11.27", + "serde 1.0.203", + "serde_json", + "spm_precompiled", + "thiserror", + "unicode-normalization-alignments", + "unicode-segmentation", + "unicode_categories", +] + [[package]] name = "tokio" -version = "1.36.0" +version = "1.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" +checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" dependencies = [ "backtrace", "bytes", "libc", - "mio", - "num_cpus", + "mio 1.0.2", "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2", + "socket2 0.5.5", "tokio-macros", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -4296,13 +8181,13 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.2.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -4335,9 +8220,9 @@ dependencies = [ "postgres-protocol", "postgres-types", "rand 0.8.5", - "socket2", + "socket2 0.5.5", "tokio", - "tokio-util", + "tokio-util 0.7.11", "whoami", ] @@ -4383,6 +8268,18 @@ dependencies = [ "tokio-stream", ] +[[package]] +name = "tokio-socks" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d4770b8024672c1101b3f6733eab95b18007dbe0847a8afe341fcf79e06043f" +dependencies = [ + "either", + "futures-util", + "thiserror", + "tokio", +] + [[package]] name = "tokio-stream" version = "0.1.14" @@ -4394,6 +8291,20 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-util" +version = "0.6.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36943ee01a6d67977dd3f84a5a1d2efeb4ada3a1ae771cadfaa535d9d9fc6507" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "log", + "pin-project-lite", + "tokio", +] + [[package]] name = "tokio-util" version = "0.7.11" @@ -4402,21 +8313,53 @@ checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" dependencies = [ "bytes", "futures-core", + "futures-io", "futures-sink", "pin-project-lite", "tokio", ] +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde 1.0.203", +] + +[[package]] +name = "toml" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb9d890e4dc9298b70f740f615f2e05b9db37dce531f6b24fb77ac993f9f217" +dependencies = [ + "serde 1.0.203", + "serde_spanned", + "toml_datetime 0.5.1", + "toml_edit 0.18.1", +] + [[package]] name = "toml" version = "0.8.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f49eb2ab21d2f26bd6db7bf383edc527a7ebaee412d17af4d40fdccd442f335" dependencies = [ - "serde", + "indexmap 2.2.6", + "serde 1.0.203", "serde_spanned", - "toml_datetime", - "toml_edit", + "toml_datetime 0.6.6", + "toml_edit 0.22.14", +] + +[[package]] +name = "toml_datetime" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4553f467ac8e3d374bc9a177a26801e5d0f9b211aa1673fb137a403afd1c9cf5" +dependencies = [ + "serde 1.0.203", ] [[package]] @@ -4425,7 +8368,44 @@ version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" dependencies = [ - "serde", + "serde 1.0.203", +] + +[[package]] +name = "toml_edit" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56c59d8dd7d0dcbc6428bf7aa2f0e823e26e43b3c9aca15bbc9475d23e5fa12b" +dependencies = [ + "indexmap 1.9.3", + "nom8", + "serde 1.0.203", + "serde_spanned", + "toml_datetime 0.5.1", +] + +[[package]] +name = "toml_edit" +version = "0.19.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +dependencies = [ + "indexmap 2.2.6", + "toml_datetime 0.6.6", + "winnow 0.5.40", +] + +[[package]] +name = "toml_edit" +version = "0.20.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" +dependencies = [ + "indexmap 2.2.6", + "serde 1.0.203", + "serde_spanned", + "toml_datetime 0.6.6", + "winnow 0.5.40", ] [[package]] @@ -4435,10 +8415,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f21c7aaf97f1bd9ca9d4f9e73b0a6c74bd5afef56f2bc931943a6e1c37e04e38" dependencies = [ "indexmap 2.2.6", - "serde", + "serde 1.0.203", "serde_spanned", - "toml_datetime", - "winnow", + "toml_datetime 0.6.6", + "winnow 0.6.13", ] [[package]] @@ -4482,7 +8462,7 @@ dependencies = [ "rand 0.8.5", "slab", "tokio", - "tokio-util", + "tokio-util 0.7.11", "tower-layer", "tower-service", "tracing", @@ -4532,7 +8512,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -4545,6 +8525,17 @@ dependencies = [ "valuable", ] +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + [[package]] name = "tracing-opentelemetry" version = "0.23.0" @@ -4558,6 +8549,7 @@ dependencies = [ "smallvec", "tracing", "tracing-core", + "tracing-log", "tracing-subscriber", "web-time", ] @@ -4568,7 +8560,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc6b213177105856957181934e4920de57730fc69bf42c37ee5bb664d406d9e1" dependencies = [ - "serde", + "serde 1.0.203", "tracing-core", ] @@ -4582,13 +8574,14 @@ dependencies = [ "nu-ansi-term", "once_cell", "regex", - "serde", + "serde 1.0.203", "serde_json", "sharded-slab", "smallvec", "thread_local", "tracing", "tracing-core", + "tracing-log", "tracing-serde", ] @@ -4597,9 +8590,10 @@ name = "trigger-timer" version = "0.1.0" dependencies = [ "anyhow", - "clap", + "clap 3.2.25", "futures", - "serde", + "serde 1.0.203", + "spin-cli", "spin-factors", "spin-trigger", "tokio", @@ -4639,12 +8633,53 @@ dependencies = [ "const_fn", ] +[[package]] +name = "ucd-trie" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" + +[[package]] +name = "uds_windows" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89daebc3e6fd160ac4aa9fc8b3bf71e1f74fbf92367ae71fb83a037e8bf164b9" +dependencies = [ + "memoffset 0.9.0", + "tempfile", + "winapi", +] + +[[package]] +name = "uncased" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1b88fcfe09e89d3866a5c11019378088af2d24c3fbd4f0543f96b479ec90697" +dependencies = [ + "version_check", +] + +[[package]] +name = "unicase" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" +dependencies = [ + "version_check", +] + [[package]] name = "unicode-bidi" version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" +[[package]] +name = "unicode-bom" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63ec69f541d875b783ca40184d655f2927c95f0bffd486faa83cd3ac3529ec32" + [[package]] name = "unicode-ident" version = "1.0.12" @@ -4657,7 +8692,16 @@ version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" dependencies = [ - "tinyvec", + "tinyvec", +] + +[[package]] +name = "unicode-normalization-alignments" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43f613e4fa046e69818dd287fdc4bc78175ff20331479dab6e1b0f98d57062de" +dependencies = [ + "smallvec", ] [[package]] @@ -4666,6 +8710,12 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52ea75f83c0137a9b98608359a5f1af8144876eb67bcb1ce837368e906a9f524" +[[package]] +name = "unicode-segmentation" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" + [[package]] name = "unicode-width" version = "0.1.11" @@ -4678,6 +8728,18 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +[[package]] +name = "unicode_categories" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" + +[[package]] +name = "unsafe-libyaml" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" + [[package]] name = "untrusted" version = "0.9.0" @@ -4693,7 +8755,7 @@ dependencies = [ "form_urlencoded", "idna", "percent-encoding", - "serde", + "serde 1.0.203", ] [[package]] @@ -4702,6 +8764,12 @@ version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + [[package]] name = "uuid" version = "1.7.0" @@ -4717,6 +8785,12 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" +[[package]] +name = "value-bag" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a84c137d37ab0142f0f2ddfe332651fdbf252e7b7dbb4e67b6c1f1b2e925101" + [[package]] name = "vaultrs" version = "0.6.2" @@ -4725,12 +8799,12 @@ checksum = "267f958930e08323a44c12e6c5461f3eaaa16d88785e9ec8550215b8aafc3d0b" dependencies = [ "async-trait", "bytes", - "derive_builder", + "derive_builder 0.11.2", "http 0.2.12", "reqwest 0.11.27", "rustify", "rustify_derive", - "serde", + "serde 1.0.203", "serde_json", "thiserror", "tracing", @@ -4743,6 +8817,20 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" +[[package]] +name = "vergen" +version = "8.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2990d9ea5967266ea0ccf413a4aa5c42a93dbcfda9cb49a97de6931726b12566" +dependencies = [ + "anyhow", + "cargo_metadata", + "cfg-if", + "regex", + "rustversion", + "time", +] + [[package]] name = "version_check" version = "0.9.4" @@ -4788,6 +8876,16 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "317211a0dc0ceedd78fb2ca9a44aed3d7b9b26f81870d485c07122b4350673b7" +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + [[package]] name = "want" version = "0.3.1" @@ -4797,6 +8895,144 @@ dependencies = [ "try-lock", ] +[[package]] +name = "warg-api" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a22d3c9026f2f6a628cf386963844cdb7baea3b3419ba090c9096da114f977d" +dependencies = [ + "indexmap 2.2.6", + "itertools 0.12.1", + "serde 1.0.203", + "serde_with", + "thiserror", + "warg-crypto", + "warg-protocol", +] + +[[package]] +name = "warg-client" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b8b5a2b17e737e1847dbf4642e4ebe49f5df32a574520251ff080ef0a120423" +dependencies = [ + "anyhow", + "async-recursion", + "async-trait", + "bytes", + "clap 4.5.16", + "dialoguer 0.11.0", + "dirs 5.0.1", + "futures-util", + "indexmap 2.2.6", + "itertools 0.12.1", + "keyring", + "libc", + "normpath", + "once_cell", + "pathdiff", + "ptree", + "reqwest 0.12.7", + "secrecy", + "semver", + "serde 1.0.203", + "serde_json", + "sha256", + "tempfile", + "thiserror", + "tokio", + "tokio-util 0.7.11", + "tracing", + "url", + "walkdir", + "warg-api", + "warg-crypto", + "warg-protocol", + "warg-transparency", + "wasm-compose", + "wasm-encoder 0.41.2", + "wasmparser 0.121.2", + "wasmprinter 0.2.80", + "windows-sys 0.52.0", +] + +[[package]] +name = "warg-crypto" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "834bf58863aa4bc3821732afb0c77e08a5cbf05f63ee93116acae694eab04460" +dependencies = [ + "anyhow", + "base64 0.21.7", + "digest", + "hex", + "leb128", + "once_cell", + "p256", + "rand_core 0.6.4", + "secrecy", + "serde 1.0.203", + "sha2", + "signature", + "thiserror", +] + +[[package]] +name = "warg-protobuf" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf8a2dee6b14f5b0b0c461711a81cdef45d45ea94f8460cb6205cada7fec732a" +dependencies = [ + "anyhow", + "pbjson", + "pbjson-build", + "pbjson-types", + "prost", + "prost-build", + "prost-types", + "protox", + "regex", + "serde 1.0.203", + "warg-crypto", +] + +[[package]] +name = "warg-protocol" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4053a3276d3fee83645411b1b5f462f72402e70fbf645164274a3a0a2fd72538" +dependencies = [ + "anyhow", + "base64 0.21.7", + "hex", + "indexmap 2.2.6", + "pbjson-types", + "prost", + "prost-types", + "semver", + "serde 1.0.203", + "serde_with", + "thiserror", + "warg-crypto", + "warg-protobuf", + "warg-transparency", + "wasmparser 0.121.2", +] + +[[package]] +name = "warg-transparency" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "513ef81a5bb1ac5d7bd04f90d3c192dad8f590f4c02b3ef68d3ae4fbbb53c1d7" +dependencies = [ + "anyhow", + "indexmap 2.2.6", + "prost", + "thiserror", + "warg-crypto", + "warg-protobuf", +] + [[package]] name = "wasi" version = "0.9.0+wasi-snapshot-preview1" @@ -4837,15 +9073,15 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.42" +version = "0.4.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" +checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" dependencies = [ "cfg-if", "js-sys", @@ -4871,7 +9107,7 @@ checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4882,6 +9118,46 @@ version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" +[[package]] +name = "wasm-compose" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd324927af875ebedb1b820c00e3c585992d33c2c787c5021fe6d8982527359b" +dependencies = [ + "anyhow", + "heck 0.4.1", + "im-rc", + "indexmap 2.2.6", + "log", + "petgraph", + "serde 1.0.203", + "serde_derive", + "serde_yaml", + "smallvec", + "wasm-encoder 0.41.2", + "wasmparser 0.121.2", + "wat", +] + +[[package]] +name = "wasm-encoder" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "111495d6204760238512f57a9af162f45086504da332af210f2f75dd80b34f1d" +dependencies = [ + "leb128", +] + +[[package]] +name = "wasm-encoder" +version = "0.41.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "972f97a5d8318f908dded23594188a90bcd09365986b1163e66d70170e5287ae" +dependencies = [ + "leb128", + "wasmparser 0.121.2", +] + [[package]] name = "wasm-encoder" version = "0.200.0" @@ -4918,6 +9194,22 @@ dependencies = [ "leb128", ] +[[package]] +name = "wasm-metadata" +version = "0.10.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18ebaa7bd0f9e7a5e5dd29b9a998acf21c4abed74265524dd7e85934597bfb10" +dependencies = [ + "anyhow", + "indexmap 2.2.6", + "serde 1.0.203", + "serde_derive", + "serde_json", + "spdx", + "wasm-encoder 0.41.2", + "wasmparser 0.121.2", +] + [[package]] name = "wasm-metadata" version = "0.200.0" @@ -4926,7 +9218,7 @@ checksum = "c31b8cc0c21f46d55b0aaa419cacce1eadcf28eaebd0e1488d6a6313ee71a586" dependencies = [ "anyhow", "indexmap 2.2.6", - "serde", + "serde 1.0.203", "serde_derive", "serde_json", "spdx", @@ -4942,7 +9234,7 @@ checksum = "094aea3cb90e09f16ee25a4c0e324b3e8c934e7fd838bfa039aef5352f44a917" dependencies = [ "anyhow", "indexmap 2.2.6", - "serde", + "serde 1.0.203", "serde_derive", "serde_json", "spdx", @@ -4950,6 +9242,22 @@ dependencies = [ "wasmparser 0.202.0", ] +[[package]] +name = "wasm-metadata" +version = "0.209.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d32029ce424f6d3c2b39b4419fb45a0e2d84fb0751e0c0a32b7ce8bd5d97f46" +dependencies = [ + "anyhow", + "indexmap 2.2.6", + "serde 1.0.203", + "serde_derive", + "serde_json", + "spdx", + "wasm-encoder 0.209.1", + "wasmparser 0.209.1", +] + [[package]] name = "wasm-pkg-common" version = "0.4.1" @@ -4959,12 +9267,44 @@ dependencies = [ "anyhow", "dirs 5.0.1", "http 1.1.0", + "reqwest 0.12.7", "semver", - "serde", + "serde 1.0.203", "serde_json", "thiserror", - "toml", + "toml 0.8.14", + "tracing", +] + +[[package]] +name = "wasm-pkg-loader" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11338b173351bc505bc752c00068a7d1da5106a9d351753f0d01267dcc4747b2" +dependencies = [ + "anyhow", + "async-trait", + "base64 0.22.1", + "bytes", + "dirs 5.0.1", + "docker_credential", + "futures-util", + "oci-distribution 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "oci-wasm", + "secrecy", + "serde 1.0.203", + "serde_json", + "sha2", + "thiserror", + "tokio", + "tokio-util 0.7.11", + "toml 0.8.14", "tracing", + "tracing-subscriber", + "url", + "warg-client", + "warg-protocol", + "wasm-pkg-common", ] [[package]] @@ -4980,6 +9320,28 @@ dependencies = [ "web-sys", ] +[[package]] +name = "wasmparser" +version = "0.119.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c35daf77afb4f9b14016625144a391085ec2ca99ca9cc53ed291bb53ab5278d" +dependencies = [ + "bitflags 2.4.2", + "indexmap 2.2.6", + "semver", +] + +[[package]] +name = "wasmparser" +version = "0.121.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dbe55c8f9d0dbd25d9447a5a889ff90c0cc3feaa7395310d3d826b2c703eaab" +dependencies = [ + "bitflags 2.4.2", + "indexmap 2.2.6", + "semver", +] + [[package]] name = "wasmparser" version = "0.200.0" @@ -5013,7 +9375,17 @@ dependencies = [ "hashbrown 0.14.3", "indexmap 2.2.6", "semver", - "serde", + "serde 1.0.203", +] + +[[package]] +name = "wasmprinter" +version = "0.2.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60e73986a6b7fdfedb7c5bf9e7eb71135486507c8fbc4c0c42cffcb6532988b7" +dependencies = [ + "anyhow", + "wasmparser 0.121.2", ] [[package]] @@ -5049,16 +9421,16 @@ dependencies = [ "log", "mach2", "memfd", - "memoffset", + "memoffset 0.9.0", "object 0.36.0", "once_cell", "paste", "postcard", "psm", "rayon", - "rustix", + "rustix 0.38.35", "semver", - "serde", + "serde 1.0.203", "serde_derive", "serde_json", "smallvec", @@ -5102,11 +9474,11 @@ dependencies = [ "directories-next", "log", "postcard", - "rustix", - "serde", + "rustix 0.38.35", + "serde 1.0.203", "serde_derive", "sha2", - "toml", + "toml 0.8.14", "windows-sys 0.52.0", "zstd 0.13.1", ] @@ -5120,7 +9492,7 @@ dependencies = [ "anyhow", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", "wasmtime-component-util", "wasmtime-wit-bindgen", "wit-parser 0.209.1", @@ -5171,12 +9543,12 @@ dependencies = [ "object 0.36.0", "postcard", "rustc-demangle", - "serde", + "serde 1.0.203", "serde_derive", "target-lexicon", "wasm-encoder 0.209.1", "wasmparser 0.209.1", - "wasmprinter", + "wasmprinter 0.209.1", "wasmtime-component-util", "wasmtime-types", ] @@ -5190,7 +9562,7 @@ dependencies = [ "anyhow", "cc", "cfg-if", - "rustix", + "rustix 0.38.35", "wasmtime-asm-macros", "wasmtime-versioned-export-macros", "windows-sys 0.52.0", @@ -5204,7 +9576,7 @@ checksum = "9bc54198c6720f098210a85efb3ba8c078d1de4d373cdb6778850a66ae088d11" dependencies = [ "object 0.36.0", "once_cell", - "rustix", + "rustix 0.38.35", "wasmtime-versioned-export-macros", ] @@ -5233,7 +9605,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "412463e9000e14cf6856be48628d2213c20c153e29ffc22b036980c892ea6964" dependencies = [ "cranelift-entity", - "serde", + "serde 1.0.203", "serde_derive", "smallvec", "wasmparser 0.209.1", @@ -5247,7 +9619,7 @@ checksum = "de5a9bc4f44ceeb168e9e8e3be4e0b4beb9095b468479663a9e24c667e36826f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -5268,9 +9640,9 @@ dependencies = [ "fs-set-times", "futures", "io-extras", - "io-lifetimes", + "io-lifetimes 2.0.3", "once_cell", - "rustix", + "rustix 0.38.35", "system-interface", "thiserror", "tokio", @@ -5328,7 +9700,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70dc077306b38288262e5ba01d4b21532a6987416cdc0aedf04bb06c22a68fdc" dependencies = [ "anyhow", - "heck", + "heck 0.4.1", "indexmap 2.2.6", "wit-parser 0.209.1", ] @@ -5364,11 +9736,80 @@ dependencies = [ "wast 211.0.1", ] +[[package]] +name = "watchexec" +version = "2.3.0" +source = "git+https://github.com/watchexec/watchexec.git?rev=8e91d26ef6400c1e60b32a8314cbb144fa33f288#8e91d26ef6400c1e60b32a8314cbb144fa33f288" +dependencies = [ + "async-priority-channel", + "async-recursion", + "atomic-take", + "clearscreen", + "command-group", + "futures", + "ignore-files", + "miette 5.10.0", + "nix 0.26.4", + "normalize-path", + "notify", + "once_cell", + "project-origins", + "thiserror", + "tokio", + "tracing", + "watchexec-events", + "watchexec-signals", +] + +[[package]] +name = "watchexec-events" +version = "1.0.0" +source = "git+https://github.com/watchexec/watchexec.git?rev=8e91d26ef6400c1e60b32a8314cbb144fa33f288#8e91d26ef6400c1e60b32a8314cbb144fa33f288" +dependencies = [ + "nix 0.26.4", + "notify", + "watchexec-signals", +] + +[[package]] +name = "watchexec-filterer-globset" +version = "1.2.0" +source = "git+https://github.com/watchexec/watchexec.git?rev=8e91d26ef6400c1e60b32a8314cbb144fa33f288#8e91d26ef6400c1e60b32a8314cbb144fa33f288" +dependencies = [ + "ignore", + "ignore-files", + "tracing", + "watchexec", + "watchexec-filterer-ignore", +] + +[[package]] +name = "watchexec-filterer-ignore" +version = "1.2.0" +source = "git+https://github.com/watchexec/watchexec.git?rev=8e91d26ef6400c1e60b32a8314cbb144fa33f288#8e91d26ef6400c1e60b32a8314cbb144fa33f288" +dependencies = [ + "ignore", + "ignore-files", + "tracing", + "watchexec", + "watchexec-signals", +] + +[[package]] +name = "watchexec-signals" +version = "1.0.0" +source = "git+https://github.com/watchexec/watchexec.git?rev=8e91d26ef6400c1e60b32a8314cbb144fa33f288#8e91d26ef6400c1e60b32a8314cbb144fa33f288" +dependencies = [ + "miette 5.10.0", + "nix 0.26.4", + "thiserror", +] + [[package]] name = "web-sys" -version = "0.3.69" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" dependencies = [ "js-sys", "wasm-bindgen", @@ -5394,9 +9835,21 @@ checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" name = "webpki-roots" version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd7c23921eeb1713a4e851530e9b9756e4fb0e89978582942612524cf09f01cd" +checksum = "bd7c23921eeb1713a4e851530e9b9756e4fb0e89978582942612524cf09f01cd" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "which" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" dependencies = [ - "rustls-pki-types", + "either", + "home", + "once_cell", + "rustix 0.38.35", ] [[package]] @@ -5405,7 +9858,7 @@ version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a44ab49fad634e88f55bf8f9bb3abd2f27d7204172a112c7c9987e01c1c94ea9" dependencies = [ - "redox_syscall", + "redox_syscall 0.4.1", "wasite", "web-sys", ] @@ -5432,11 +9885,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "557567f2793508760cd855f7659b7a0b9dc4dbc451f53f1415d6943a15311ade" dependencies = [ "anyhow", - "heck", + "heck 0.4.1", "proc-macro2", "quote", - "shellexpand", - "syn 2.0.75", + "shellexpand 2.1.2", + "syn 2.0.76", "witx", ] @@ -5448,7 +9901,7 @@ checksum = "cc26129a8aea20b62c961d1b9ab4a3c3b56b10042ed85d004f8678af0f21ba6e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", "wiggle-generate", ] @@ -5500,13 +9953,67 @@ dependencies = [ "wasmtime-environ", ] +[[package]] +name = "windows" +version = "0.43.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04662ed0e3e5630dfa9b26e4cb823b817f1a9addda855d973a9458c236556244" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + [[package]] name = "windows-core" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-registry" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" +dependencies = [ + "windows-result", + "windows-strings", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-result" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-strings" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +dependencies = [ + "windows-result", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", ] [[package]] @@ -5524,7 +10031,31 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", ] [[package]] @@ -5544,20 +10075,26 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" @@ -5566,9 +10103,15 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.5" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" [[package]] name = "windows_aarch64_msvc" @@ -5578,9 +10121,15 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.5" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" [[package]] name = "windows_i686_gnu" @@ -5590,15 +10139,21 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] name = "windows_i686_gnullvm" -version = "0.52.5" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" [[package]] name = "windows_i686_msvc" @@ -5608,9 +10163,15 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.5" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" [[package]] name = "windows_x86_64_gnu" @@ -5620,9 +10181,15 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.5" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" [[package]] name = "windows_x86_64_gnullvm" @@ -5632,9 +10199,15 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.5" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[package]] name = "windows_x86_64_msvc" @@ -5644,34 +10217,33 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.13" +version = "0.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59b5e5f6c299a3c7890b876a2a587f3115162487e704907d9b6cd29473052ba1" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" dependencies = [ "memchr", ] [[package]] -name = "winreg" -version = "0.50.0" +name = "winnow" +version = "0.6.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +checksum = "59b5e5f6c299a3c7890b876a2a587f3115162487e704907d9b6cd29473052ba1" dependencies = [ - "cfg-if", - "windows-sys 0.48.0", + "memchr", ] [[package]] name = "winreg" -version = "0.52.0" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" dependencies = [ "cfg-if", "windows-sys 0.48.0", @@ -5687,6 +10259,25 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "wit-component" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "429e3c06fba3a7566aab724ae3ffff3152ede5399d44789e7dd11f5421292859" +dependencies = [ + "anyhow", + "bitflags 2.4.2", + "indexmap 2.2.6", + "log", + "serde 1.0.203", + "serde_derive", + "serde_json", + "wasm-encoder 0.39.0", + "wasm-metadata 0.10.20", + "wasmparser 0.119.0", + "wit-parser 0.13.2", +] + [[package]] name = "wit-component" version = "0.200.0" @@ -5697,7 +10288,7 @@ dependencies = [ "bitflags 2.4.2", "indexmap 2.2.6", "log", - "serde", + "serde 1.0.203", "serde_derive", "serde_json", "wasm-encoder 0.200.0", @@ -5706,6 +10297,42 @@ dependencies = [ "wit-parser 0.200.0", ] +[[package]] +name = "wit-component" +version = "0.209.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25a2bb5b039f9cb03425e1d5a6e54b441ca4ca1b1d4fa6a0924db67a55168f99" +dependencies = [ + "anyhow", + "bitflags 2.4.2", + "indexmap 2.2.6", + "log", + "serde 1.0.203", + "serde_derive", + "serde_json", + "wasm-encoder 0.209.1", + "wasm-metadata 0.209.1", + "wasmparser 0.209.1", + "wit-parser 0.209.1", +] + +[[package]] +name = "wit-parser" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "316b36a9f0005f5aa4b03c39bc3728d045df136f8c13a73b7db4510dec725e08" +dependencies = [ + "anyhow", + "id-arena", + "indexmap 2.2.6", + "log", + "semver", + "serde 1.0.203", + "serde_derive", + "serde_json", + "unicode-xid", +] + [[package]] name = "wit-parser" version = "0.200.0" @@ -5717,7 +10344,7 @@ dependencies = [ "indexmap 2.2.6", "log", "semver", - "serde", + "serde 1.0.203", "serde_derive", "serde_json", "unicode-xid", @@ -5735,7 +10362,7 @@ dependencies = [ "indexmap 2.2.6", "log", "semver", - "serde", + "serde 1.0.203", "serde_derive", "serde_json", "unicode-xid", @@ -5754,6 +10381,111 @@ dependencies = [ "wast 35.0.2", ] +[[package]] +name = "xattr" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d1526bbe5aaeb5eb06885f4d987bcdfa5e23187055de9b83fe00156a821fabc" +dependencies = [ + "libc", +] + +[[package]] +name = "xattr" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f" +dependencies = [ + "libc", + "linux-raw-sys 0.4.14", + "rustix 0.38.35", +] + +[[package]] +name = "xdg-home" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec1cdab258fb55c0da61328dc52c8764709b249011b2cad0454c72f0bf10a1f6" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] + +[[package]] +name = "yaml-rust" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" +dependencies = [ + "linked-hash-map", +] + +[[package]] +name = "zbus" +version = "3.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "675d170b632a6ad49804c8cf2105d7c31eddd3312555cffd4b740e08e97c25e6" +dependencies = [ + "async-broadcast", + "async-executor", + "async-fs", + "async-io 1.13.0", + "async-lock 2.8.0", + "async-process 1.8.1", + "async-recursion", + "async-task", + "async-trait", + "blocking", + "byteorder", + "derivative", + "enumflags2", + "event-listener 2.5.3", + "futures-core", + "futures-sink", + "futures-util", + "hex", + "nix 0.26.4", + "once_cell", + "ordered-stream", + "rand 0.8.5", + "serde 1.0.203", + "serde_repr", + "sha1 0.10.6", + "static_assertions", + "tracing", + "uds_windows", + "winapi", + "xdg-home", + "zbus_macros", + "zbus_names", + "zvariant", +] + +[[package]] +name = "zbus_macros" +version = "3.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7131497b0f887e8061b430c530240063d33bf9455fa34438f388a245da69e0a5" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "regex", + "syn 1.0.109", + "zvariant_utils", +] + +[[package]] +name = "zbus_names" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "437d738d3750bed6ca9b8d423ccc7a8eb284f6b1d6d4e225a0e4e6258d864c8d" +dependencies = [ + "serde 1.0.203", + "static_assertions", + "zvariant", +] + [[package]] name = "zerocopy" version = "0.7.32" @@ -5772,7 +10504,7 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -5780,6 +10512,49 @@ name = "zeroize" version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.76", +] + +[[package]] +name = "zip" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" +dependencies = [ + "aes", + "byteorder", + "bzip2", + "constant_time_eq", + "crc32fast", + "crossbeam-utils", + "flate2", + "hmac", + "pbkdf2", + "sha1 0.10.6", + "time", + "zstd 0.11.2+zstd.1.5.2", +] + +[[package]] +name = "zstd" +version = "0.11.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" +dependencies = [ + "zstd-safe 5.0.2+zstd.1.5.2", +] [[package]] name = "zstd" @@ -5799,6 +10574,16 @@ dependencies = [ "zstd-safe 7.1.0", ] +[[package]] +name = "zstd-safe" +version = "5.0.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" +dependencies = [ + "libc", + "zstd-sys", +] + [[package]] name = "zstd-safe" version = "6.0.6" @@ -5827,3 +10612,41 @@ dependencies = [ "cc", "pkg-config", ] + +[[package]] +name = "zvariant" +version = "3.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4eef2be88ba09b358d3b58aca6e41cd853631d44787f319a1383ca83424fb2db" +dependencies = [ + "byteorder", + "enumflags2", + "libc", + "serde 1.0.203", + "static_assertions", + "zvariant_derive", +] + +[[package]] +name = "zvariant_derive" +version = "3.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37c24dc0bed72f5f90d1f8bb5b07228cbf63b3c6e9f82d82559d4bae666e7ed9" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 1.0.109", + "zvariant_utils", +] + +[[package]] +name = "zvariant_utils" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7234f0d811589db492d16893e3f21e8e2fd282e6d01b0cddee310322062cc200" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] diff --git a/examples/spin-timer/Cargo.toml b/examples/spin-timer/Cargo.toml index fdc4ae568e..f8c8c15a82 100644 --- a/examples/spin-timer/Cargo.toml +++ b/examples/spin-timer/Cargo.toml @@ -9,6 +9,7 @@ anyhow = "1.0.68" clap = { version = "3.1.15", features = ["derive", "env"] } futures = "0.3.25" serde = "1.0.188" +spin-cli = { path = "../.." } spin-trigger = { path = "../../crates/trigger" } spin-factors = { path = "../../crates/factors" } tokio = { version = "1.11", features = ["full"] } diff --git a/examples/spin-timer/src/main.rs b/examples/spin-timer/src/main.rs index 78e51beb87..cce9306db5 100644 --- a/examples/spin-timer/src/main.rs +++ b/examples/spin-timer/src/main.rs @@ -1,9 +1,10 @@ use anyhow::Error; use spin_trigger::cli::FactorsTriggerCommand; +use spin_cli::runtime_factors::FactorsBuilder; use trigger_timer::TimerTrigger; -type Command = FactorsTriggerCommand; +type Command = FactorsTriggerCommand; #[tokio::main] async fn main() -> Result<(), Error> { diff --git a/src/bin/spin.rs b/src/bin/spin.rs index 57e183c74e..c9e6f6a4f7 100644 --- a/src/bin/spin.rs +++ b/src/bin/spin.rs @@ -14,7 +14,7 @@ use spin_cli::commands::{ up::UpCommand, watch::WatchCommand, }; -use spin_cli::Builder; +use spin_cli::runtime_factors::FactorsBuilder; use spin_cli::{build_info::*, subprocess::ExitStatusError}; use spin_trigger::cli::help::HelpArgsOnlyTrigger; use spin_trigger::cli::FactorsTriggerCommand; @@ -140,10 +140,10 @@ enum SpinApp { #[derive(Subcommand)] enum TriggerCommands { - Http(FactorsTriggerCommand), - Redis(FactorsTriggerCommand), + Http(FactorsTriggerCommand), + Redis(FactorsTriggerCommand), #[clap(name = spin_cli::HELP_ARGS_ONLY_TRIGGER_TYPE, hide = true)] - HelpArgsOnly(FactorsTriggerCommand), + HelpArgsOnly(FactorsTriggerCommand), } impl SpinApp { diff --git a/src/lib.rs b/src/lib.rs index addc94a47e..0c34431fee 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,75 +1,7 @@ pub mod build_info; pub mod commands; pub(crate) mod opts; +pub mod runtime_factors; pub mod subprocess; -use std::path::PathBuf; - -use anyhow::Context as _; pub use opts::HELP_ARGS_ONLY_TRIGGER_TYPE; -use spin_factors_executor::FactorsExecutor; -use spin_runtime_config::ResolvedRuntimeConfig; -use spin_trigger::{ - cli::{ - CommonTriggerOptions, KeyValueDefaultStoreSummaryHook, RuntimeFactorsBuilder, - SqlStatementExecutorHook, StdioLoggingExecutorHooks, - }, - TriggerAppOptions, TriggerFactors, TriggerFactorsRuntimeConfig, -}; - -pub struct Builder; - -impl RuntimeFactorsBuilder for Builder { - type Options = TriggerAppOptions; - type Factors = TriggerFactors; - type RuntimeConfig = ResolvedRuntimeConfig; - - fn build( - common_options: &CommonTriggerOptions, - options: &Self::Options, - ) -> anyhow::Result<(Self::Factors, Self::RuntimeConfig)> { - // Hardcode `use_gpu` to true for now - let use_gpu = true; - let runtime_config = ResolvedRuntimeConfig::::from_file( - common_options.runtime_config_file.clone().as_deref(), - common_options.local_app_dir.clone().map(PathBuf::from), - common_options.state_dir.clone(), - common_options.log_dir.clone(), - use_gpu, - )?; - - let factors = TriggerFactors::new( - runtime_config.state_dir(), - common_options.working_dir.clone(), - options.allow_transient_write, - runtime_config.key_value_resolver.clone(), - runtime_config.sqlite_resolver.clone(), - use_gpu, - ) - .context("failed to create factors")?; - Ok((factors, runtime_config)) - } - - fn configure_app( - executor: &mut FactorsExecutor, - runtime_config: &Self::RuntimeConfig, - common_options: &CommonTriggerOptions, - options: &Self::Options, - ) -> anyhow::Result<()> { - executor.add_hooks(SqlStatementExecutorHook::new( - options.sqlite_statements.clone(), - )); - executor.add_hooks(StdioLoggingExecutorHooks::new( - common_options.follow_components.clone(), - runtime_config.log_dir(), - )); - executor.add_hooks(KeyValueDefaultStoreSummaryHook); - // TODO: implement initial key values as a hook - // runtime_config - // .set_initial_key_values(&options.initial_key_values) - // .await?; - // builder.hooks(SummariseRuntimeConfigHook::new(&self.runtime_config_file)); - // builder.hooks(SqlitePersistenceMessageHook); - Ok(()) - } -} diff --git a/src/runtime_factors.rs b/src/runtime_factors.rs new file mode 100644 index 0000000000..3a4d5974a9 --- /dev/null +++ b/src/runtime_factors.rs @@ -0,0 +1,67 @@ +use std::path::PathBuf; + +use anyhow::Context as _; +use spin_factors_executor::FactorsExecutor; +use spin_runtime_config::ResolvedRuntimeConfig; +use spin_runtime_factors::{TriggerAppOptions, TriggerFactors, TriggerFactorsRuntimeConfig}; +use spin_trigger::cli::{ + CommonTriggerOptions, KeyValueDefaultStoreSummaryHook, RuntimeFactorsBuilder, + SqlStatementExecutorHook, StdioLoggingExecutorHooks, +}; + +pub struct FactorsBuilder; + +impl RuntimeFactorsBuilder for FactorsBuilder { + type Options = TriggerAppOptions; + type Factors = TriggerFactors; + type RuntimeConfig = ResolvedRuntimeConfig; + + fn build( + common_options: &CommonTriggerOptions, + options: &Self::Options, + ) -> anyhow::Result<(Self::Factors, Self::RuntimeConfig)> { + // Hardcode `use_gpu` to true for now + let use_gpu = true; + let runtime_config = ResolvedRuntimeConfig::::from_file( + common_options.runtime_config_file.clone().as_deref(), + common_options.local_app_dir.clone().map(PathBuf::from), + common_options.state_dir.clone(), + common_options.log_dir.clone(), + use_gpu, + )?; + + let factors = TriggerFactors::new( + runtime_config.state_dir(), + common_options.working_dir.clone(), + options.allow_transient_write, + runtime_config.key_value_resolver.clone(), + runtime_config.sqlite_resolver.clone(), + use_gpu, + ) + .context("failed to create factors")?; + Ok((factors, runtime_config)) + } + + fn configure_app( + executor: &mut FactorsExecutor, + runtime_config: &Self::RuntimeConfig, + common_options: &CommonTriggerOptions, + options: &Self::Options, + ) -> anyhow::Result<()> { + executor.add_hooks(SqlStatementExecutorHook::new( + options.sqlite_statements.clone(), + )); + executor.add_hooks(StdioLoggingExecutorHooks::new( + common_options.follow_components.clone(), + runtime_config.log_dir(), + )); + executor.add_hooks(KeyValueDefaultStoreSummaryHook); + // TODO: implement initial key values as a hook + // runtime_config + // .set_initial_key_values(&options.initial_key_values) + // .await?; + // builder.hooks(SummariseRuntimeConfigHook::new(&self.runtime_config_file)); + // builder.hooks(SqlitePersistenceMessageHook); + Ok(()) + } +} diff --git a/tests/testing-framework/Cargo.toml b/tests/testing-framework/Cargo.toml index 291db350a7..b3fa873994 100644 --- a/tests/testing-framework/Cargo.toml +++ b/tests/testing-framework/Cargo.toml @@ -19,6 +19,7 @@ spin-cli = { path = "../.." } spin-factors-executor = { path = "../../crates/factors-executor" } spin-http = { path = "../../crates/http" } spin-loader = { path = "../../crates/loader" } +spin-runtime-factors = { path = "../../crates/runtime-factors" } spin-trigger = { path = "../../crates/trigger" } spin-trigger-http = { path = "../../crates/trigger-http" } toml = "0.8.6" diff --git a/tests/testing-framework/src/runtimes/in_process_spin.rs b/tests/testing-framework/src/runtimes/in_process_spin.rs index f903d4b331..591a5ebc91 100644 --- a/tests/testing-framework/src/runtimes/in_process_spin.rs +++ b/tests/testing-framework/src/runtimes/in_process_spin.rs @@ -3,8 +3,9 @@ use std::sync::Arc; use anyhow::Context as _; -use spin_cli::Builder; -use spin_trigger::{cli::TriggerAppBuilder, TriggerAppOptions, TriggerFactors}; +use spin_cli::runtime_factors::FactorsBuilder; +use spin_runtime_factors::{TriggerAppOptions, TriggerFactors}; +use spin_trigger::cli::TriggerAppBuilder; use spin_trigger_http::{HttpServer, HttpTrigger}; use test_environment::{ http::{Request, Response}, @@ -105,7 +106,7 @@ async fn initialize_trigger( let app = spin_app::App::new("my-app", locked_app); let trigger = HttpTrigger::new(&app, "127.0.0.1:80".parse().unwrap(), None)?; - let mut builder = TriggerAppBuilder::<_, Builder>::new(trigger); + let mut builder = TriggerAppBuilder::<_, FactorsBuilder>::new(trigger); let trigger_app = builder .build( app, From edac4820ee5ea27996f6558f108ec060f8d20db8 Mon Sep 17 00:00:00 2001 From: Ryan Levick Date: Fri, 30 Aug 2024 12:12:17 +0200 Subject: [PATCH 07/13] Reimplement initial kv handling Signed-off-by: Ryan Levick --- crates/factor-key-value/src/lib.rs | 5 +++ crates/trigger/src/cli.rs | 2 + crates/trigger/src/cli/initial_kv_setter.rs | 41 +++++++++++++++++++++ examples/spin-timer/src/main.rs | 3 +- src/runtime_factors.rs | 9 ++--- 5 files changed, 53 insertions(+), 7 deletions(-) create mode 100644 crates/trigger/src/cli/initial_kv_setter.rs diff --git a/crates/factor-key-value/src/lib.rs b/crates/factor-key-value/src/lib.rs index 1f43b8ba73..fd80413211 100644 --- a/crates/factor-key-value/src/lib.rs +++ b/crates/factor-key-value/src/lib.rs @@ -133,6 +133,11 @@ impl AppState { .values() .any(|stores| stores.contains(label)) } + + /// Get a store by label. + pub async fn get_store(&self, label: &str) -> Option> { + self.store_manager.get(label).await.ok() + } } pub struct InstanceBuilder { diff --git a/crates/trigger/src/cli.rs b/crates/trigger/src/cli.rs index 2bf8c1a891..273bc5482d 100644 --- a/crates/trigger/src/cli.rs +++ b/crates/trigger/src/cli.rs @@ -1,3 +1,4 @@ +mod initial_kv_setter; mod launch_metadata; mod sqlite_statements; mod stdio; @@ -17,6 +18,7 @@ use spin_factors::RuntimeFactors; use spin_factors_executor::{ComponentLoader, FactorsExecutor}; use crate::{Trigger, TriggerApp}; +pub use initial_kv_setter::InitialKvSetterHook; pub use launch_metadata::LaunchMetadata; pub use sqlite_statements::SqlStatementExecutorHook; use stdio::FollowComponents; diff --git a/crates/trigger/src/cli/initial_kv_setter.rs b/crates/trigger/src/cli/initial_kv_setter.rs new file mode 100644 index 0000000000..735cdce4a6 --- /dev/null +++ b/crates/trigger/src/cli/initial_kv_setter.rs @@ -0,0 +1,41 @@ +use anyhow::Context as _; +use spin_core::async_trait; +use spin_factor_key_value::KeyValueFactor; +use spin_factors::RuntimeFactors; +use spin_factors_executor::ExecutorHooks; + +pub struct InitialKvSetterHook { + kv_pairs: Vec<(String, String)>, +} + +impl InitialKvSetterHook { + pub fn new(kv_pairs: Vec<(String, String)>) -> Self { + Self { kv_pairs } + } +} + +const DEFAULT_KEY_VALUE_STORE_LABEL: &str = "default"; + +#[async_trait] +impl ExecutorHooks for InitialKvSetterHook { + async fn configure_app( + &mut self, + configured_app: &spin_factors::ConfiguredApp, + ) -> anyhow::Result<()> { + let Some(kv) = configured_app.app_state::().ok() else { + return Ok(()); + }; + let store = kv + .get_store(DEFAULT_KEY_VALUE_STORE_LABEL) + .await + .expect("trigger was misconfigured and lacks a default store"); + for (key, value) in &self.kv_pairs { + store + .set(key, value.as_bytes()) + .await + .context("failed to set key-value pair")?; + } + + Ok(()) + } +} diff --git a/examples/spin-timer/src/main.rs b/examples/spin-timer/src/main.rs index cce9306db5..37dfdea723 100644 --- a/examples/spin-timer/src/main.rs +++ b/examples/spin-timer/src/main.rs @@ -1,6 +1,7 @@ use anyhow::Error; -use spin_trigger::cli::FactorsTriggerCommand; +use clap::Parser; use spin_cli::runtime_factors::FactorsBuilder; +use spin_trigger::cli::FactorsTriggerCommand; use trigger_timer::TimerTrigger; diff --git a/src/runtime_factors.rs b/src/runtime_factors.rs index 3a4d5974a9..310919d69a 100644 --- a/src/runtime_factors.rs +++ b/src/runtime_factors.rs @@ -5,8 +5,8 @@ use spin_factors_executor::FactorsExecutor; use spin_runtime_config::ResolvedRuntimeConfig; use spin_runtime_factors::{TriggerAppOptions, TriggerFactors, TriggerFactorsRuntimeConfig}; use spin_trigger::cli::{ - CommonTriggerOptions, KeyValueDefaultStoreSummaryHook, RuntimeFactorsBuilder, - SqlStatementExecutorHook, StdioLoggingExecutorHooks, + CommonTriggerOptions, InitialKvSetterHook, KeyValueDefaultStoreSummaryHook, + RuntimeFactorsBuilder, SqlStatementExecutorHook, StdioLoggingExecutorHooks, }; pub struct FactorsBuilder; @@ -56,10 +56,7 @@ impl RuntimeFactorsBuilder for FactorsBuilder { runtime_config.log_dir(), )); executor.add_hooks(KeyValueDefaultStoreSummaryHook); - // TODO: implement initial key values as a hook - // runtime_config - // .set_initial_key_values(&options.initial_key_values) - // .await?; + executor.add_hooks(InitialKvSetterHook::new(options.key_values.clone())); // builder.hooks(SummariseRuntimeConfigHook::new(&self.runtime_config_file)); // builder.hooks(SqlitePersistenceMessageHook); Ok(()) From 3ce559f2dba36fabe9ba45dd20807b7ff49f7fcd Mon Sep 17 00:00:00 2001 From: Ryan Levick Date: Fri, 30 Aug 2024 13:17:58 +0200 Subject: [PATCH 08/13] Fix rebasing issues Signed-off-by: Ryan Levick --- Cargo.lock | 53 +------- Cargo.toml | 2 +- crates/factors-derive/src/lib.rs | 1 + crates/factors-executor/src/lib.rs | 22 ++-- crates/factors/src/runtime_factors.rs | 2 + crates/runtime-config/src/lib.rs | 6 +- crates/trigger-http/src/lib.rs | 3 + crates/trigger-http/src/wagi.rs | 2 +- crates/trigger/Cargo.toml | 1 - crates/trigger/src/cli.rs | 7 +- crates/trigger/src/cli/initial_kv_setter.rs | 1 + crates/trigger/src/cli/summary.rs | 48 +------- crates/trigger/src/lib.rs | 10 +- examples/spin-timer/Cargo.lock | 130 +------------------- src/runtime_factors.rs | 60 +++++++-- 15 files changed, 108 insertions(+), 240 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 644638947a..ac6ef13a38 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4639,15 +4639,6 @@ dependencies = [ "minimal-lexical", ] -[[package]] -name = "nom8" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae01545c9c7fc4486ab7debaf2aad7003ac19431791868fb2e8066df97fad2f8" -dependencies = [ - "memchr", -] - [[package]] name = "normalize-line-endings" version = "0.3.0" @@ -7152,7 +7143,7 @@ dependencies = [ "test-environment", "testing-framework", "tokio", - "toml 0.6.0", + "toml 0.8.14", "tracing", "url", "uuid", @@ -8686,18 +8677,6 @@ dependencies = [ "serde 1.0.197", ] -[[package]] -name = "toml" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb9d890e4dc9298b70f740f615f2e05b9db37dce531f6b24fb77ac993f9f217" -dependencies = [ - "serde 1.0.197", - "serde_spanned", - "toml_datetime 0.5.1", - "toml_edit 0.18.1", -] - [[package]] name = "toml" version = "0.8.14" @@ -8707,19 +8686,10 @@ dependencies = [ "indexmap 2.2.6", "serde 1.0.197", "serde_spanned", - "toml_datetime 0.6.6", + "toml_datetime", "toml_edit 0.22.14", ] -[[package]] -name = "toml_datetime" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4553f467ac8e3d374bc9a177a26801e5d0f9b211aa1673fb137a403afd1c9cf5" -dependencies = [ - "serde 1.0.197", -] - [[package]] name = "toml_datetime" version = "0.6.6" @@ -8729,19 +8699,6 @@ dependencies = [ "serde 1.0.197", ] -[[package]] -name = "toml_edit" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56c59d8dd7d0dcbc6428bf7aa2f0e823e26e43b3c9aca15bbc9475d23e5fa12b" -dependencies = [ - "indexmap 1.9.3", - "nom8", - "serde 1.0.197", - "serde_spanned", - "toml_datetime 0.5.1", -] - [[package]] name = "toml_edit" version = "0.19.15" @@ -8749,7 +8706,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ "indexmap 2.2.6", - "toml_datetime 0.6.6", + "toml_datetime", "winnow 0.5.40", ] @@ -8762,7 +8719,7 @@ dependencies = [ "indexmap 2.2.6", "serde 1.0.197", "serde_spanned", - "toml_datetime 0.6.6", + "toml_datetime", "winnow 0.5.40", ] @@ -8775,7 +8732,7 @@ dependencies = [ "indexmap 2.2.6", "serde 1.0.197", "serde_spanned", - "toml_datetime 0.6.6", + "toml_datetime", "winnow 0.6.5", ] diff --git a/Cargo.toml b/Cargo.toml index 7dcd852cb7..0d146d2eaf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -70,7 +70,7 @@ terminal = { path = "crates/terminal" } subprocess = "0.2.9" tempfile = "3.8.0" tokio = { version = "1.23", features = ["full"] } -toml = "0.6" +toml = "0.8" tracing = { workspace = true } url = "2.2.2" uuid = { version = "^1.0", features = ["v4"] } diff --git a/crates/factors-derive/src/lib.rs b/crates/factors-derive/src/lib.rs index 205d6b9cf6..82325bac62 100644 --- a/crates/factors-derive/src/lib.rs +++ b/crates/factors-derive/src/lib.rs @@ -211,6 +211,7 @@ fn expand_factors(input: &DeriveInput) -> syn::Result { )* } + #[allow(dead_code)] impl #builders_name { #( pub fn #factor_names(&mut self) -> &mut <#factor_types as #Factor>::InstanceBuilder { diff --git a/crates/factors-executor/src/lib.rs b/crates/factors-executor/src/lib.rs index 3f5e01bfb2..dd5efa7663 100644 --- a/crates/factors-executor/src/lib.rs +++ b/crates/factors-executor/src/lib.rs @@ -7,7 +7,7 @@ use spin_factors::{AsInstanceState, ConfiguredApp, RuntimeFactors, RuntimeFactor /// A FactorsExecutor manages execution of a Spin app. /// -/// `Factors` is the executor's [`RuntimeFactors`]. `ExecutorInstanceState` +/// It is generic over the executor's [`RuntimeFactors`]. Additionally, it /// holds any other per-instance state needed by the caller. pub struct FactorsExecutor { core_engine: spin_core::Engine>, @@ -110,6 +110,9 @@ type InstancePre = spin_core::InstancePre::InstanceState, U>>; /// A FactorsExecutorApp represents a loaded Spin app, ready for instantiation. +/// +/// It is generic over the executor's [`RuntimeFactors`] and any ad-hoc additional +/// per-instance state needed by the caller. pub struct FactorsExecutorApp { executor: FactorsExecutor, configured_app: ConfiguredApp, @@ -173,14 +176,16 @@ impl FactorsExecutorApp { } } -/// A FactorsInstanceBuilder manages the instantiation of a Spin component -/// instance. -pub struct FactorsInstanceBuilder<'a, T: RuntimeFactors, U> { +/// A FactorsInstanceBuilder manages the instantiation of a Spin component instance. +/// +/// It is generic over the executor's [`RuntimeFactors`] and any ad-hoc additional +/// per-instance state needed by the caller. +pub struct FactorsInstanceBuilder<'a, F: RuntimeFactors, U> { app_component: AppComponent<'a>, store_builder: spin_core::StoreBuilder, - factor_builders: T::InstanceBuilders, - instance_pre: &'a InstancePre, - factors: &'a T, + factor_builders: F::InstanceBuilders, + instance_pre: &'a InstancePre, + factors: &'a F, } impl<'a, T: RuntimeFactors, U> FactorsInstanceBuilder<'a, T, U> { @@ -221,6 +226,9 @@ impl<'a, T: RuntimeFactors, U: Send> FactorsInstanceBuilder<'a, T, U> { } /// InstanceState is the [`spin_core::Store`] `data` for an instance. +/// +/// It is generic over the [`RuntimeFactors::InstanceState`] and any ad-hoc +/// data needed by the caller. pub struct InstanceState { core: spin_core::State, factors: T, diff --git a/crates/factors/src/runtime_factors.rs b/crates/factors/src/runtime_factors.rs index 150a6117af..794b9435ad 100644 --- a/crates/factors/src/runtime_factors.rs +++ b/crates/factors/src/runtime_factors.rs @@ -81,7 +81,9 @@ pub trait RuntimeFactors: Send + Sync + Sized + 'static { ) -> Option>; } +/// Allows querying an `InstanceBuilders` for a particular `Factor`'s `InstanceBuilder`. pub trait HasInstanceBuilder { + /// Get the instance builder of a particular factor. fn for_factor(&mut self) -> Option<&mut F::InstanceBuilder>; } diff --git a/crates/runtime-config/src/lib.rs b/crates/runtime-config/src/lib.rs index 54c447f161..da30b62299 100644 --- a/crates/runtime-config/src/lib.rs +++ b/crates/runtime-config/src/lib.rs @@ -118,7 +118,7 @@ where sqlite_resolver: sqlite_config_resolver, state_dir: toml_resolver.state_dir()?, log_dir: toml_resolver.log_dir()?, - toml, + toml: toml_resolver.toml(), }) } @@ -262,6 +262,10 @@ impl<'a> TomlResolver<'a> { pub fn validate_all_keys_used(&self) -> spin_factors::Result<()> { self.table.validate_all_keys_used() } + + fn toml(&self) -> toml::Table { + self.table.as_ref().clone() + } } /// The TOML based runtime configuration source Spin CLI. diff --git a/crates/trigger-http/src/lib.rs b/crates/trigger-http/src/lib.rs index 18e1cdef30..85a7e108cd 100644 --- a/crates/trigger-http/src/lib.rs +++ b/crates/trigger-http/src/lib.rs @@ -30,7 +30,10 @@ pub use tls::TlsConfig; pub(crate) use wasmtime_wasi_http::body::HyperIncomingBody as Body; +/// A [`spin_trigger::TriggerApp`] for the HTTP trigger. pub(crate) type TriggerApp = spin_trigger::TriggerApp; + +/// A [`spin_trigger::TriggerInstanceBuilder`] for the HTTP trigger. pub(crate) type TriggerInstanceBuilder<'a, F> = spin_trigger::TriggerInstanceBuilder<'a, HttpTrigger, F>; diff --git a/crates/trigger-http/src/wagi.rs b/crates/trigger-http/src/wagi.rs index 85b2550881..447962d0e4 100644 --- a/crates/trigger-http/src/wagi.rs +++ b/crates/trigger-http/src/wagi.rs @@ -79,7 +79,7 @@ impl HttpExecutor for WagiHttpExecutor { .factor_builders() .for_factor::() { - // // Set up Wagi environment + // Set up Wagi environment wasi_builder.args(argv.split(' ')); wasi_builder.env(headers); wasi_builder.stdin_pipe(Cursor::new(body)); diff --git a/crates/trigger/Cargo.toml b/crates/trigger/Cargo.toml index d4cef028bd..68d1f9f760 100644 --- a/crates/trigger/Cargo.toml +++ b/crates/trigger/Cargo.toml @@ -26,7 +26,6 @@ spin-factor-sqlite = { path = "../factor-sqlite" } spin-factor-wasi = { path = "../factor-wasi" } spin-factors = { path = "../factors" } spin-factors-executor = { path = "../factors-executor" } -spin-runtime-config = { path = "../runtime-config" } spin-telemetry = { path = "../telemetry" } tokio = { version = "1.23", features = ["fs", "rt"] } toml = "0.8" diff --git a/crates/trigger/src/cli.rs b/crates/trigger/src/cli.rs index 273bc5482d..d60968ec39 100644 --- a/crates/trigger/src/cli.rs +++ b/crates/trigger/src/cli.rs @@ -23,7 +23,7 @@ pub use launch_metadata::LaunchMetadata; pub use sqlite_statements::SqlStatementExecutorHook; use stdio::FollowComponents; pub use stdio::StdioLoggingExecutorHooks; -pub use summary::KeyValueDefaultStoreSummaryHook; +pub use summary::{KeyValueDefaultStoreSummaryHook, SqliteDefaultStoreSummaryHook}; pub const APP_LOG_DIR: &str = "APP_LOG_DIR"; pub const DISABLE_WASMTIME_CACHE: &str = "DISABLE_WASMTIME_CACHE"; @@ -398,8 +398,11 @@ impl, B: RuntimeFactorsBuilder> TriggerAppBuilder { /// A builder for runtime factors. pub trait RuntimeFactorsBuilder { - type Options: clap::Args; + /// The factors type to build. type Factors: RuntimeFactors; + /// CLI arguments not included in [`CommonTriggerOptions`] needed to build the [`RuntimeFactors`]. + type Options: clap::Args; + /// The wrapped runtime config type. type RuntimeConfig: Into<::RuntimeConfig>; /// Build the factors and runtime config from the given options. diff --git a/crates/trigger/src/cli/initial_kv_setter.rs b/crates/trigger/src/cli/initial_kv_setter.rs index 735cdce4a6..fad119daea 100644 --- a/crates/trigger/src/cli/initial_kv_setter.rs +++ b/crates/trigger/src/cli/initial_kv_setter.rs @@ -4,6 +4,7 @@ use spin_factor_key_value::KeyValueFactor; use spin_factors::RuntimeFactors; use spin_factors_executor::ExecutorHooks; +/// An [`ExecutorHooks`] that sets initial key-value pairs in the default store. pub struct InitialKvSetterHook { kv_pairs: Vec<(String, String)>, } diff --git a/crates/trigger/src/cli/summary.rs b/crates/trigger/src/cli/summary.rs index b7f98b9d92..57dd18baca 100644 --- a/crates/trigger/src/cli/summary.rs +++ b/crates/trigger/src/cli/summary.rs @@ -1,52 +1,8 @@ -use std::path::Path; - -use spin_common::ui::quoted_path; use spin_core::async_trait; use spin_factor_key_value::KeyValueFactor; use spin_factor_sqlite::SqliteFactor; use spin_factors::RuntimeFactors; use spin_factors_executor::ExecutorHooks; -use spin_runtime_config::ResolvedRuntimeConfig; -use toml::Value; - -use crate::factors::TriggerFactors; - -pub fn summarize_runtime_config( - runtime_config: &ResolvedRuntimeConfig, - runtime_config_path: Option<&Path>, -) { - let toml = &runtime_config.toml; - let summarize_labeled_typed_tables = |key| { - let mut summaries = vec![]; - if let Some(tables) = toml.get(key).and_then(Value::as_table) { - for (label, config) in tables { - if let Some(ty) = config.get("type").and_then(Value::as_str) { - summaries.push(format!("[{key}.{label}: {ty}]")) - } - } - } - summaries - }; - - let mut summaries = vec![]; - // [key_value_store.