bitcoindevkit / bitcoindevkit/bdk_wallet
[cont_integration] `fmt` job should pin the nightly compiler
- Dominant language
- Rust
- Stars
- 59
- Forks
- 105
- Avg merge
- 10d 9h
- Merged PRs (30d)
- 1
Description
### Problem
`rustfmt.toml` sets options that are only supported on the nightly channel:
```toml
comment_width = 100
format_code_in_doc_comments = true
wrap_comments = true
```
The `justfile`'s `fmt` and `check` recipes correctly invoke `cargo +nightly fmt`, but the CI `fmt` job in `.github/workflows/cont_integration.yml` does not:
```yaml
fmt:
name: Rust fmt
runs-on: ubuntu-latest
steps:
...
- name: Check fmt
run: cargo fmt --all --check
```
This uses whatever toolchain `rust-toolchain.toml` resolves to (currently stable `1.96.0`), not nightly. Stable `rustfmt` ignores unknown config keys, so the `fmt` job passes even when the file doesn't actually conform to `wrap_comments`/`format_code_in_doc_comments`. See a recent run https://github.com/bitcoindevkit/bdk_wallet/actions/runs/32433625759/job/96630281726.
CI's `fmt` does not enforce the same formatting rules that `just p` enforces locally, so PRs can pass CI with formatting that a contributor running `just p` would have to reformat.
### Second, related problem
Even after pointing CI at `+nightly`, `cargo +nightly fmt` resolves to whatever nightly happens to be installed at the time, with no version pin. Two contributors on different nightly snapshots can get different "correctly formatted" output for the same source, causing formatting churn and back-and-forth in PRs.
### Suggested fix
- Pin the nightly compiler in both `cont_integration.yml` and `justfile`, and periodically bump the pinned version alongside other toolchain bumps
Contributor guide
Research direction
Start with .github/workflows/cont_integration.yml and the justfile, then compare their fmt commands with rust-toolchain.toml and the existing toolchain bump conventions. Verify the CI and local formatting recipes use the same pinned nightly version, and run the formatting check to confirm nightly-only options are enforced consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- build-system, ci-cd
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100