Skip to content

chore(devshell): add rustfmt + clippy + libclang for parity with CI#32

Merged
ccross2 merged 1 commit into
mainfrom
chore/devshell-add-fmt-clippy-libclang
May 28, 2026
Merged

chore(devshell): add rustfmt + clippy + libclang for parity with CI#32
ccross2 merged 1 commit into
mainfrom
chore/devshell-add-fmt-clippy-libclang

Conversation

@ccross2

@ccross2 ccross2 commented May 28, 2026

Copy link
Copy Markdown
Contributor

Summary

The nix develop shell brings the build inputs of the visage package via inputsFrom, but not the cargo subcommands that CI gates on:

  • cargo fmt --all -- --check
  • cargo clippy --workspace -- -D warnings

dtolnay/rust-toolchain@stable bundles both in the CI workflow (.github/workflows/ci.yml); our devShells.default doesn't. A contributor running nix develop && cargo fmt hits error: no such command: \fmt`` — same for clippy.

Also exposes llvmPackages.libclang + LIBCLANG_PATH, since v4l2-sys-mit runs bindgen at build time and fails with "Unable to find libclang" otherwise. Caught when running cargo check -p visaged in the devshell.

Diff

devShells.default = pkgs.mkShell {
  inputsFrom = [ visage ];
  packages = with pkgs; [
+    rustfmt
+    clippy
+    llvmPackages.libclang
     rust-analyzer
     cargo-deb
     cargo-watch
   ];
+  LIBCLANG_PATH = "${pkgs.llvmPackages.libclang.lib}/lib";
};

Scope

  • No effect on CI (CI doesn't use the devshell).
  • No effect on packaged outputs (only touches devShells.default).
  • No version bump.

Verification

In a freshly-entered nix develop:

$ which rustfmt cargo-clippy
/nix/store/...-rustfmt-1.95.0/bin/rustfmt
/nix/store/...-clippy-1.95.0/bin/cargo-clippy

$ echo $LIBCLANG_PATH
/nix/store/...-clang-21.1.8-lib/lib

$ cargo fmt --all -- --check    # clean on current main
$ cargo clippy --workspace -- -D warnings    # CI parity

Catches a real contributor friction point — surfaced by my own attempts to verify the SIGTERM fix (#30) and the PAM sweep (#31) before pushing.

🤖 Generated with Claude Code

The `nix develop` shell brings the build inputs of the `visage` package
via `inputsFrom`, but not the cargo subcommands CI gates on:

  - `cargo fmt --all -- --check`
  - `cargo clippy --workspace -- -D warnings`

`dtolnay/rust-toolchain@stable` bundles both in the CI workflow; the
devshell didn't, so a contributor running `nix develop && cargo fmt`
hit "error: no such command: `fmt`" — same for clippy.

Also exposes `llvmPackages.libclang` + `LIBCLANG_PATH`, since
`v4l2-sys-mit` runs `bindgen` at build time and fails with
"Unable to find libclang" otherwise. Surfaced when running
`cargo check -p visaged` locally.

Verified: `cargo fmt --all -- --check` and `cargo clippy --workspace`
now run inside `nix develop` without further env tweaking.

No effect on CI (CI doesn't use the devshell). No effect on packaged
outputs (this only touches `devShells.default`).
@ccross2 ccross2 merged commit 6c0e789 into main May 28, 2026
3 checks passed
@ccross2 ccross2 mentioned this pull request May 28, 2026
5 tasks
ccross2 added a commit that referenced this pull request May 28, 2026
Cohort release covering the dependency-bump and community-contribution
work that landed after v0.3.2.

Added:
- Lenovo ThinkPad X1 Carbon Gen 9 20XW00FPUS IR camera quirk (174f:2454)
  contributed by @themariusus in #29. Verified on hardware.

Packaging:
- AUR PKGBUILD: options=(!lto !debug). LTO breaks ring's hand-written
  asm and libsqlite3-sys's bundled sqlite3.c native objects on Arch's
  stock makepkg.conf, producing undefined-symbol link failures. Fixed
  by @SomeCodecat in #25.

Developer experience:
- nix develop shell now ships rustfmt, clippy, llvmPackages.libclang
  (with LIBCLANG_PATH set) so cargo fmt/clippy/build match CI gates
  inside the devshell. (#32)

Dependencies (already in main from earlier this session, surfaced here
for the CHANGELOG):
- tokio 1.49.0 -> 1.50.0
- nix 0.31.1 -> 0.31.2
- uuid 1.21.0 -> 1.23.0
- image 0.25.9 -> 0.25.10
- actions/checkout v4 -> v6
- actions/upload-artifact v4 -> v7
- actions/download-artifact v4 -> v8

Documentation:
- README Status line updated 0.3.0 -> 0.3.3 with brief summary of the
  intervening fixes and hardware additions.
- docs/STATUS.md last-updated bumped to 2026-05-28; build-state
  rewritten to reflect post-v0.3.0 bug fix wave and the quirks DB now
  covering both ASUS Zenbook 14 and Lenovo X1 Carbon Gen 9.

Workspace version bumped 0.3.2 -> 0.3.3 across Cargo.toml, Cargo.lock
(6 crates), packaging/aur/PKGBUILD, and packaging/nix/default.nix.
CHANGELOG section renamed from [Unreleased] and dated.

Known follow-up (tracked separately): packaging/aur/PKGBUILD still ships
sha256sums=('SKIP'); after this release lands, the tarball hash should
be computed and committed in a follow-up PR (lands in v0.3.4).
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.

1 participant