Skip to content

Rebuild gix-error on exn 0.4.0-rc.1 - #2976

Closed
tison (tisonkun) wants to merge 4 commits into
GitoxideLabs:mainfrom
tisonkun:exn-0.4-rc1
Closed

Rebuild gix-error on exn 0.4.0-rc.1#2976
tison (tisonkun) wants to merge 4 commits into
GitoxideLabs:mainfrom
tisonkun:exn-0.4-rc1

Conversation

@tisonkun

@tisonkun tison (tisonkun) commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Rebuild gix-error on exn = "=0.4.0-rc.1", revisiting fast/exn#35. Exn, Frame, construction traits, bail! and ensure! are direct upstream re-exports; the local exception facade is deleted.

Gitoxide retains concrete errors, typed source traversal, classification/retry policy, and the Error/ChainedError reporting boundaries. Workspace callers use native EXN APIs and explicit boundary conversions.

This is breaking: vendored extraction/mutation helpers and the automatic anyhow integration 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).

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)
@tisonkun tison (tisonkun) changed the title Evaluate adopting exn 0.4.0-rc.1 in gix-error Use exn 0.4.0-rc.1 as gix-error's exception core Sep 7, 2026
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.
@tisonkun tison (tisonkun) changed the title Use exn 0.4.0-rc.1 as gix-error's exception core Rebuild gix-error on exn 0.4.0-rc.1 Sep 7, 2026
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.

@Byron Sebastian Thiel (Byron) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 🤝.

@tisonkun

Copy link
Copy Markdown
Contributor Author

Would you mind trialing it in your own fork, with CI enabled?

Thanks for your suggestion! I almost forget that this is possible :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants