Commit 6a2117f0 authored by Benjamin Woodruff's avatar Benjamin Woodruff Committed by Jiachi Liu

Turbopack: chore: Update anyhow, remove old backtrace feature (#85844)

- `anyhow` now causes `cargo clippy` to warn about `.to_string()` in `bail!(...)` calls. I also inlined most of these format string variables while I was at it. https://github.com/dtolnay/anyhow/pull/426
- The `backtrace` feature isn't needed (and is a no-op) since Rust 1.65. https://github.com/dtolnay/anyhow/blob/master/Cargo.toml#L19-L22
parent 2bcc5791
...@@ -244,12 +244,9 @@ checksum = "70033777eb8b5124a81a1889416543dddef2de240019b674c81285a2635a7e1e" ...@@ -244,12 +244,9 @@ checksum = "70033777eb8b5124a81a1889416543dddef2de240019b674c81285a2635a7e1e"
[[package]] [[package]]
name = "anyhow" name = "anyhow"
version = "1.0.98" version = "1.0.100"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61"
dependencies = [
"backtrace",
]
[[package]] [[package]]
name = "approx" name = "approx"
......
...@@ -371,7 +371,7 @@ tungstenite = "0.20.1" ...@@ -371,7 +371,7 @@ tungstenite = "0.20.1"
allsorts = { version = "0.14.0", default-features = false, features = [ allsorts = { version = "0.14.0", default-features = false, features = [
"flate2_rust", "flate2_rust",
] } ] }
anyhow = "1.0.98" anyhow = "1.0.100"
async-compression = { version = "0.3.13", default-features = false, features = [ async-compression = { version = "0.3.13", default-features = false, features = [
"gzip", "gzip",
"tokio", "tokio",
......
...@@ -13,7 +13,7 @@ bench = false ...@@ -13,7 +13,7 @@ bench = false
workspace = true workspace = true
[dependencies] [dependencies]
anyhow = { workspace = true, features = ["backtrace"] } anyhow = { workspace = true }
byteorder = { workspace = true } byteorder = { workspace = true }
either = { workspace = true } either = { workspace = true }
futures = { workspace = true } futures = { workspace = true }
......
...@@ -1533,10 +1533,8 @@ pub async fn rebase( ...@@ -1533,10 +1533,8 @@ pub async fn rebase(
let base_path = [&old_base.path, "/"].concat(); let base_path = [&old_base.path, "/"].concat();
if !fs_path.path.starts_with(&base_path) { if !fs_path.path.starts_with(&base_path) {
bail!( bail!(
"rebasing {} from {} onto {} doesn't work because it's not part of the source path", "rebasing {fs_path} from {old_base} onto {new_base} doesn't work because it's not \
fs_path.to_string(), part of the source path",
old_base.to_string(),
new_base.to_string()
); );
} }
if new_base.path.is_empty() { if new_base.path.is_empty() {
......
...@@ -124,7 +124,7 @@ async fn resolve_symlink_safely(entry: DirectoryEntry) -> Result<DirectoryEntry> ...@@ -124,7 +124,7 @@ async fn resolve_symlink_safely(entry: DirectoryEntry) -> Result<DirectoryEntry>
if source_path.is_inside_or_equal(&resolved_entry.clone().path().unwrap()) { if source_path.is_inside_or_equal(&resolved_entry.clone().path().unwrap()) {
bail!( bail!(
"'{}' is a symlink causes that causes an infinite loop!", "'{}' is a symlink causes that causes an infinite loop!",
source_path.path.to_string() source_path.path,
) )
} }
} }
......
...@@ -17,7 +17,7 @@ harness = false ...@@ -17,7 +17,7 @@ harness = false
workspace = true workspace = true
[dependencies] [dependencies]
anyhow = { workspace = true, features = ["backtrace"] } anyhow = { workspace = true }
chromiumoxide = { workspace = true, features = [ chromiumoxide = { workspace = true, features = [
"tokio-runtime", "tokio-runtime",
], default-features = false } ], default-features = false }
......
...@@ -84,11 +84,7 @@ impl EcmascriptBrowserChunkContent { ...@@ -84,11 +84,7 @@ impl EcmascriptBrowserChunkContent {
let chunk_server_path = if let Some(path) = output_root.get_path_to(&chunk_path) { let chunk_server_path = if let Some(path) = output_root.get_path_to(&chunk_path) {
path path
} else { } else {
bail!( bail!("chunk path {chunk_path} is not in output root {output_root}");
"chunk path {} is not in output root {}",
chunk_path.to_string(),
output_root.to_string()
);
}; };
Either::Left(StringifyJs(chunk_server_path)) Either::Left(StringifyJs(chunk_server_path))
} }
......
...@@ -99,11 +99,7 @@ impl EcmascriptBrowserEvaluateChunk { ...@@ -99,11 +99,7 @@ impl EcmascriptBrowserEvaluateChunk {
let chunk_server_path = if let Some(path) = output_root.get_path_to(&chunk_path) { let chunk_server_path = if let Some(path) = output_root.get_path_to(&chunk_path) {
path path
} else { } else {
bail!( bail!("chunk path {chunk_path} is not in output root {output_root}");
"chunk path {} is not in output root {}",
chunk_path.to_string(),
output_root.to_string()
);
}; };
Either::Left(StringifyJs(chunk_server_path)) Either::Left(StringifyJs(chunk_server_path))
} }
......
...@@ -27,11 +27,7 @@ impl EcmascriptBrowserChunkVersion { ...@@ -27,11 +27,7 @@ impl EcmascriptBrowserChunkVersion {
let chunk_path = if let Some(path) = output_root.get_path_to(&chunk_path) { let chunk_path = if let Some(path) = output_root.get_path_to(&chunk_path) {
path path
} else { } else {
bail!( bail!("chunk path {chunk_path} is not in client root {output_root}");
"chunk path {} is not in client root {}",
chunk_path.to_string(),
output_root.to_string()
);
}; };
let entries = EcmascriptBrowserChunkContentEntries::new(content).await?; let entries = EcmascriptBrowserChunkContentEntries::new(content).await?;
let mut entries_hashes = let mut entries_hashes =
......
...@@ -37,7 +37,7 @@ custom_allocator = ["turbo-tasks-malloc/custom_allocator"] ...@@ -37,7 +37,7 @@ custom_allocator = ["turbo-tasks-malloc/custom_allocator"]
workspace = true workspace = true
[dependencies] [dependencies]
anyhow = { workspace = true, features = ["backtrace"] } anyhow = { workspace = true }
clap = { workspace = true, features = ["derive", "env"] } clap = { workspace = true, features = ["derive", "env"] }
console-subscriber = { workspace = true, optional = true } console-subscriber = { workspace = true, optional = true }
dunce = { workspace = true } dunce = { workspace = true }
......
...@@ -18,7 +18,7 @@ bench = false ...@@ -18,7 +18,7 @@ bench = false
workspace = true workspace = true
[dependencies] [dependencies]
anyhow = { workspace = true, features = ["backtrace"] } anyhow = { workspace = true }
clap = { workspace = true, features = ["derive", "env"] } clap = { workspace = true, features = ["derive", "env"] }
console-subscriber = { workspace = true, optional = true } console-subscriber = { workspace = true, optional = true }
rustc-hash = { workspace = true } rustc-hash = { workspace = true }
......
...@@ -69,19 +69,14 @@ impl EcmascriptBuildNodeEntryChunk { ...@@ -69,19 +69,14 @@ impl EcmascriptBuildNodeEntryChunk {
path path
} else { } else {
bail!( bail!(
"cannot find a relative path from the chunk ({}) to the runtime chunk ({})", "cannot find a relative path from the chunk ({chunk_path}) to the runtime \
chunk_path.to_string(), chunk ({runtime_path})",
runtime_path.to_string(),
); );
}; };
let chunk_public_path = if let Some(path) = output_root.get_path_to(&chunk_path) { let chunk_public_path = if let Some(path) = output_root.get_path_to(&chunk_path) {
path path
} else { } else {
bail!( bail!("chunk path ({chunk_path}) is not in output root ({output_root})");
"chunk path ({}) is not in output root ({})",
chunk_path.to_string(),
output_root.to_string()
);
}; };
let mut code = CodeBuilder::default(); let mut code = CodeBuilder::default();
......
...@@ -46,11 +46,7 @@ impl EcmascriptBuildNodeRuntimeChunk { ...@@ -46,11 +46,7 @@ impl EcmascriptBuildNodeRuntimeChunk {
let runtime_public_path = if let Some(path) = output_root.get_path_to(&runtime_path) { let runtime_public_path = if let Some(path) = output_root.get_path_to(&runtime_path) {
path path
} else { } else {
bail!( bail!("runtime path {runtime_path} is not in output root {output_root}");
"runtime path {} is not in output root {}",
runtime_path.to_string(),
output_root.to_string()
);
}; };
let mut code = CodeBuilder::default(); let mut code = CodeBuilder::default();
......
...@@ -27,11 +27,7 @@ impl EcmascriptBuildNodeChunkVersion { ...@@ -27,11 +27,7 @@ impl EcmascriptBuildNodeChunkVersion {
let chunk_path = if let Some(path) = output_root.get_path_to(&chunk_path) { let chunk_path = if let Some(path) = output_root.get_path_to(&chunk_path) {
path path
} else { } else {
bail!( bail!("chunk path {chunk_path} is not in client root {output_root}");
"chunk path {} is not in client root {}",
chunk_path.to_string(),
output_root.to_string()
);
}; };
let chunk_items = content.await?.chunk_item_code_and_ids().await?; let chunk_items = content.await?.chunk_item_code_and_ids().await?;
Ok(EcmascriptBuildNodeChunkVersion { Ok(EcmascriptBuildNodeChunkVersion {
......
...@@ -12,7 +12,7 @@ path = "src/main.rs" ...@@ -12,7 +12,7 @@ path = "src/main.rs"
bench = false bench = false
[dependencies] [dependencies]
anyhow = { workspace = true, features = ["backtrace"] } anyhow = { workspace = true }
either = { workspace = true } either = { workspace = true }
flate2 = { workspace = true } flate2 = { workspace = true }
hashbrown = { workspace = true, features = ["raw"] } hashbrown = { workspace = true, features = ["raw"] }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment