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"
description = "An AI agent"
[workspace.lints.clippy]
uninlined_format_args = "allow"
# Patch for Windows cross-compilation issue with crunchy
[patch.crates-io]
crunchy = { git = "https://github.com/nmathewson/crunchy", branch = "cross-compilation-fix" }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -7,6 +7,9 @@ license.workspace = true
repository.workspace = true
description.workspace = true
[lints]
workspace = true
[build-dependencies]
tokio = { version = "1.43", features = ["full"] }
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
fs::create_dir_all(BASE_DIR)?;
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 {
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>> {
let dir_name = repo_id.replace('/', "--");
let download_dir = format!("{}/{}", BASE_DIR, dir_name);
let file_url = format!(
"https://huggingface.co/{}/resolve/main/tokenizer.json",
repo_id
);
let file_path = format!("{}/tokenizer.json", download_dir);
let download_dir = format!("{BASE_DIR}/{dir_name}");
let file_url = format!("https://huggingface.co/{repo_id}/resolve/main/tokenizer.json");
let file_path = format!("{download_dir}/tokenizer.json");
// Create directory if it doesn't exist
fs::create_dir_all(&download_dir)?;
// Check if file already 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(());
}
println!("Downloading tokenizer for {}...", repo_id);
println!("Downloading tokenizer for {repo_id}...");
// Download the file
let response = reqwest::get(&file_url).await?;
if !response.status().is_success() {
return Err(format!(
"Failed to download tokenizer for {}, status: {}",
repo_id,
"Failed to download tokenizer for {repo_id}, status: {}",
response.status()
)
.into());
@@ -53,6 +49,6 @@ async fn download_tokenizer(repo_id: &str) -> Result<(), Box<dyn Error>> {
let content = response.bytes().await?;
fs::write(&file_path, content)?;
println!("Downloaded {} to {}", repo_id, file_path);
println!("Downloaded {repo_id} to {file_path}");
Ok(())
}

View File

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

View File

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

View File

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

View File

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

View File

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