diff --git a/Cargo.lock b/Cargo.lock index c44b7ba3..2b5d746f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2281,7 +2281,7 @@ dependencies = [ [[package]] name = "kit" -version = "1.0.1" +version = "1.0.2" dependencies = [ "alloy", "alloy-sol-macro", diff --git a/Cargo.toml b/Cargo.toml index e89358f8..88c31954 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "kit" authors = ["Sybil Technologies AG"] -version = "1.0.1" +version = "1.0.2" edition = "2021" description = "Development toolkit for Hyperware" homepage = "https://hyperware.ai" diff --git a/src/new/templates/rust/ui/chat/chat/src/lib.rs b/src/new/templates/rust/ui/chat/chat/src/lib.rs index fc134747..a8d4b455 100644 --- a/src/new/templates/rust/ui/chat/chat/src/lib.rs +++ b/src/new/templates/rust/ui/chat/chat/src/lib.rs @@ -33,7 +33,7 @@ struct NewMessage { type MessageArchive = HashMap>; fn make_http_address(our: &Address) -> Address { - Address::from((our.node(), "http_server", "distro", "sys")) + Address::from((our.node(), "http-server", "distro", "sys")) } fn handle_http_server_request( @@ -44,7 +44,7 @@ fn handle_http_server_request( ) -> anyhow::Result<()> { let Ok(request) = serde_json::from_slice::(body) else { // Fail quietly if we can't parse the request - info!("couldn't parse message from http_server: {body:?}"); + info!("couldn't parse message from http-server: {body:?}"); return Ok(()); }; @@ -214,7 +214,7 @@ fn handle_message( call_init!(init); fn init(our: Address) { - init_logging(&our, Level::DEBUG, Level::INFO, None, None).unwrap(); + init_logging(Level::DEBUG, Level::INFO, None, None, None).unwrap(); info!("begin"); let mut message_archive = HashMap::new(); @@ -223,7 +223,7 @@ fn init(our: Address) { // Bind UI files to routes with index.html at "/"; API to /messages; WS to "/" server - .serve_ui(&our, "ui", vec!["/"], HttpBindingConfig::default()) + .serve_ui("ui", vec!["/"], HttpBindingConfig::default()) .expect("failed to serve UI"); server .bind_http_path(HTTP_API_PATH, HttpBindingConfig::default()) diff --git a/src/run_tests/cleanup.rs b/src/run_tests/cleanup.rs index e7c54c94..d5993108 100644 --- a/src/run_tests/cleanup.rs +++ b/src/run_tests/cleanup.rs @@ -108,7 +108,10 @@ pub async fn cleanup( // for `run-tests` that exited early by, e.g., a user input // Ctrl+C. if let Err(e) = nix::unistd::write(master_fd.as_raw_fd(), b"\x03") { - error!("failed to send SIGINT to node: {:?}", e); + match e { + nix::Error::EIO => {} + _ => error!("failed to send SIGINT to node: {:?}", e), + } } } else { clean_process_by_pid(*process_id); diff --git a/src/setup/mod.rs b/src/setup/mod.rs index 196544e2..0cf66ab4 100644 --- a/src/setup/mod.rs +++ b/src/setup/mod.rs @@ -204,7 +204,7 @@ fn call_with_nvm(arg: &str, verbose: bool) -> Result<()> { #[instrument(level = "trace", skip_all)] fn call_rustup(arg: &str, verbose: bool) -> Result<()> { run_command( - Command::new("bash").args(&["-c", &format!("rustup {}", arg)]), + Command::new("bash").args(&["-c", &format!("rustup +stable {}", arg)]), verbose, )?; Ok(()) @@ -453,7 +453,18 @@ pub async fn get_deps( // Process the response let response = tokio::select! { Some(response) = receiver.recv() => response, - _ = recv_kill.recv() => return Err(eyre!("got exit code")), + k = recv_kill.recv() => { + match k { + Err(tokio::sync::broadcast::error::RecvError::Closed) => { + // some systems drop the fake sender produced in build/mod.rs:57 + // make_fake_kill_chan() and so we handle this by ignoring the + // Closed message that comes through + // https://docs.rs/tokio/latest/tokio/sync/broadcast/struct.Receiver.html#method.recv + receiver.recv().await.unwrap() + } + _ => return Err(eyre!("got exit code")), + } + } }; let response = response.trim().to_lowercase(); match response.as_str() {