# ci: Disable library backtrace capture in macOS test jobs \(\#64555\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/a49db374b621d9c19da2a8e2da293c8095983304)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: a49db374b621d9c19da2a8e2da293c8095983304

Requested commit: a49db374b621d9c19da2a8e2da293c8095983304

Commit: a49db374b621d9c19da2a8e2da293c8095983304

Tree: dde95197450d6554c84fa9e782eb27aaf13d7d3d

Author: Kirill Bulatov

Committer: GitHub

## Message

```
ci: Disable library backtrace capture in macOS test jobs (#64555)

Based on
https://github.com/zed-industries/zed/pull/64464#issuecomment-5763255028

With `RUST_BACKTRACE=1` set, `anyhow` captures a backtrace for every
error it constructs; on macOS this costs ~30ms per error, on Linux ~µs.
`Project::test` alone hits several such errors during setup
(`canonicalize`/`load` of the non-existent global `tasks.json` and
`debug.json`, worktree creation, buffer open), adding ~0.8s of fixed
cost per test on macOS.

`RUST_LIB_BACKTRACE=0` is checked by std before `RUST_BACKTRACE`, so
panics keep their backtraces while library error captures stop.
Set only on the macOS test jobs (`run_tests.yml`, `release.yml`), since
Linux and Windows pay nothing for the captures and keep the error-origin
backtraces in failure output.
Measured with `cargo nextest run -p editor --lib`: macOS 119s → 72s,
Linux 78s → 76s (noise).

Trade-off on macOS: a failing `.unwrap()` on an `anyhow::Error` in CI
output loses the backtrace of where the error was constructed; the panic
backtrace at the unwrap site is unaffected.

Release Notes:

- N/A
```

## Parents

- [63b29c2edd8ddcd63bad760dcae3b91cb2161d45](https://git.cafe/gitcafe/zed/commit/63b29c2edd8ddcd63bad760dcae3b91cb2161d45?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/a49db374b621d9c19da2a8e2da293c8095983304?format=markdown)
