This way, the behaviour of `gix::Error` is the same as it was before without actually exposing an `Exn` error tree.
Unified · Split
| @@ -280,8 +280,10 @@ jobs: · 279 unmodified lines | |||
| 280 | # due to being more in line with some Unix-oriented assumptions. So we need to verify that | 280 | # due to being more in line with some Unix-oriented assumptions. So we need to verify that |
| 281 | # the test suite is compatible with being run even outside that environment, including that | 281 | # the test suite is compatible with being run even outside that environment, including that |
| 282 | # `gix-testtools` is still able to run fixture scripts with the `bash` shell as intended. | 282 | # `gix-testtools` is still able to run fixture scripts with the `bash` shell as intended. |
| 283 | # `gix-error` is excluded because it gets compiled with the wrong feature toggles here. | ||
| 284 | # It's tested individually. | ||
| 283 | run: | # zizmor: ignore[template-injection] | 285 | run: | # zizmor: ignore[template-injection] |
| 284 | cargo nextest run --workspace --no-fail-fast -- ${{ matrix.test-args }} | 286 | cargo nextest run --workspace --no-fail-fast --exclude gix-error -- ${{ matrix.test-args }} |
| 285 | - name: Check that tracked archives are up to date | 287 | - name: Check that tracked archives are up to date |
| 286 | run: | | 288 | run: | |
| 287 | # If this fails, the fix is usually to commit a regenerated archive. | 289 | # If this fails, the fix is usually to commit a regenerated archive. |
| @@ -24,7 +24,7 @@ required-features = ["blocking-network-client"] · 23 unmodified lines | |||
| 24 | 24 | ||
| 25 | [features] | 25 | [features] |
| 26 | 26 | ||
| 27 | default = ["max-performance-safe", "comfort", "basic", "extras"] | 27 | default = ["max-performance-safe", "comfort", "basic", "extras", "auto-chain-error"] |
| 28 | 28 | ||
| 29 | #! There are various categories of features which help to optimize performance and build times. `gix` comes with 'batteries included' and everything is | 29 | #! There are various categories of features which help to optimize performance and build times. `gix` comes with 'batteries included' and everything is |
| 30 | #! enabled as long as it doesn't sacrifice compatibility. Most users will be fine with that but will pay with higher compile times than necessary as they | 30 | #! enabled as long as it doesn't sacrifice compatibility. Most users will be fine with that but will pay with higher compile times than necessary as they |
| @@ -272,6 +272,12 @@ zlib-stock = ["gix-features/zlib"] · 241 unmodified lines | |||
| 272 | #! | 272 | #! |
| 273 | #! The catch-all of feature toggles. | 273 | #! The catch-all of feature toggles. |
| 274 | 274 | ||
| 275 | ## All [`gix::Error`](crate::Error) will produce error chains, which makes them work as expected in conjunction with `anyhow`. | ||
| 276 | auto-chain-error = ["gix-error/auto-chain-error"] | ||
| 277 | |||
| 278 | ## The opposite of `auto-chain-error`. Use it to override `auto-chain-error`. | ||
| 279 | tree-error = ["gix-error/tree-error"] | ||
| 280 | |||
| 275 | ## Enable tracing using the `tracing` crate for coarse tracing. | 281 | ## Enable tracing using the `tracing` crate for coarse tracing. |
| 276 | tracing = ["gix-features/tracing"] | 282 | tracing = ["gix-features/tracing"] |
| 277 | 283 | ||
| @@ -407,7 +413,7 @@ document-features = { version = "0.2.0", optional = true } · 129 unmodified lines | |||
| 407 | [dev-dependencies] | 413 | [dev-dependencies] |
| 408 | # For additional features that aren't enabled by default due to MSRV | 414 | # For additional features that aren't enabled by default due to MSRV |
| 409 | gix = { path = ".", default-features = false, features = [ | 415 | gix = { path = ".", default-features = false, features = [ |
| 410 | "need-more-recent-msrv", | 416 | "need-more-recent-msrv", "tree-error" |
| 411 | ] } | 417 | ] } |
| 412 | pretty_assertions = "1.4.0" | 418 | pretty_assertions = "1.4.0" |
| 413 | gix-testtools = { path = "../tests/tools" } | 419 | gix-testtools = { path = "../tests/tools" } |
| @@ -158,6 +158,7 @@ unit-tests: · 157 unmodified lines | |||
| 158 | cargo nextest run -p gix-worktree-state-tests --features gix-features-parallel --no-fail-fast | 158 | cargo nextest run -p gix-worktree-state-tests --features gix-features-parallel --no-fail-fast |
| 159 | cargo nextest run -p gix-worktree-tests --features gix-features-parallel --no-fail-fast | 159 | cargo nextest run -p gix-worktree-tests --features gix-features-parallel --no-fail-fast |
| 160 | cargo nextest run -p gix-error --no-fail-fast --test auto-chain-error --features auto-chain-error | 160 | cargo nextest run -p gix-error --no-fail-fast --test auto-chain-error --features auto-chain-error |
| 161 | cargo nextest run -p gix-error --no-fail-fast | ||
| 161 | cargo nextest run -p gix-hash --no-fail-fast | 162 | cargo nextest run -p gix-hash --no-fail-fast |
| 162 | cargo nextest run -p gix-hash --features sha256 --no-fail-fast | 163 | cargo nextest run -p gix-hash --features sha256 --no-fail-fast |
| 163 | cargo nextest run -p gix-hash --no-default-features --features sha256 --no-fail-fast # TODO: make this actually work by removing 'sha1' from default features. | 164 | cargo nextest run -p gix-hash --no-default-features --features sha256 --no-fail-fast # TODO: make this actually work by removing 'sha1' from default features. |