From 42e8a046ca220d3bb04c292c153a3f81a1e43bce Mon Sep 17 00:00:00 2001 From: Quanyi Ma Date: Thu, 7 Aug 2025 19:10:55 +0800 Subject: [PATCH 1/4] Update Cargo.toml for removing scorpio Signed-off-by: Quanyi Ma --- Cargo.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 4cd3ced51..b2042e247 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,6 @@ members = [ "extensions/rag/chat", "extensions/rag/index", "extensions/observatory", - "scorpio", "context", "neptune", ] From b108e4a545f62d3ca8c763744396cb1270c95092 Mon Sep 17 00:00:00 2001 From: Quanyi Ma Date: Thu, 7 Aug 2025 20:44:47 +0800 Subject: [PATCH 2/4] Fix clippy errors Signed-off-by: Quanyi Ma --- gemini/src/p2p/client.rs | 2 +- libra/src/command/branch.rs | 1 - libra/src/command/restore.rs | 32 ++++++++++++++++---------------- mono/src/server/http_server.rs | 4 ++-- 4 files changed, 19 insertions(+), 20 deletions(-) diff --git a/gemini/src/p2p/client.rs b/gemini/src/p2p/client.rs index c531b2c65..9e4ef0290 100644 --- a/gemini/src/p2p/client.rs +++ b/gemini/src/p2p/client.rs @@ -79,7 +79,7 @@ impl P2PClient { } } - pub fn get_bootstrap_node(&self) -> Cow { + pub fn get_bootstrap_node(&self) -> Cow<'_, str> { let ref_str = self .bootstrap_node .get() diff --git a/libra/src/command/branch.rs b/libra/src/command/branch.rs index b309cc7de..2cdd2e153 100644 --- a/libra/src/command/branch.rs +++ b/libra/src/command/branch.rs @@ -50,7 +50,6 @@ pub async fn execute(args: BranchArgs) { Head::Branch(name) => set_upstream(&name, &args.set_upstream_to.unwrap()).await, Head::Detached(_) => { eprintln!("fatal: HEAD is detached"); - return; } }; } else if args.list { diff --git a/libra/src/command/restore.rs b/libra/src/command/restore.rs index c89acfa50..a70601ae2 100644 --- a/libra/src/command/restore.rs +++ b/libra/src/command/restore.rs @@ -81,25 +81,25 @@ pub async fn execute(args: RestoreArgs) { // to workdir path let target_blobs: Vec<(PathBuf, SHA1)> = { - // `source` has been pre-process before ↑ - if source.is_none() { - // only this situation, restore from [Index] - assert!(!staged); - let index = Index::load(path::index()).unwrap(); - index - .tracked_entries(0) - .into_iter() - .map(|entry| (PathBuf::from(&entry.name), entry.hash)) - .collect() - } else { - // restore from commit hash - if let Some(commit) = target_commit { + match (source.as_ref(), target_commit) { + (None, _) => { + // only this situation, restore from [Index] + assert!(!staged); + let index = Index::load(path::index()).unwrap(); + index + .tracked_entries(0) + .into_iter() + .map(|entry| (PathBuf::from(&entry.name), entry.hash)) + .collect() + } + (Some(_), Some(commit)) => { + // restore from commit hash let tree_id = Commit::load(&commit).tree_id; let tree = Tree::load(&tree_id); tree.get_plain_items() - } else { - let src = source.unwrap(); - if storage.search(&src).await.len() != 1 { + } + (Some(src), None) => { + if storage.search(src).await.len() != 1 { eprintln!("fatal: could not resolve {src}"); } else { eprintln!("fatal: reference is not a commit: {src}"); diff --git a/mono/src/server/http_server.rs b/mono/src/server/http_server.rs index 0badc92f9..c26bc699a 100644 --- a/mono/src/server/http_server.rs +++ b/mono/src/server/http_server.rs @@ -195,9 +195,9 @@ pub async fn post_method_router( pack_protocol.service_type = Some(ServiceType::ReceivePack); crate::git_protocol::http::git_receive_pack(req, pack_protocol).await } else { - return Err(ProtocolError::NotFound( + Err(ProtocolError::NotFound( "Operation not supported".to_owned(), - )); + )) } } From 56ad369c1b76fda673beba1183946a1696989da3 Mon Sep 17 00:00:00 2001 From: Quanyi Ma Date: Thu, 7 Aug 2025 21:46:54 +0800 Subject: [PATCH 3/4] Update scorpio Cargo.toml Signed-off-by: Quanyi Ma --- Cargo.toml | 4 +++- monobean/README.md | 3 +++ scorpio/Cargo.toml | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b2042e247..3ce36b194 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,9 +18,11 @@ members = [ "extensions/observatory", "context", "neptune", + "scorpio", ] default-members = ["mega", "mono", "libra", "aries", "orion", "orion-server"] resolver = "1" +exclude = ["scorpio"] [workspace.dependencies] gateway = { path = "gateway" } @@ -105,7 +107,7 @@ rayon = "1.10.0" byteorder = "1.5.0" bincode = "2.0.1" once_cell = "1.21.3" -testcontainers = "0.24.0" +testcontainers = "0.25.0" scopeguard = "1.2.0" serial_test = "3.2.0" sysinfo = "0.36.0" diff --git a/monobean/README.md b/monobean/README.md index 13f67feab..8c4e3726b 100644 --- a/monobean/README.md +++ b/monobean/README.md @@ -23,6 +23,7 @@ As this module uses Gtk4 and libadwaita to construct the GUI, you should additio ### For Ubuntu Users Tested on Ubuntu 24.04 (Noble), other Ubuntu versions should work as well. Simply type the following commands to build: + ```bash sudo apt update sudo apt install -y libgtk-4-dev libadwaita-1-0 libadwaita-1-dev libgtksourceview-5-dev @@ -46,7 +47,9 @@ $env:LIB = "C:\gtk\lib;" + $env:LIB $env:PKG_CONFIG_PATH = "C:\gtk\lib\pkgconfig" + $env:PKG_CONFIG_PATH $env:INCLUDE = "C:\gtk\include;C:\gtk\include\cairo;C:\gtk\include\glib-2.0;C:\gtk\include\gobject-introspection-1.0;C:\gtk\lib\glib-2.0\include;" + $env:INCLUDE ``` + Then build the package: + ```pwsh cargo build --bin monobean ``` diff --git a/scorpio/Cargo.toml b/scorpio/Cargo.toml index bde744dad..8f6f4adcf 100644 --- a/scorpio/Cargo.toml +++ b/scorpio/Cargo.toml @@ -28,7 +28,7 @@ once_cell = "1.19.0" arc-swap = "1.7.1" env_logger = "0.11.5" sled = "0.34.7" -bincode = { workspace = true , features = ["serde"] } +bincode = "2.0.1" async-recursion = "1.1.1" bytes = "1.7.2" futures = "0.3.31" @@ -47,7 +47,7 @@ thiserror = "2.0.12" crossbeam = "0.8.4" fs_extra = "1.2" dashmap = "6.1.0" -chrono = { workspace = true } +chrono = "0.4.24" [features] From 630f60cf818155ccedc35f91234e9f1063631e38 Mon Sep 17 00:00:00 2001 From: Quanyi Ma Date: Thu, 7 Aug 2025 22:43:11 +0800 Subject: [PATCH 4/4] Fix clippy error of common module Signed-off-by: Quanyi Ma --- common/src/config.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/common/src/config.rs b/common/src/config.rs index 904eca651..4737f3fb4 100644 --- a/common/src/config.rs +++ b/common/src/config.rs @@ -433,9 +433,7 @@ impl PackConfig { } let ratio_result = size_str.parse::(); - if ratio_result.is_ok() { - let ratio = ratio_result.unwrap(); - + if let Ok(ratio) = ratio_result { if ratio > 0.0 && ratio < 1.0 { let total_mem = fn_get_total_capacity()?;