Rebuild gix-error on exn 0.4.0-rc.1 - #2976
Conversation
Exercise erased callbacks and aggregation with the published release candidate, and make the remaining differences in native-source handling, ownership, classification, and reporting reproducible before replacing the vendored core. Keep this exploratory dependency in tests while the migration semantics are reviewed by the exn and gitoxide maintainers. Assisted-by: Codex
Use the upstream exception tree, caller tracking, raising, aggregation and type erasure in production. Retain gitoxide's concrete errors, native-source inspection, classification, reporting and complete standard-error chain through local adapters. Remove owned-root extraction and frame mutation APIs that upstream does not offer, and adapt their callers to retain complete error graphs. Revspec errors keep the delegate diagnostic as the primary cause while nesting the parser context instead of rearranging its frames. Assisted-by: Codex (AI)
Use native `exn` exceptions and construction APIs instead of maintaining a second exception type and compatibility facade in `gix-error`. Keep concrete errors, typed source traversal, classification and reporting policies at the `Error` and `ChainedError` boundaries. Adapt workspace callers to upstream raising, aggregation and conversions. Remove vendored-only helpers and the automatic `anyhow` integration in favor of explicit reporting-boundary conversions. Preserve existing boundary coverage and leave upstream exception behavior to upstream tests.
The fuzzer is a separate workspace and does not depend on `gix-error`, so the conversion introduced during the EXN migration failed both CIFuzz and the independent fuzz-crate checks in CI. Use the upstream exception's boxed-error conversion to enter the existing `anyhow` boundary. All 23 standalone fuzz crates now pass all-target checks; the commitgraph fuzzer also passes Clippy and formatting checks.
Sebastian Thiel (Byron)
left a comment
There was a problem hiding this comment.
Thanks for giving this a shot. I like some of the API improvements that I noticed, while glancing at it.
Would you mind trialing it in your own fork, with CI enabled? That way I don't have to see emails with changes here while it's still baking.
Also, without personal text, despite AI disclosure, I typically consider PRs disposable.
Based on this, I am closing this PR but invite you to return when ready, preferably with clearly separated speech so I get the feeling I interact with a person.
Thanks for your understanding.
PS: Please also note that I am not incredibly keen to give up my vendored copy to keep control when I need it, but I would be willing to do so based on merit and once #2847 is complete/merged. Part of my motivation, besides merit, is to give alternative error crates a boost, so please, be back and not be discouraged 🤝.
Thanks for your suggestion! I almost forget that this is possible :D |
Rebuild
gix-erroronexn = "=0.4.0-rc.1", revisiting fast/exn#35.Exn,Frame, construction traits,bail!andensure!are direct upstream re-exports; the local exception facade is deleted.Gitoxide retains concrete errors, typed source traversal, classification/retry policy, and the
Error/ChainedErrorreporting boundaries. Workspace callers use native EXN APIs and explicit boundary conversions.This is breaking: vendored extraction/mutation helpers and the automatic
anyhowintegration are removed; raw exception formatting follows upstream. RC1 still allocates source snapshots, and the adapters depend on its frame representation.Production Rust: 1,499 → 1,057 nonblank lines excluding
//comments (−29.5%). This includes removed APIs and added adapters.Validated: Rust 1.88 package tests/docs; stable workspace all-target check/Clippy and affected downstream tests.
AI disclosure: Codex prepared this at tison (@tisonkun)'s request. This draft requires independent review by tison (@tisonkun) and Sebastian Thiel (@Byron).