From 32c3b2dd14af4c2da660479e0c0135c7fd4f5267 Mon Sep 17 00:00:00 2001 From: hosted-fornet Date: Wed, 18 Sep 2024 15:40:27 -0700 Subject: [PATCH 1/6] bump version to 0.7.5 --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9d5041a5..adbec4e5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2099,7 +2099,7 @@ dependencies = [ [[package]] name = "kit" -version = "0.7.4" +version = "0.7.5" dependencies = [ "alloy", "alloy-sol-macro", diff --git a/Cargo.toml b/Cargo.toml index 4fa27552..ae373ad4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "kit" -version = "0.7.4" +version = "0.7.5" edition = "2021" [build-dependencies] From efd70bc1c294c4aa76767ad4a2adb17129db13e8 Mon Sep 17 00:00:00 2001 From: hosted-fornet Date: Wed, 18 Sep 2024 15:41:30 -0700 Subject: [PATCH 2/6] main: make logging levels logic slightly more readable --- Cargo.toml | 1 - src/main.rs | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ae373ad4..7fddfef7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,7 +40,6 @@ kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib.git", re nix = { version = "0.27", features = ["process", "signal", "term"] } regex = "1" reqwest = { version = "0.12", features = ["json"] } -# rmp-serde = "1.1.2" rpassword = "7" semver = "1.0" serde = { version = "1.0", features = ["derive"] } diff --git a/src/main.rs b/src/main.rs index 7ea1761f..4921c3b6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -69,12 +69,12 @@ fn init_tracing(log_path: PathBuf) -> tracing_appender::non_blocking::WorkerGuar .ok() .and_then(|l| Level::from_str(&l).ok()) .unwrap_or_else(|| STDOUT_LOG_LEVEL_DEFAULT); - let allowed_levels: Vec = vec![Level::INFO, Level::WARN] + let allowed_levels: std::collections::HashSet = vec![Level::INFO, Level::WARN] .into_iter() .filter(|&l| l <= level) .collect(); let stdout_filter = filter::filter_fn(move |metadata: &tracing::Metadata<'_>| { - allowed_levels.iter().any(|l| metadata.level() == l) + allowed_levels.contains(metadata.level()) }); let stderr_filter = EnvFilter::try_from_default_env() From 260be99063c440a8da8bf76d2e9334c7b7141d03 Mon Sep 17 00:00:00 2001 From: hosted-fornet Date: Wed, 18 Sep 2024 17:11:45 -0700 Subject: [PATCH 3/6] new: use logging in templates --- .../rust/no-ui/blank/blank/Cargo.toml | 2 +- .../templates/rust/no-ui/chat/chat/Cargo.toml | 2 +- .../templates/rust/no-ui/chat/chat/src/lib.rs | 21 +++---- .../templates/rust/no-ui/chat/send/Cargo.toml | 2 +- .../templates/rust/no-ui/chat/send/src/lib.rs | 4 +- .../templates/rust/no-ui/echo/echo/Cargo.toml | 2 +- .../templates/rust/no-ui/echo/echo/src/lib.rs | 8 ++- .../rust/no-ui/fibonacci/fibonacci/Cargo.toml | 2 +- .../rust/no-ui/fibonacci/fibonacci/src/lib.rs | 20 ++++--- .../rust/no-ui/fibonacci/number/Cargo.toml | 2 +- .../no-ui/file_transfer/download/Cargo.toml | 2 +- .../file_transfer/file_transfer/Cargo.toml | 2 +- .../file_transfer/file_transfer/src/lib.rs | 55 ++++++++++--------- .../file_transfer_worker/Cargo.toml | 2 +- .../file_transfer_worker/src/lib.rs | 12 ++-- .../file_transfer_worker_api/Cargo.toml | 2 +- .../no-ui/file_transfer/list_files/Cargo.toml | 2 +- 17 files changed, 77 insertions(+), 65 deletions(-) diff --git a/src/new/templates/rust/no-ui/blank/blank/Cargo.toml b/src/new/templates/rust/no-ui/blank/blank/Cargo.toml index 503b41ec..e9437534 100644 --- a/src/new/templates/rust/no-ui/blank/blank/Cargo.toml +++ b/src/new/templates/rust/no-ui/blank/blank/Cargo.toml @@ -5,7 +5,7 @@ edition = "2021" publish = false [dependencies] -kinode_process_lib = "0.8.5" +kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "0e464ec" } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" wit-bindgen = "0.24.0" diff --git a/src/new/templates/rust/no-ui/chat/chat/Cargo.toml b/src/new/templates/rust/no-ui/chat/chat/Cargo.toml index 7c684d8c..ba0d8c28 100644 --- a/src/new/templates/rust/no-ui/chat/chat/Cargo.toml +++ b/src/new/templates/rust/no-ui/chat/chat/Cargo.toml @@ -6,7 +6,7 @@ publish = false [dependencies] anyhow = "1.0" -kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.8.3" } +kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "0e464ec" } process_macros = { git = "https://github.com/kinode-dao/process_macros", rev = "626e501" } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" diff --git a/src/new/templates/rust/no-ui/chat/chat/src/lib.rs b/src/new/templates/rust/no-ui/chat/chat/src/lib.rs index 493dae2a..b0c04de0 100644 --- a/src/new/templates/rust/no-ui/chat/chat/src/lib.rs +++ b/src/new/templates/rust/no-ui/chat/chat/src/lib.rs @@ -1,6 +1,9 @@ use std::collections::HashMap; -use crate::kinode::process::chat::{ChatMessage, Request as ChatRequest, Response as ChatResponse, SendRequest}; +use crate::kinode::process::chat::{ + ChatMessage, Request as ChatRequest, Response as ChatResponse, SendRequest, +}; +use kinode_process_lib::logging::{error, info, init_logging, Level}; use kinode_process_lib::{await_message, call_init, println, Address, Message, Request, Response}; wit_bindgen::generate!({ @@ -56,10 +59,7 @@ fn handle_message( .and_modify(|e| e.push(message.clone())) .or_insert(vec![message]); } - Response::new() - .body(ChatResponse::Send) - .send() - .unwrap(); + Response::new().body(ChatResponse::Send).send().unwrap(); } ChatRequest::History(ref node) => { Response::new() @@ -67,7 +67,7 @@ fn handle_message( message_archive .get(node) .map(|msgs| msgs.clone()) - .unwrap_or_default() + .unwrap_or_default(), )) .send() .unwrap(); @@ -78,17 +78,18 @@ fn handle_message( call_init!(init); fn init(our: Address) { - println!("begin"); + init_logging(&our, Level::DEBUG, Level::INFO); + info!("begin"); let mut message_archive = HashMap::new(); loop { match await_message() { - Err(send_error) => println!("got SendError: {send_error}"), + Err(send_error) => error!("got SendError: {send_error}"), Ok(ref message) => match handle_message(&our, message, &mut message_archive) { Ok(_) => {} - Err(e) => println!("got error while handling message: {e:?}"), - } + Err(e) => error!("got error while handling message: {e:?}"), + }, } } } diff --git a/src/new/templates/rust/no-ui/chat/send/Cargo.toml b/src/new/templates/rust/no-ui/chat/send/Cargo.toml index 9ed24313..35404096 100644 --- a/src/new/templates/rust/no-ui/chat/send/Cargo.toml +++ b/src/new/templates/rust/no-ui/chat/send/Cargo.toml @@ -6,7 +6,7 @@ publish = false [dependencies] anyhow = "1.0" -kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.8.3" } +kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "0e464ec" } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" wit-bindgen = "0.24.0" diff --git a/src/new/templates/rust/no-ui/chat/send/src/lib.rs b/src/new/templates/rust/no-ui/chat/send/src/lib.rs index e819550a..9309ae37 100644 --- a/src/new/templates/rust/no-ui/chat/send/src/lib.rs +++ b/src/new/templates/rust/no-ui/chat/send/src/lib.rs @@ -1,7 +1,5 @@ use crate::kinode::process::chat::{Request as ChatRequest, Response as ChatResponse, SendRequest}; -use kinode_process_lib::{ - await_next_message_body, call_init, println, Address, Message, Request, -}; +use kinode_process_lib::{await_next_message_body, call_init, println, Address, Message, Request}; wit_bindgen::generate!({ path: "target/wit", diff --git a/src/new/templates/rust/no-ui/echo/echo/Cargo.toml b/src/new/templates/rust/no-ui/echo/echo/Cargo.toml index 887c131f..c68673aa 100644 --- a/src/new/templates/rust/no-ui/echo/echo/Cargo.toml +++ b/src/new/templates/rust/no-ui/echo/echo/Cargo.toml @@ -7,7 +7,7 @@ publish = false [dependencies] anyhow = "1.0" bincode = "1.3.3" -kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.8.3" } +kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "0e464ec" } process_macros = { git = "https://github.com/kinode-dao/process_macros", rev = "626e501" } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" diff --git a/src/new/templates/rust/no-ui/echo/echo/src/lib.rs b/src/new/templates/rust/no-ui/echo/echo/src/lib.rs index f4dd36a3..141bcffc 100644 --- a/src/new/templates/rust/no-ui/echo/echo/src/lib.rs +++ b/src/new/templates/rust/no-ui/echo/echo/src/lib.rs @@ -1,3 +1,4 @@ +use kinode_process_lib::logging::{error, info, init_logging, Level}; use kinode_process_lib::{await_message, call_init, println, Address, Message, Response}; wit_bindgen::generate!({ @@ -21,14 +22,15 @@ fn handle_message(message: &Message) -> anyhow::Result<()> { call_init!(init); fn init(_our: Address) { - println!("begin"); + init_logging(&our, Level::DEBUG, Level::INFO); + info!("begin"); loop { match await_message() { - Err(send_error) => println!("got SendError: {send_error}"), + Err(send_error) => error!("got SendError: {send_error}"), Ok(ref message) => match handle_message(message) { Ok(_) => {} - Err(e) => println!("got error while handling message: {e:?}"), + Err(e) => error!("got error while handling message: {e:?}"), }, } } diff --git a/src/new/templates/rust/no-ui/fibonacci/fibonacci/Cargo.toml b/src/new/templates/rust/no-ui/fibonacci/fibonacci/Cargo.toml index c1cbf336..f22bb02f 100644 --- a/src/new/templates/rust/no-ui/fibonacci/fibonacci/Cargo.toml +++ b/src/new/templates/rust/no-ui/fibonacci/fibonacci/Cargo.toml @@ -7,7 +7,7 @@ publish = false [dependencies] anyhow = "1.0" bincode = "1.3.3" -kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.8.3" } +kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "0e464ec" } process_macros = { git = "https://github.com/kinode-dao/process_macros", rev = "626e501" } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" diff --git a/src/new/templates/rust/no-ui/fibonacci/fibonacci/src/lib.rs b/src/new/templates/rust/no-ui/fibonacci/fibonacci/src/lib.rs index 80f84091..b64fc2bd 100644 --- a/src/new/templates/rust/no-ui/fibonacci/fibonacci/src/lib.rs +++ b/src/new/templates/rust/no-ui/fibonacci/fibonacci/src/lib.rs @@ -1,5 +1,8 @@ -use crate::kinode::process::fibonacci::{Request as FibonacciRequest, Response as FibonacciResponse}; -use kinode_process_lib::{await_message, call_init, println, Address, Message, Response}; +use crate::kinode::process::fibonacci::{ + Request as FibonacciRequest, Response as FibonacciResponse, +}; +use kinode_process_lib::logging::{error, info, init_logging, Level}; +use kinode_process_lib::{await_message, call_init, Address, Message, Response}; wit_bindgen::generate!({ path: "target/wit", @@ -36,7 +39,7 @@ fn handle_message(message: &Message) -> anyhow::Result<()> { let start = std::time::Instant::now(); let result = fibonacci(number); let duration = start.elapsed(); - println!( + info!( "fibonacci({}) = {}; {}ns", number, result, @@ -66,7 +69,7 @@ fn handle_message(message: &Message) -> anyhow::Result<()> { trial - mean } }) / number_trials as u128; - println!( + info!( "fibonacci({}) = {}; {}±{}ns averaged over {} trials", number, result, mean, absolute_deviation, number_trials, ); @@ -81,15 +84,16 @@ fn handle_message(message: &Message) -> anyhow::Result<()> { call_init!(init); fn init(_our: Address) { - println!("begin"); + init_logging(&our, Level::DEBUG, Level::INFO); + info!("begin"); loop { match await_message() { - Err(send_error) => println!("got SendError: {send_error}"), + Err(send_error) => error!("got SendError: {send_error}"), Ok(ref message) => match handle_message(message) { Ok(_) => {} - Err(e) => println!("got error while handling message: {e:?}"), - } + Err(e) => error!("got error while handling message: {e:?}"), + }, } } } diff --git a/src/new/templates/rust/no-ui/fibonacci/number/Cargo.toml b/src/new/templates/rust/no-ui/fibonacci/number/Cargo.toml index e51908c2..96feb682 100644 --- a/src/new/templates/rust/no-ui/fibonacci/number/Cargo.toml +++ b/src/new/templates/rust/no-ui/fibonacci/number/Cargo.toml @@ -6,7 +6,7 @@ publish = false [dependencies] anyhow = "1.0" -kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.8.3" } +kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "0e464ec" } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" wit-bindgen = "0.24.0" diff --git a/src/new/templates/rust/no-ui/file_transfer/download/Cargo.toml b/src/new/templates/rust/no-ui/file_transfer/download/Cargo.toml index f542889a..979a4e89 100644 --- a/src/new/templates/rust/no-ui/file_transfer/download/Cargo.toml +++ b/src/new/templates/rust/no-ui/file_transfer/download/Cargo.toml @@ -6,7 +6,7 @@ publish = false [dependencies] anyhow = "1.0" -kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.8.3" } +kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "0e464ec" } process_macros = { git = "https://github.com/kinode-dao/process_macros", rev = "626e501" } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" diff --git a/src/new/templates/rust/no-ui/file_transfer/file_transfer/Cargo.toml b/src/new/templates/rust/no-ui/file_transfer/file_transfer/Cargo.toml index 745330e6..aa970e15 100644 --- a/src/new/templates/rust/no-ui/file_transfer/file_transfer/Cargo.toml +++ b/src/new/templates/rust/no-ui/file_transfer/file_transfer/Cargo.toml @@ -6,7 +6,7 @@ publish = false [dependencies] anyhow = "1.0" -kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.8.3" } +kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "0e464ec" } process_macros = { git = "https://github.com/kinode-dao/process_macros", rev = "626e501" } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" diff --git a/src/new/templates/rust/no-ui/file_transfer/file_transfer/src/lib.rs b/src/new/templates/rust/no-ui/file_transfer/file_transfer/src/lib.rs index 155dfcbb..1c0548b4 100644 --- a/src/new/templates/rust/no-ui/file_transfer/file_transfer/src/lib.rs +++ b/src/new/templates/rust/no-ui/file_transfer/file_transfer/src/lib.rs @@ -1,6 +1,12 @@ +use crate::kinode::process::file_transfer::{ + FileInfo, Request as TransferRequest, Response as TransferResponse, +}; +use crate::kinode::process::file_transfer_worker::{ + start_download, DownloadRequest, ProgressRequest, Request as WorkerRequest, + Response as WorkerResponse, +}; use crate::kinode::process::standard::{Address as WitAddress, ProcessId as WitProcessId}; -use crate::kinode::process::file_transfer_worker::{start_download, Request as WorkerRequest, Response as WorkerResponse, DownloadRequest, ProgressRequest}; -use crate::kinode::process::file_transfer::{Request as TransferRequest, Response as TransferResponse, FileInfo}; +use kinode_process_lib::logging::{error, info, init_logging, Level}; use kinode_process_lib::{ await_message, call_init, println, vfs::{create_drive, metadata, open_dir, Directory, FileType}, @@ -63,10 +69,7 @@ fn ls_files(files_dir: &Directory) -> anyhow::Result> { Ok(files) } -fn handle_transfer_request( - request: &TransferRequest, - files_dir: &Directory, -) -> anyhow::Result<()> { +fn handle_transfer_request(request: &TransferRequest, files_dir: &Directory) -> anyhow::Result<()> { match request { TransferRequest::ListFiles => { let files = ls_files(files_dir)?; @@ -84,7 +87,11 @@ fn handle_worker_request( request: &WorkerRequest, ) -> anyhow::Result<()> { match request { - WorkerRequest::Download(DownloadRequest { ref name, ref target, is_requestor }) => { + WorkerRequest::Download(DownloadRequest { + ref name, + ref target, + is_requestor, + }) => { match start_download( &our.clone().into(), &source.clone().into(), @@ -97,10 +104,8 @@ fn handle_worker_request( } } WorkerRequest::Progress(ProgressRequest { name, progress }) => { - println!("{} progress: {}%", name, progress); - Response::new() - .body(WorkerResponse::Progress) - .send()?; + info!("{} progress: {}%", name, progress); + Response::new().body(WorkerResponse::Progress).send()?; } } Ok(()) @@ -111,14 +116,17 @@ fn handle_transfer_response(source: &Address, response: &TransferResponse) -> an TransferResponse::ListFiles(ref files) => { println!( "{}", - files.iter(). - fold(format!("{source} available files:\nFile\t\tSize (bytes)\n"), |mut msg, file| { + files.iter().fold( + format!("{source} available files:\nFile\t\tSize (bytes)\n"), + |mut msg, file| { msg.push_str(&format!( - "{}\t\t{}", file.name.split('/').last().unwrap(), + "{}\t\t{}", + file.name.split('/').last().unwrap(), file.size, )); msg - }) + } + ) ); } } @@ -129,7 +137,7 @@ fn handle_worker_response(response: &WorkerResponse) -> anyhow::Result<()> { match response { WorkerResponse::Download(ref result) => { if let Err(e) = result { - return Err(anyhow::anyhow!("{e}")) + return Err(anyhow::anyhow!("{e}")); } } WorkerResponse::Progress => {} @@ -137,11 +145,7 @@ fn handle_worker_response(response: &WorkerResponse) -> anyhow::Result<()> { Ok(()) } -fn handle_message( - our: &Address, - message: &Message, - files_dir: &Directory, -) -> anyhow::Result<()> { +fn handle_message(our: &Address, message: &Message, files_dir: &Directory) -> anyhow::Result<()> { match message.body().try_into()? { // requests Msg::TransferRequest(ref tr) => handle_transfer_request(tr, files_dir), @@ -155,18 +159,19 @@ fn handle_message( call_init!(init); fn init(our: Address) { - println!("begin"); + init_logging(&our, Level::DEBUG, Level::INFO); + info!("begin"); let drive_path = create_drive(our.package_id(), "files", None).unwrap(); let files_dir = open_dir(&drive_path, false, None).unwrap(); loop { match await_message() { - Err(send_error) => println!("got SendError: {send_error}"), + Err(send_error) => error!("got SendError: {send_error}"), Ok(ref message) => match handle_message(&our, message, &files_dir) { Ok(_) => {} - Err(e) => println!("got error while handling message: {e:?}"), - } + Err(e) => error!("got error while handling message: {e:?}"), + }, } } } diff --git a/src/new/templates/rust/no-ui/file_transfer/file_transfer_worker/Cargo.toml b/src/new/templates/rust/no-ui/file_transfer/file_transfer_worker/Cargo.toml index 3df989c0..b2503cf8 100644 --- a/src/new/templates/rust/no-ui/file_transfer/file_transfer_worker/Cargo.toml +++ b/src/new/templates/rust/no-ui/file_transfer/file_transfer_worker/Cargo.toml @@ -7,7 +7,7 @@ publish = false [dependencies] anyhow = "1.0" bincode = "1.3.3" -kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.8.3" } +kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "0e464ec" } process_macros = { git = "https://github.com/kinode-dao/process_macros", rev = "626e501" } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" diff --git a/src/new/templates/rust/no-ui/file_transfer/file_transfer_worker/src/lib.rs b/src/new/templates/rust/no-ui/file_transfer/file_transfer_worker/src/lib.rs index 9a918630..77b6fc03 100644 --- a/src/new/templates/rust/no-ui/file_transfer/file_transfer_worker/src/lib.rs +++ b/src/new/templates/rust/no-ui/file_transfer/file_transfer_worker/src/lib.rs @@ -3,8 +3,9 @@ use crate::kinode::process::file_transfer_worker::{ Response as WorkerResponse, }; use crate::kinode::process::standard::{Address as WitAddress, ProcessId as WitProcessId}; +use kinode_process_lib::logging::{error, info, init_logging, Level}; use kinode_process_lib::{ - await_message, call_init, get_blob, println, + await_message, call_init, get_blob, vfs::{open_dir, open_file, Directory, File, SeekFrom}, Address, Message, ProcessId, Request, Response, }; @@ -212,7 +213,8 @@ fn handle_message( call_init!(init); fn init(our: Address) { - println!("worker: begin"); + init_logging(&our, Level::DEBUG, Level::INFO); + info!("worker: begin"); let start = std::time::Instant::now(); let drive_path = format!("{}/files", our.package_id()); @@ -224,16 +226,16 @@ fn init(our: Address) { loop { match await_message() { - Err(send_error) => println!("worker: got SendError: {send_error}"), + Err(send_error) => error!("worker: got SendError: {send_error}"), Ok(ref message) => { match handle_message(message, &mut file, &files_dir, &mut size, &mut parent) { Ok(exit) => { if exit { - println!("worker: done: exiting, took {:?}", start.elapsed()); + info!("worker: done: exiting, took {:?}", start.elapsed()); break; } } - Err(e) => println!("worker: got error while handling message: {e:?}"), + Err(e) => error!("worker: got error while handling message: {e:?}"), } } } diff --git a/src/new/templates/rust/no-ui/file_transfer/file_transfer_worker_api/Cargo.toml b/src/new/templates/rust/no-ui/file_transfer/file_transfer_worker_api/Cargo.toml index 86d3aee3..8b6e4a86 100644 --- a/src/new/templates/rust/no-ui/file_transfer/file_transfer_worker_api/Cargo.toml +++ b/src/new/templates/rust/no-ui/file_transfer/file_transfer_worker_api/Cargo.toml @@ -6,7 +6,7 @@ publish = false [dependencies] anyhow = "1.0" -kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.8.3" } +kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "0e464ec" } process_macros = { git = "https://github.com/kinode-dao/process_macros", rev = "626e501" } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" diff --git a/src/new/templates/rust/no-ui/file_transfer/list_files/Cargo.toml b/src/new/templates/rust/no-ui/file_transfer/list_files/Cargo.toml index 2f5f70c0..bea2ad89 100644 --- a/src/new/templates/rust/no-ui/file_transfer/list_files/Cargo.toml +++ b/src/new/templates/rust/no-ui/file_transfer/list_files/Cargo.toml @@ -6,7 +6,7 @@ publish = false [dependencies] anyhow = "1.0" -kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.8.3" } +kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "0e464ec" } process_macros = { git = "https://github.com/kinode-dao/process_macros", rev = "626e501" } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" From a7db87830e5aa5b40b7bee50508edc8bef6f3667 Mon Sep 17 00:00:00 2001 From: hosted-fornet Date: Wed, 18 Sep 2024 20:58:54 -0700 Subject: [PATCH 4/6] build: warn rather than erroring out if cant parse dep version --- src/build/mod.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/build/mod.rs b/src/build/mod.rs index 321bfa8d..a37988e5 100644 --- a/src/build/mod.rs +++ b/src/build/mod.rs @@ -374,7 +374,13 @@ fn find_crate_versions( dependency.req.clone() } else { if let Some(ref source) = dependency.source { - parse_version_from_url(source)? + match parse_version_from_url(source) { + Ok(v) => v, + Err(e) => { + warn!("Error parsing import version: {e}"); + continue; + } + } } else { semver::VersionReq::default() } From a0e82cf2b2fb98f7490469d081f2bf2e8b681d1e Mon Sep 17 00:00:00 2001 From: hosted-fornet Date: Wed, 18 Sep 2024 20:59:15 -0700 Subject: [PATCH 5/6] new: use logging in templates --- src/new/templates/rust/no-ui/blank/blank/Cargo.toml | 2 +- src/new/templates/rust/no-ui/chat/chat/Cargo.toml | 2 +- src/new/templates/rust/no-ui/chat/chat/src/lib.rs | 2 +- src/new/templates/rust/no-ui/chat/pkg/manifest.json | 3 ++- src/new/templates/rust/no-ui/chat/send/Cargo.toml | 2 +- src/new/templates/rust/no-ui/echo/echo/Cargo.toml | 2 +- src/new/templates/rust/no-ui/echo/echo/src/lib.rs | 4 ++-- src/new/templates/rust/no-ui/echo/pkg/manifest.json | 3 ++- src/new/templates/rust/no-ui/fibonacci/fibonacci/Cargo.toml | 2 +- src/new/templates/rust/no-ui/fibonacci/fibonacci/src/lib.rs | 4 ++-- src/new/templates/rust/no-ui/fibonacci/number/Cargo.toml | 2 +- src/new/templates/rust/no-ui/fibonacci/pkg/manifest.json | 3 ++- .../templates/rust/no-ui/file_transfer/download/Cargo.toml | 2 +- .../rust/no-ui/file_transfer/file_transfer/Cargo.toml | 2 +- .../rust/no-ui/file_transfer/file_transfer/src/lib.rs | 2 +- .../rust/no-ui/file_transfer/file_transfer_worker/Cargo.toml | 2 +- .../rust/no-ui/file_transfer/file_transfer_worker/src/lib.rs | 2 +- .../no-ui/file_transfer/file_transfer_worker_api/Cargo.toml | 2 +- .../templates/rust/no-ui/file_transfer/list_files/Cargo.toml | 2 +- 19 files changed, 24 insertions(+), 21 deletions(-) diff --git a/src/new/templates/rust/no-ui/blank/blank/Cargo.toml b/src/new/templates/rust/no-ui/blank/blank/Cargo.toml index e9437534..ede6fc32 100644 --- a/src/new/templates/rust/no-ui/blank/blank/Cargo.toml +++ b/src/new/templates/rust/no-ui/blank/blank/Cargo.toml @@ -5,7 +5,7 @@ edition = "2021" publish = false [dependencies] -kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "0e464ec" } +kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "95874e4" } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" wit-bindgen = "0.24.0" diff --git a/src/new/templates/rust/no-ui/chat/chat/Cargo.toml b/src/new/templates/rust/no-ui/chat/chat/Cargo.toml index ba0d8c28..cf5e0074 100644 --- a/src/new/templates/rust/no-ui/chat/chat/Cargo.toml +++ b/src/new/templates/rust/no-ui/chat/chat/Cargo.toml @@ -6,7 +6,7 @@ publish = false [dependencies] anyhow = "1.0" -kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "0e464ec" } +kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "95874e4", features = ["logging"] } process_macros = { git = "https://github.com/kinode-dao/process_macros", rev = "626e501" } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" diff --git a/src/new/templates/rust/no-ui/chat/chat/src/lib.rs b/src/new/templates/rust/no-ui/chat/chat/src/lib.rs index b0c04de0..7d9e7b35 100644 --- a/src/new/templates/rust/no-ui/chat/chat/src/lib.rs +++ b/src/new/templates/rust/no-ui/chat/chat/src/lib.rs @@ -78,7 +78,7 @@ fn handle_message( call_init!(init); fn init(our: Address) { - init_logging(&our, Level::DEBUG, Level::INFO); + init_logging(&our, Level::DEBUG, Level::INFO).unwrap(); info!("begin"); let mut message_archive = HashMap::new(); diff --git a/src/new/templates/rust/no-ui/chat/pkg/manifest.json b/src/new/templates/rust/no-ui/chat/pkg/manifest.json index 3da591df..0e55daa8 100644 --- a/src/new/templates/rust/no-ui/chat/pkg/manifest.json +++ b/src/new/templates/rust/no-ui/chat/pkg/manifest.json @@ -5,7 +5,8 @@ "on_exit": "Restart", "request_networking": true, "request_capabilities": [ - "http_server:distro:sys" + "http_server:distro:sys", + "vfs:distro:sys" ], "grant_capabilities": [], "public": true diff --git a/src/new/templates/rust/no-ui/chat/send/Cargo.toml b/src/new/templates/rust/no-ui/chat/send/Cargo.toml index 35404096..960462b5 100644 --- a/src/new/templates/rust/no-ui/chat/send/Cargo.toml +++ b/src/new/templates/rust/no-ui/chat/send/Cargo.toml @@ -6,7 +6,7 @@ publish = false [dependencies] anyhow = "1.0" -kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "0e464ec" } +kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "95874e4" } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" wit-bindgen = "0.24.0" diff --git a/src/new/templates/rust/no-ui/echo/echo/Cargo.toml b/src/new/templates/rust/no-ui/echo/echo/Cargo.toml index c68673aa..436e2d60 100644 --- a/src/new/templates/rust/no-ui/echo/echo/Cargo.toml +++ b/src/new/templates/rust/no-ui/echo/echo/Cargo.toml @@ -7,7 +7,7 @@ publish = false [dependencies] anyhow = "1.0" bincode = "1.3.3" -kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "0e464ec" } +kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "95874e4", features = ["logging"] } process_macros = { git = "https://github.com/kinode-dao/process_macros", rev = "626e501" } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" diff --git a/src/new/templates/rust/no-ui/echo/echo/src/lib.rs b/src/new/templates/rust/no-ui/echo/echo/src/lib.rs index 141bcffc..5a1e95a6 100644 --- a/src/new/templates/rust/no-ui/echo/echo/src/lib.rs +++ b/src/new/templates/rust/no-ui/echo/echo/src/lib.rs @@ -21,8 +21,8 @@ fn handle_message(message: &Message) -> anyhow::Result<()> { } call_init!(init); -fn init(_our: Address) { - init_logging(&our, Level::DEBUG, Level::INFO); +fn init(our: Address) { + init_logging(&our, Level::DEBUG, Level::INFO).unwrap(); info!("begin"); loop { diff --git a/src/new/templates/rust/no-ui/echo/pkg/manifest.json b/src/new/templates/rust/no-ui/echo/pkg/manifest.json index 7fc7826e..94fced60 100644 --- a/src/new/templates/rust/no-ui/echo/pkg/manifest.json +++ b/src/new/templates/rust/no-ui/echo/pkg/manifest.json @@ -5,7 +5,8 @@ "on_exit": "Restart", "request_networking": true, "request_capabilities": [ - "http_server:distro:sys" + "http_server:distro:sys", + "vfs:distro:sys" ], "grant_capabilities": [], "public": true diff --git a/src/new/templates/rust/no-ui/fibonacci/fibonacci/Cargo.toml b/src/new/templates/rust/no-ui/fibonacci/fibonacci/Cargo.toml index f22bb02f..c5b011c7 100644 --- a/src/new/templates/rust/no-ui/fibonacci/fibonacci/Cargo.toml +++ b/src/new/templates/rust/no-ui/fibonacci/fibonacci/Cargo.toml @@ -7,7 +7,7 @@ publish = false [dependencies] anyhow = "1.0" bincode = "1.3.3" -kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "0e464ec" } +kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "95874e4", features = ["logging"] } process_macros = { git = "https://github.com/kinode-dao/process_macros", rev = "626e501" } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" diff --git a/src/new/templates/rust/no-ui/fibonacci/fibonacci/src/lib.rs b/src/new/templates/rust/no-ui/fibonacci/fibonacci/src/lib.rs index b64fc2bd..f2c0bc8b 100644 --- a/src/new/templates/rust/no-ui/fibonacci/fibonacci/src/lib.rs +++ b/src/new/templates/rust/no-ui/fibonacci/fibonacci/src/lib.rs @@ -83,8 +83,8 @@ fn handle_message(message: &Message) -> anyhow::Result<()> { } call_init!(init); -fn init(_our: Address) { - init_logging(&our, Level::DEBUG, Level::INFO); +fn init(our: Address) { + init_logging(&our, Level::DEBUG, Level::INFO).unwrap(); info!("begin"); loop { diff --git a/src/new/templates/rust/no-ui/fibonacci/number/Cargo.toml b/src/new/templates/rust/no-ui/fibonacci/number/Cargo.toml index 96feb682..2f0e6f9c 100644 --- a/src/new/templates/rust/no-ui/fibonacci/number/Cargo.toml +++ b/src/new/templates/rust/no-ui/fibonacci/number/Cargo.toml @@ -6,7 +6,7 @@ publish = false [dependencies] anyhow = "1.0" -kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "0e464ec" } +kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "95874e4" } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" wit-bindgen = "0.24.0" diff --git a/src/new/templates/rust/no-ui/fibonacci/pkg/manifest.json b/src/new/templates/rust/no-ui/fibonacci/pkg/manifest.json index b621d87d..7ac53d13 100644 --- a/src/new/templates/rust/no-ui/fibonacci/pkg/manifest.json +++ b/src/new/templates/rust/no-ui/fibonacci/pkg/manifest.json @@ -5,7 +5,8 @@ "on_exit": "Restart", "request_networking": true, "request_capabilities": [ - "http_server:distro:sys" + "http_server:distro:sys", + "vfs:distro:sys" ], "grant_capabilities": [], "public": true diff --git a/src/new/templates/rust/no-ui/file_transfer/download/Cargo.toml b/src/new/templates/rust/no-ui/file_transfer/download/Cargo.toml index 979a4e89..c6bdf1e3 100644 --- a/src/new/templates/rust/no-ui/file_transfer/download/Cargo.toml +++ b/src/new/templates/rust/no-ui/file_transfer/download/Cargo.toml @@ -6,7 +6,7 @@ publish = false [dependencies] anyhow = "1.0" -kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "0e464ec" } +kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "95874e4" } process_macros = { git = "https://github.com/kinode-dao/process_macros", rev = "626e501" } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" diff --git a/src/new/templates/rust/no-ui/file_transfer/file_transfer/Cargo.toml b/src/new/templates/rust/no-ui/file_transfer/file_transfer/Cargo.toml index aa970e15..c9815fc9 100644 --- a/src/new/templates/rust/no-ui/file_transfer/file_transfer/Cargo.toml +++ b/src/new/templates/rust/no-ui/file_transfer/file_transfer/Cargo.toml @@ -6,7 +6,7 @@ publish = false [dependencies] anyhow = "1.0" -kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "0e464ec" } +kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "95874e4", features = ["logging"] } process_macros = { git = "https://github.com/kinode-dao/process_macros", rev = "626e501" } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" diff --git a/src/new/templates/rust/no-ui/file_transfer/file_transfer/src/lib.rs b/src/new/templates/rust/no-ui/file_transfer/file_transfer/src/lib.rs index 1c0548b4..6e10e3f1 100644 --- a/src/new/templates/rust/no-ui/file_transfer/file_transfer/src/lib.rs +++ b/src/new/templates/rust/no-ui/file_transfer/file_transfer/src/lib.rs @@ -159,7 +159,7 @@ fn handle_message(our: &Address, message: &Message, files_dir: &Directory) -> an call_init!(init); fn init(our: Address) { - init_logging(&our, Level::DEBUG, Level::INFO); + init_logging(&our, Level::DEBUG, Level::INFO).unwrap(); info!("begin"); let drive_path = create_drive(our.package_id(), "files", None).unwrap(); diff --git a/src/new/templates/rust/no-ui/file_transfer/file_transfer_worker/Cargo.toml b/src/new/templates/rust/no-ui/file_transfer/file_transfer_worker/Cargo.toml index b2503cf8..afcc76f4 100644 --- a/src/new/templates/rust/no-ui/file_transfer/file_transfer_worker/Cargo.toml +++ b/src/new/templates/rust/no-ui/file_transfer/file_transfer_worker/Cargo.toml @@ -7,7 +7,7 @@ publish = false [dependencies] anyhow = "1.0" bincode = "1.3.3" -kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "0e464ec" } +kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "95874e4", features = ["logging"] } process_macros = { git = "https://github.com/kinode-dao/process_macros", rev = "626e501" } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" diff --git a/src/new/templates/rust/no-ui/file_transfer/file_transfer_worker/src/lib.rs b/src/new/templates/rust/no-ui/file_transfer/file_transfer_worker/src/lib.rs index 77b6fc03..222e1d5a 100644 --- a/src/new/templates/rust/no-ui/file_transfer/file_transfer_worker/src/lib.rs +++ b/src/new/templates/rust/no-ui/file_transfer/file_transfer_worker/src/lib.rs @@ -213,7 +213,7 @@ fn handle_message( call_init!(init); fn init(our: Address) { - init_logging(&our, Level::DEBUG, Level::INFO); + init_logging(&our, Level::DEBUG, Level::INFO).unwrap(); info!("worker: begin"); let start = std::time::Instant::now(); diff --git a/src/new/templates/rust/no-ui/file_transfer/file_transfer_worker_api/Cargo.toml b/src/new/templates/rust/no-ui/file_transfer/file_transfer_worker_api/Cargo.toml index 8b6e4a86..e2a9aa7d 100644 --- a/src/new/templates/rust/no-ui/file_transfer/file_transfer_worker_api/Cargo.toml +++ b/src/new/templates/rust/no-ui/file_transfer/file_transfer_worker_api/Cargo.toml @@ -6,7 +6,7 @@ publish = false [dependencies] anyhow = "1.0" -kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "0e464ec" } +kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "95874e4" } process_macros = { git = "https://github.com/kinode-dao/process_macros", rev = "626e501" } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" diff --git a/src/new/templates/rust/no-ui/file_transfer/list_files/Cargo.toml b/src/new/templates/rust/no-ui/file_transfer/list_files/Cargo.toml index bea2ad89..ed89f9c2 100644 --- a/src/new/templates/rust/no-ui/file_transfer/list_files/Cargo.toml +++ b/src/new/templates/rust/no-ui/file_transfer/list_files/Cargo.toml @@ -6,7 +6,7 @@ publish = false [dependencies] anyhow = "1.0" -kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "0e464ec" } +kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "95874e4" } process_macros = { git = "https://github.com/kinode-dao/process_macros", rev = "626e501" } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" From 3cdac8d4b8d6277ec7d77f92fe1812b2385d7cbd Mon Sep 17 00:00:00 2001 From: hosted-fornet Date: Thu, 19 Sep 2024 21:33:19 -0700 Subject: [PATCH 6/6] new: update template imports --- src/new/templates/rust/no-ui/blank/.gitignore | 1 + src/new/templates/rust/no-ui/blank/blank/Cargo.toml | 2 +- src/new/templates/rust/no-ui/chat/.gitignore | 1 + src/new/templates/rust/no-ui/chat/chat/Cargo.toml | 2 +- src/new/templates/rust/no-ui/chat/chat/src/lib.rs | 2 +- src/new/templates/rust/no-ui/chat/send/Cargo.toml | 2 +- src/new/templates/rust/no-ui/echo/.gitignore | 1 + src/new/templates/rust/no-ui/echo/echo/Cargo.toml | 2 +- src/new/templates/rust/no-ui/echo/echo/src/lib.rs | 2 +- src/new/templates/rust/no-ui/fibonacci/.gitignore | 2 ++ src/new/templates/rust/no-ui/fibonacci/fibonacci/Cargo.toml | 2 +- src/new/templates/rust/no-ui/fibonacci/fibonacci/src/lib.rs | 2 +- src/new/templates/rust/no-ui/fibonacci/number/Cargo.toml | 2 +- src/new/templates/rust/no-ui/file_transfer/.gitignore | 3 ++- src/new/templates/rust/no-ui/file_transfer/download/Cargo.toml | 2 +- .../rust/no-ui/file_transfer/file_transfer/Cargo.toml | 2 +- .../rust/no-ui/file_transfer/file_transfer_worker/Cargo.toml | 2 +- .../rust/no-ui/file_transfer/file_transfer_worker/src/lib.rs | 2 +- .../no-ui/file_transfer/file_transfer_worker_api/Cargo.toml | 2 +- .../templates/rust/no-ui/file_transfer/list_files/Cargo.toml | 2 +- 20 files changed, 22 insertions(+), 16 deletions(-) diff --git a/src/new/templates/rust/no-ui/blank/.gitignore b/src/new/templates/rust/no-ui/blank/.gitignore index 014c5e35..ccedc926 100644 --- a/src/new/templates/rust/no-ui/blank/.gitignore +++ b/src/new/templates/rust/no-ui/blank/.gitignore @@ -1,6 +1,7 @@ */target/ /target pkg/*.wasm +pkg/*.zip *.swp *.swo */wasi_snapshot_preview1.wasm diff --git a/src/new/templates/rust/no-ui/blank/blank/Cargo.toml b/src/new/templates/rust/no-ui/blank/blank/Cargo.toml index ede6fc32..617f806b 100644 --- a/src/new/templates/rust/no-ui/blank/blank/Cargo.toml +++ b/src/new/templates/rust/no-ui/blank/blank/Cargo.toml @@ -5,7 +5,7 @@ edition = "2021" publish = false [dependencies] -kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "95874e4" } +kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "fbbbd7c" } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" wit-bindgen = "0.24.0" diff --git a/src/new/templates/rust/no-ui/chat/.gitignore b/src/new/templates/rust/no-ui/chat/.gitignore index 014c5e35..ccedc926 100644 --- a/src/new/templates/rust/no-ui/chat/.gitignore +++ b/src/new/templates/rust/no-ui/chat/.gitignore @@ -1,6 +1,7 @@ */target/ /target pkg/*.wasm +pkg/*.zip *.swp *.swo */wasi_snapshot_preview1.wasm diff --git a/src/new/templates/rust/no-ui/chat/chat/Cargo.toml b/src/new/templates/rust/no-ui/chat/chat/Cargo.toml index cf5e0074..4e015db1 100644 --- a/src/new/templates/rust/no-ui/chat/chat/Cargo.toml +++ b/src/new/templates/rust/no-ui/chat/chat/Cargo.toml @@ -6,7 +6,7 @@ publish = false [dependencies] anyhow = "1.0" -kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "95874e4", features = ["logging"] } +kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "fbbbd7c", features = ["logging"] } process_macros = { git = "https://github.com/kinode-dao/process_macros", rev = "626e501" } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" diff --git a/src/new/templates/rust/no-ui/chat/chat/src/lib.rs b/src/new/templates/rust/no-ui/chat/chat/src/lib.rs index 7d9e7b35..a52d4a57 100644 --- a/src/new/templates/rust/no-ui/chat/chat/src/lib.rs +++ b/src/new/templates/rust/no-ui/chat/chat/src/lib.rs @@ -78,7 +78,7 @@ fn handle_message( call_init!(init); fn init(our: Address) { - init_logging(&our, Level::DEBUG, Level::INFO).unwrap(); + init_logging(&our, Level::DEBUG, Level::INFO, None).unwrap(); info!("begin"); let mut message_archive = HashMap::new(); diff --git a/src/new/templates/rust/no-ui/chat/send/Cargo.toml b/src/new/templates/rust/no-ui/chat/send/Cargo.toml index 960462b5..6e920300 100644 --- a/src/new/templates/rust/no-ui/chat/send/Cargo.toml +++ b/src/new/templates/rust/no-ui/chat/send/Cargo.toml @@ -6,7 +6,7 @@ publish = false [dependencies] anyhow = "1.0" -kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "95874e4" } +kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "fbbbd7c" } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" wit-bindgen = "0.24.0" diff --git a/src/new/templates/rust/no-ui/echo/.gitignore b/src/new/templates/rust/no-ui/echo/.gitignore index 014c5e35..ccedc926 100644 --- a/src/new/templates/rust/no-ui/echo/.gitignore +++ b/src/new/templates/rust/no-ui/echo/.gitignore @@ -1,6 +1,7 @@ */target/ /target pkg/*.wasm +pkg/*.zip *.swp *.swo */wasi_snapshot_preview1.wasm diff --git a/src/new/templates/rust/no-ui/echo/echo/Cargo.toml b/src/new/templates/rust/no-ui/echo/echo/Cargo.toml index 436e2d60..d0d92474 100644 --- a/src/new/templates/rust/no-ui/echo/echo/Cargo.toml +++ b/src/new/templates/rust/no-ui/echo/echo/Cargo.toml @@ -7,7 +7,7 @@ publish = false [dependencies] anyhow = "1.0" bincode = "1.3.3" -kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "95874e4", features = ["logging"] } +kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "fbbbd7c", features = ["logging"] } process_macros = { git = "https://github.com/kinode-dao/process_macros", rev = "626e501" } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" diff --git a/src/new/templates/rust/no-ui/echo/echo/src/lib.rs b/src/new/templates/rust/no-ui/echo/echo/src/lib.rs index 5a1e95a6..14e57275 100644 --- a/src/new/templates/rust/no-ui/echo/echo/src/lib.rs +++ b/src/new/templates/rust/no-ui/echo/echo/src/lib.rs @@ -22,7 +22,7 @@ fn handle_message(message: &Message) -> anyhow::Result<()> { call_init!(init); fn init(our: Address) { - init_logging(&our, Level::DEBUG, Level::INFO).unwrap(); + init_logging(&our, Level::DEBUG, Level::INFO, None).unwrap(); info!("begin"); loop { diff --git a/src/new/templates/rust/no-ui/fibonacci/.gitignore b/src/new/templates/rust/no-ui/fibonacci/.gitignore index 1b7a43f6..ccedc926 100644 --- a/src/new/templates/rust/no-ui/fibonacci/.gitignore +++ b/src/new/templates/rust/no-ui/fibonacci/.gitignore @@ -1,5 +1,7 @@ */target/ +/target pkg/*.wasm +pkg/*.zip *.swp *.swo */wasi_snapshot_preview1.wasm diff --git a/src/new/templates/rust/no-ui/fibonacci/fibonacci/Cargo.toml b/src/new/templates/rust/no-ui/fibonacci/fibonacci/Cargo.toml index c5b011c7..b2c8985b 100644 --- a/src/new/templates/rust/no-ui/fibonacci/fibonacci/Cargo.toml +++ b/src/new/templates/rust/no-ui/fibonacci/fibonacci/Cargo.toml @@ -7,7 +7,7 @@ publish = false [dependencies] anyhow = "1.0" bincode = "1.3.3" -kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "95874e4", features = ["logging"] } +kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "fbbbd7c", features = ["logging"] } process_macros = { git = "https://github.com/kinode-dao/process_macros", rev = "626e501" } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" diff --git a/src/new/templates/rust/no-ui/fibonacci/fibonacci/src/lib.rs b/src/new/templates/rust/no-ui/fibonacci/fibonacci/src/lib.rs index f2c0bc8b..9c60d585 100644 --- a/src/new/templates/rust/no-ui/fibonacci/fibonacci/src/lib.rs +++ b/src/new/templates/rust/no-ui/fibonacci/fibonacci/src/lib.rs @@ -84,7 +84,7 @@ fn handle_message(message: &Message) -> anyhow::Result<()> { call_init!(init); fn init(our: Address) { - init_logging(&our, Level::DEBUG, Level::INFO).unwrap(); + init_logging(&our, Level::DEBUG, Level::INFO, None).unwrap(); info!("begin"); loop { diff --git a/src/new/templates/rust/no-ui/fibonacci/number/Cargo.toml b/src/new/templates/rust/no-ui/fibonacci/number/Cargo.toml index 2f0e6f9c..9a917da7 100644 --- a/src/new/templates/rust/no-ui/fibonacci/number/Cargo.toml +++ b/src/new/templates/rust/no-ui/fibonacci/number/Cargo.toml @@ -6,7 +6,7 @@ publish = false [dependencies] anyhow = "1.0" -kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "95874e4" } +kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "fbbbd7c" } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" wit-bindgen = "0.24.0" diff --git a/src/new/templates/rust/no-ui/file_transfer/.gitignore b/src/new/templates/rust/no-ui/file_transfer/.gitignore index 2f9a6733..b29ccdcd 100644 --- a/src/new/templates/rust/no-ui/file_transfer/.gitignore +++ b/src/new/templates/rust/no-ui/file_transfer/.gitignore @@ -1,6 +1,7 @@ target */target/ pkg/*.wasm +pkg/*.zip pkg/ui *.swp *.swo @@ -9,4 +10,4 @@ pkg/ui */process_env ui/dist ui/node_modules -node_modules \ No newline at end of file +node_modules diff --git a/src/new/templates/rust/no-ui/file_transfer/download/Cargo.toml b/src/new/templates/rust/no-ui/file_transfer/download/Cargo.toml index c6bdf1e3..6278ca01 100644 --- a/src/new/templates/rust/no-ui/file_transfer/download/Cargo.toml +++ b/src/new/templates/rust/no-ui/file_transfer/download/Cargo.toml @@ -6,7 +6,7 @@ publish = false [dependencies] anyhow = "1.0" -kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "95874e4" } +kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "fbbbd7c" } process_macros = { git = "https://github.com/kinode-dao/process_macros", rev = "626e501" } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" diff --git a/src/new/templates/rust/no-ui/file_transfer/file_transfer/Cargo.toml b/src/new/templates/rust/no-ui/file_transfer/file_transfer/Cargo.toml index c9815fc9..52e2b986 100644 --- a/src/new/templates/rust/no-ui/file_transfer/file_transfer/Cargo.toml +++ b/src/new/templates/rust/no-ui/file_transfer/file_transfer/Cargo.toml @@ -6,7 +6,7 @@ publish = false [dependencies] anyhow = "1.0" -kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "95874e4", features = ["logging"] } +kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "fbbbd7c", features = ["logging"] } process_macros = { git = "https://github.com/kinode-dao/process_macros", rev = "626e501" } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" diff --git a/src/new/templates/rust/no-ui/file_transfer/file_transfer_worker/Cargo.toml b/src/new/templates/rust/no-ui/file_transfer/file_transfer_worker/Cargo.toml index afcc76f4..b55fa0b8 100644 --- a/src/new/templates/rust/no-ui/file_transfer/file_transfer_worker/Cargo.toml +++ b/src/new/templates/rust/no-ui/file_transfer/file_transfer_worker/Cargo.toml @@ -7,7 +7,7 @@ publish = false [dependencies] anyhow = "1.0" bincode = "1.3.3" -kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "95874e4", features = ["logging"] } +kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "fbbbd7c", features = ["logging"] } process_macros = { git = "https://github.com/kinode-dao/process_macros", rev = "626e501" } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" diff --git a/src/new/templates/rust/no-ui/file_transfer/file_transfer_worker/src/lib.rs b/src/new/templates/rust/no-ui/file_transfer/file_transfer_worker/src/lib.rs index 222e1d5a..a34a27d9 100644 --- a/src/new/templates/rust/no-ui/file_transfer/file_transfer_worker/src/lib.rs +++ b/src/new/templates/rust/no-ui/file_transfer/file_transfer_worker/src/lib.rs @@ -213,7 +213,7 @@ fn handle_message( call_init!(init); fn init(our: Address) { - init_logging(&our, Level::DEBUG, Level::INFO).unwrap(); + init_logging(&our, Level::DEBUG, Level::INFO, None).unwrap(); info!("worker: begin"); let start = std::time::Instant::now(); diff --git a/src/new/templates/rust/no-ui/file_transfer/file_transfer_worker_api/Cargo.toml b/src/new/templates/rust/no-ui/file_transfer/file_transfer_worker_api/Cargo.toml index e2a9aa7d..9bff97cf 100644 --- a/src/new/templates/rust/no-ui/file_transfer/file_transfer_worker_api/Cargo.toml +++ b/src/new/templates/rust/no-ui/file_transfer/file_transfer_worker_api/Cargo.toml @@ -6,7 +6,7 @@ publish = false [dependencies] anyhow = "1.0" -kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "95874e4" } +kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "fbbbd7c" } process_macros = { git = "https://github.com/kinode-dao/process_macros", rev = "626e501" } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" diff --git a/src/new/templates/rust/no-ui/file_transfer/list_files/Cargo.toml b/src/new/templates/rust/no-ui/file_transfer/list_files/Cargo.toml index ed89f9c2..fe62e0a5 100644 --- a/src/new/templates/rust/no-ui/file_transfer/list_files/Cargo.toml +++ b/src/new/templates/rust/no-ui/file_transfer/list_files/Cargo.toml @@ -6,7 +6,7 @@ publish = false [dependencies] anyhow = "1.0" -kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "95874e4" } +kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "fbbbd7c" } process_macros = { git = "https://github.com/kinode-dao/process_macros", rev = "626e501" } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0"