hotfix: fix build (#3102)

This commit is contained in:
Michael Neale
2025-06-27 15:29:21 +10:00
committed by GitHub
parent 666ce691d3
commit 7f71220411
14 changed files with 45 additions and 16 deletions

View File

@@ -10,6 +10,9 @@ license = "Apache-2.0"
repository = "https://github.com/block/goose" repository = "https://github.com/block/goose"
description = "An AI agent" description = "An AI agent"
[workspace.lints.clippy]
uninlined_format_args = "allow"
# Patch for Windows cross-compilation issue with crunchy # Patch for Windows cross-compilation issue with crunchy
[patch.crates-io] [patch.crates-io]
crunchy = { git = "https://github.com/nmathewson/crunchy", branch = "cross-compilation-fix" } crunchy = { git = "https://github.com/nmathewson/crunchy", branch = "cross-compilation-fix" }

View File

@@ -7,6 +7,9 @@ license.workspace = true
repository.workspace = true repository.workspace = true
description.workspace = true description.workspace = true
[lints]
workspace = true
[dependencies] [dependencies]
anyhow = "1.0" anyhow = "1.0"

View File

@@ -7,6 +7,9 @@ license.workspace = true
repository.workspace = true repository.workspace = true
description.workspace = true description.workspace = true
[lints]
workspace = true
[[bin]] [[bin]]
name = "goose" name = "goose"
path = "src/main.rs" path = "src/main.rs"

View File

@@ -8,6 +8,9 @@ license.workspace = true
repository.workspace = true repository.workspace = true
description.workspace = true description.workspace = true
[lints]
workspace = true
[lib] [lib]
name = "goose_ffi" name = "goose_ffi"
crate-type = ["cdylib"] crate-type = ["cdylib"]

View File

@@ -7,6 +7,9 @@ license.workspace = true
repository.workspace = true repository.workspace = true
description.workspace = true description.workspace = true
[lints]
workspace = true
[lib] [lib]
crate-type = ["lib", "cdylib"] crate-type = ["lib", "cdylib"]
name = "goose_llm" name = "goose_llm"

View File

@@ -7,6 +7,9 @@ license.workspace = true
repository.workspace = true repository.workspace = true
description.workspace = true description.workspace = true
[lints]
workspace = true
[dependencies] [dependencies]
mcp-core = { path = "../mcp-core" } mcp-core = { path = "../mcp-core" }
mcp-server = { path = "../mcp-server" } mcp-server = { path = "../mcp-server" }

View File

@@ -7,6 +7,9 @@ license.workspace = true
repository.workspace = true repository.workspace = true
description.workspace = true description.workspace = true
[lints]
workspace = true
[dependencies] [dependencies]
goose = { path = "../goose" } goose = { path = "../goose" }
mcp-core = { path = "../mcp-core" } mcp-core = { path = "../mcp-core" }

View File

@@ -7,6 +7,9 @@ license.workspace = true
repository.workspace = true repository.workspace = true
description.workspace = true description.workspace = true
[lints]
workspace = true
[build-dependencies] [build-dependencies]
tokio = { version = "1.43", features = ["full"] } tokio = { version = "1.43", features = ["full"] }
reqwest = { version = "0.12.9", features = ["json", "rustls-tls-native-roots"], default-features = false } reqwest = { version = "0.12.9", features = ["json", "rustls-tls-native-roots"], default-features = false }

View File

@@ -10,7 +10,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
// Create base directory // Create base directory
fs::create_dir_all(BASE_DIR)?; fs::create_dir_all(BASE_DIR)?;
println!("cargo:rerun-if-changed=build.rs"); println!("cargo:rerun-if-changed=build.rs");
println!("cargo:rerun-if-changed={}", BASE_DIR); println!("cargo:rerun-if-changed={BASE_DIR}");
for tokenizer_name in TOKENIZERS { for tokenizer_name in TOKENIZERS {
download_tokenizer(tokenizer_name).await?; download_tokenizer(tokenizer_name).await?;
@@ -21,30 +21,26 @@ async fn main() -> Result<(), Box<dyn Error>> {
async fn download_tokenizer(repo_id: &str) -> Result<(), Box<dyn Error>> { async fn download_tokenizer(repo_id: &str) -> Result<(), Box<dyn Error>> {
let dir_name = repo_id.replace('/', "--"); let dir_name = repo_id.replace('/', "--");
let download_dir = format!("{}/{}", BASE_DIR, dir_name); let download_dir = format!("{BASE_DIR}/{dir_name}");
let file_url = format!( let file_url = format!("https://huggingface.co/{repo_id}/resolve/main/tokenizer.json");
"https://huggingface.co/{}/resolve/main/tokenizer.json", let file_path = format!("{download_dir}/tokenizer.json");
repo_id
);
let file_path = format!("{}/tokenizer.json", download_dir);
// Create directory if it doesn't exist // Create directory if it doesn't exist
fs::create_dir_all(&download_dir)?; fs::create_dir_all(&download_dir)?;
// Check if file already exists // Check if file already exists
if Path::new(&file_path).exists() { if Path::new(&file_path).exists() {
println!("Tokenizer for {} already exists, skipping...", repo_id); println!("Tokenizer for {repo_id} already exists, skipping...");
return Ok(()); return Ok(());
} }
println!("Downloading tokenizer for {}...", repo_id); println!("Downloading tokenizer for {repo_id}...");
// Download the file // Download the file
let response = reqwest::get(&file_url).await?; let response = reqwest::get(&file_url).await?;
if !response.status().is_success() { if !response.status().is_success() {
return Err(format!( return Err(format!(
"Failed to download tokenizer for {}, status: {}", "Failed to download tokenizer for {repo_id}, status: {}",
repo_id,
response.status() response.status()
) )
.into()); .into());
@@ -53,6 +49,6 @@ async fn download_tokenizer(repo_id: &str) -> Result<(), Box<dyn Error>> {
let content = response.bytes().await?; let content = response.bytes().await?;
fs::write(&file_path, content)?; fs::write(&file_path, content)?;
println!("Downloaded {} to {}", repo_id, file_path); println!("Downloaded {repo_id} to {file_path}");
Ok(()) Ok(())
} }

View File

@@ -3,6 +3,9 @@ name = "mcp-client"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
[lints]
workspace = true
[dependencies] [dependencies]
mcp-core = { path = "../mcp-core" } mcp-core = { path = "../mcp-core" }
tokio = { version = "1", features = ["full"] } tokio = { version = "1", features = ["full"] }

View File

@@ -134,10 +134,7 @@ impl StdioActor {
while let Some(message_str) = receiver.recv().await { while let Some(message_str) = receiver.recv().await {
tracing::debug!(message = ?message_str, "Sending outgoing message"); tracing::debug!(message = ?message_str, "Sending outgoing message");
if let Err(e) = stdin if let Err(e) = stdin.write_all(format!("{message_str}\n").as_bytes()).await {
.write_all(format!("{}\n", message_str).as_bytes())
.await
{
tracing::error!(error = ?e, "Error writing message to child process"); tracing::error!(error = ?e, "Error writing message to child process");
break; break;
} }

View File

@@ -3,6 +3,9 @@ name = "mcp-core"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
[lints]
workspace = true
[dependencies] [dependencies]
async-trait = "0.1" async-trait = "0.1"
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }

View File

@@ -3,6 +3,9 @@ name = "mcp-macros"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
[lints]
workspace = true
[lib] [lib]
proc-macro = true proc-macro = true

View File

@@ -3,6 +3,9 @@ name = "mcp-server"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
[lints]
workspace = true
[dependencies] [dependencies]
anyhow = "1.0.94" anyhow = "1.0.94"
thiserror = "1.0" thiserror = "1.0"