Files
Luke SandbergandGitHub cd24304296 Turbopack: add more context to persistence file errors (#95318)
### What?

Adds path- and operation-level context to the filesystem errors raised
by the `turbo-persistence` commit/rollback flow and the
`turbo-tasks-backend` database invalidation/versioning helpers.

### Why?

A user reported a bare `Access is denied. (OS error 5)` on Windows 11
that surfaced out of the cache `commit` flow with no indication of which
file or which filesystem operation failed:
https://github.com/vercel/next.js/discussions/95130#discussioncomment-17479429
The underlying issue was fixed in #95495 but this adds more information
for future issues.

Raw `io::Error`s from `?` carry an OS error code but no path, so there
was no way to tell whether the failure was on `CURRENT`, a `.del` file,
a per-file `fsync`, the directory `fsync`, or a cleanup `remove_file`
etc.

### How?

- Adopted the `fs_err` crate for all fs operations in the persistence
layer
- Added additional context to some flows
- Unified `CURRENT` file writing and adopted an 'atomic write' pattern.

<!-- NEXT_JS_LLM_PR -->
2026-07-07 23:25:42 +00:00

84 lines
2.5 KiB
TOML

[package]
name = "turbo-tasks-backend"
version = "0.1.0"
description = "TBD"
license = "MIT"
edition = "2024"
autobenches = false
[lib]
bench = false
[lints]
workspace = true
[features]
default = []
print_cache_item_size_with_compressed = ["print_cache_item_size", "dep:lzzzz"]
print_cache_item_size = []
no_fast_stale = []
aggregation_update_no_batch = []
verify_serialization = []
verify_aggregation_graph = []
verify_immutable = []
verify_determinism = ["turbo-tasks/verify_determinism"]
task_dirty_cause = ["turbo-tasks/task_dirty_cause"]
trace_aggregation_update_stats = []
trace_aggregation_update_queue = []
trace_aggregation_update = ["trace_aggregation_update_queue"]
trace_leaf_distance_update = []
trace_find_and_schedule = ["trace_aggregation_update_queue"]
trace_task_completion = []
trace_task_modification = []
trace_task_dirty = ["trace_aggregation_update_queue", "task_dirty_cause"]
trace_task_output_dependencies = []
trace_task_details = []
trace_prepare_tasks = []
[dependencies]
anyhow = { workspace = true }
bincode = { workspace = true }
auto-hash-map = { workspace = true }
bitfield = { workspace = true }
crossbeam-utils = { workspace = true }
dashmap = { workspace = true, features = ["raw-api"]}
fs-err = { workspace = true }
hashbrown = { workspace = true, features = ["raw"] }
indexmap = { workspace = true }
lzzzz = { workspace = true, optional = true }
parking_lot = { workspace = true }
rand = { workspace = true }
ringmap = { workspace = true, features = ["serde"] }
rustc-hash = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
serde_path_to_error = { workspace = true }
smallvec = { workspace = true }
tokio = { workspace = true }
tracing = { workspace = true }
turbo-bincode = { workspace = true }
turbo-persistence = { workspace = true }
turbo-rcstr = { workspace = true }
turbo-tasks = { workspace = true }
turbo-tasks-hash = { workspace = true }
turbo-tasks-malloc = { workspace = true, default-features = false }
thread_local = { workspace = true }
[dev-dependencies]
async-trait = { workspace = true }
criterion = { workspace = true, features = ["async_tokio"] }
futures = { workspace = true }
indoc = { workspace = true }
regex = { workspace = true }
tempfile = { workspace = true }
triomphe = { workspace = true }
thiserror = { workspace = true }
turbo-tasks-malloc = { workspace = true , features = ["custom_allocator"]}
rstest = { workspace = true }
turbo-tasks-testing = { workspace = true }
[[bench]]
name = "mod"
harness = false