chore(dev): point dev/cargo wrappers at the shared org builder image #108

Merged
David merged 1 commit from chore/use-rust-builder-glibc-image into main 2026-05-15 02:40:22 +02:00
Owner

Summary

Two related fixes after #106 merged:

  1. Point both cargo wrappers at the shared org rust-builder image (ghcr.io/niceguyit/rust-builder-glibc:v1.0.0-rust1.94-trixie) instead of plain rust:1.94-slim-bookworm. The shared image is what every other repo under ~/projects/a8n-run/ builds in and is what CI actually runs (ci-build/Dockerfile.web, ci-build/Dockerfile.desktop-linux), so the local check now matches the CI environment one-for-one and never drifts through per-wrapper apt-get install lines.
  2. Fix a fresh CI clippy failure in server/tests/db_mentions.rs: clippy 1.94 promoted cloned_ref_to_slice_refs under -D warnings. Three &[x.clone()] constructions are rewritten to std::slice::from_ref(&x).

Changes

dev/cargo

  • Image: rust:1.94-slim-bookworm -> ghcr.io/niceguyit/rust-builder-glibc:v1.0.0-rust1.94-trixie.
  • Drop the -v lets-chat-rewrite-rustup:/usr/local/rustup mount and the -e RUSTUP_HOME=... env. The image's baked rustup home already has rustfmt + clippy registered.
  • Drop the cargo fmt --version || rustup component add ... fallback in the bash entrypoint, same reason.

dev/cargo-desktop

  • Same image swap.
  • Drop the apt-get update && apt-get install ... libgtk-3-dev libwebkit2gtk-4.1-dev libsoup-3.0-dev libssl-dev step. The shared image ships those packages (verified against ~/projects/niceguyit/oci-images/rust-builder-glibc/Dockerfile).
  • Drop the lets-chat-rewrite-desktop-apt volume mount, no longer needed.
  • Adopt the same chown-then-setpriv pattern dev/cargo uses so files cargo writes into /work (eg. Cargo.lock) land owned by the host user instead of root. Previously this wrapper ran as root because of apt-get; now that's no longer needed.

server/tests/db_mentions.rs

  • Three &[alice.clone()] / &[bob.clone()] arguments to reconcile_mentions(..., &[MentionRef]) rewritten as std::slice::from_ref(&alice) / std::slice::from_ref(&bob). Functionally identical, avoids the clone(), satisfies the new clippy 1.94 lint.

The unused named volumes (lets-chat-rewrite-rustup, lets-chat-rewrite-desktop-apt) can be removed manually with docker volume rm whenever convenient; nothing else in this repo references them.

Test plan

  • just check end-to-end is green: standalone clippy, saas clippy, desktop clippy, fmt-check. No warnings emitted.
  • First invocation pulls ghcr.io/niceguyit/rust-builder-glibc:v1.0.0-rust1.94-trixie and completes the check; subsequent runs are fully cached against the new image.
  • Forgejo runner clippy step on the next push goes green (the same image CI builds in is now what the local check uses, so any future clippy drift surfaces locally first).
## Summary Two related fixes after #106 merged: 1. Point both cargo wrappers at the shared org rust-builder image (`ghcr.io/niceguyit/rust-builder-glibc:v1.0.0-rust1.94-trixie`) instead of plain `rust:1.94-slim-bookworm`. The shared image is what every other repo under `~/projects/a8n-run/` builds in and is what CI actually runs (`ci-build/Dockerfile.web`, `ci-build/Dockerfile.desktop-linux`), so the local check now matches the CI environment one-for-one and never drifts through per-wrapper `apt-get install` lines. 2. Fix a fresh CI clippy failure in `server/tests/db_mentions.rs`: clippy 1.94 promoted `cloned_ref_to_slice_refs` under `-D warnings`. Three `&[x.clone()]` constructions are rewritten to `std::slice::from_ref(&x)`. ## Changes ### `dev/cargo` - Image: `rust:1.94-slim-bookworm` -> `ghcr.io/niceguyit/rust-builder-glibc:v1.0.0-rust1.94-trixie`. - Drop the `-v lets-chat-rewrite-rustup:/usr/local/rustup` mount and the `-e RUSTUP_HOME=...` env. The image's baked rustup home already has rustfmt + clippy registered. - Drop the `cargo fmt --version || rustup component add ...` fallback in the bash entrypoint, same reason. ### `dev/cargo-desktop` - Same image swap. - Drop the `apt-get update && apt-get install ... libgtk-3-dev libwebkit2gtk-4.1-dev libsoup-3.0-dev libssl-dev` step. The shared image ships those packages (verified against `~/projects/niceguyit/oci-images/rust-builder-glibc/Dockerfile`). - Drop the `lets-chat-rewrite-desktop-apt` volume mount, no longer needed. - Adopt the same chown-then-setpriv pattern `dev/cargo` uses so files cargo writes into `/work` (eg. Cargo.lock) land owned by the host user instead of root. Previously this wrapper ran as root because of `apt-get`; now that's no longer needed. ### `server/tests/db_mentions.rs` - Three `&[alice.clone()]` / `&[bob.clone()]` arguments to `reconcile_mentions(..., &[MentionRef])` rewritten as `std::slice::from_ref(&alice)` / `std::slice::from_ref(&bob)`. Functionally identical, avoids the `clone()`, satisfies the new clippy 1.94 lint. The unused named volumes (`lets-chat-rewrite-rustup`, `lets-chat-rewrite-desktop-apt`) can be removed manually with `docker volume rm` whenever convenient; nothing else in this repo references them. ## Test plan - [x] `just check` end-to-end is green: standalone clippy, saas clippy, desktop clippy, fmt-check. No warnings emitted. - [x] First invocation pulls `ghcr.io/niceguyit/rust-builder-glibc:v1.0.0-rust1.94-trixie` and completes the check; subsequent runs are fully cached against the new image. - [ ] Forgejo runner clippy step on the next push goes green (the same image CI builds in is now what the local check uses, so any future clippy drift surfaces locally first).
chore(dev): point dev/cargo wrappers at the shared org builder image
All checks were successful
Check / clippy + fmt + tests (pull_request) Successful in 2m46s
04d58b93df
The previous PR bumped the wrappers from `rust:1.88-slim-bookworm` to `rust:1.94-slim-bookworm` to match the CI clippy version, but plain `rust:slim` is not the image CI actually builds in. CI runs every cargo step inside `ghcr.io/niceguyit/rust-builder-glibc:vX.Y.Z-rustA.B-trixie` (see `ci-build/Dockerfile.web` and `ci-build/Dockerfile.desktop-linux`), which bakes in the pinned Rust toolchain + rustfmt + clippy + every native system library every repo under `~/projects/a8n-run/` has needed (gtk, webkit, soup, sqlite, ssl, fontconfig, libgit2, X / Wayland, ...), so the local check matches CI one-for-one and never diverges through `apt-get install` drift.

Switch both wrappers to that image and drop the now-unnecessary scaffolding:

`dev/cargo`
- Image: `rust:1.94-slim-bookworm` -> `ghcr.io/niceguyit/rust-builder-glibc:v1.0.0-rust1.94-trixie`.
- Stop mounting `lets-chat-rewrite-rustup`. The image's `/usr/local/rustup` already has rustfmt + clippy registered, so the previous "first call installs rustfmt and clippy" line is dead weight and removing it lets the bash entrypoint shrink to just `chown the volumes && setpriv && cargo "$@"`.
- Drop the `cargo fmt --version || rustup component add ...` fallback - same reason.
- Drop the `-e RUSTUP_HOME=/usr/local/rustup` env now that there is no override of the image's baked rustup home.

`dev/cargo-desktop`
- Image: `rust:1.88-slim-bookworm` -> `ghcr.io/niceguyit/rust-builder-glibc:v1.0.0-rust1.94-trixie`.
- Remove the `apt-get update && apt-get install ... libgtk-3-dev libwebkit2gtk-4.1-dev libsoup-3.0-dev libssl-dev` step at the front of the bash entrypoint. The shared image already provides every one of those packages (verified against `~/projects/niceguyit/oci-images/rust-builder-glibc/Dockerfile`).
- Drop the `lets-chat-rewrite-desktop-apt` volume mount that was caching that apt download.
- Drop the `lets-chat-rewrite-rustup` mount and the `-e RUSTUP_HOME=...` env, same reasoning as `dev/cargo`.
- Switch the container to root-only with the same chown-then-setpriv pattern `dev/cargo` uses, so Cargo.lock and other writes into the `/work` bind mount land owned by the host user instead of root. Was already silently relying on root writes; now matches `dev/cargo`'s discipline.

The volumes `lets-chat-rewrite-rustup` and `lets-chat-rewrite-desktop-apt` are no longer referenced. Existing instances can be removed manually with `docker volume rm` when convenient; nothing else in this repo touches them. The cargo registry, cargo git, and target volumes are unchanged.

CI runner clippy 1.94 promoted a new lint to `-D warnings`: `cloned_ref_to_slice_refs`. `server/tests/db_mentions.rs` had three `&[x.clone()]` constructions that the lint flagged; rewritten to `std::slice::from_ref(&x)`, which avoids the clone and is what the lint suggests.

Verified locally: `just check` runs the standalone clippy, the saas clippy, the desktop clippy, and the fmt-check, all green with no warnings, against the new image. First invocation pulls `ghcr.io/niceguyit/rust-builder-glibc:v1.0.0-rust1.94-trixie` (~2 GB); subsequent runs are fully cached and faster than the previous `rust:slim` + per-invocation `apt-get install` path.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
David merged commit 455efe78f9 into main 2026-05-15 02:40:22 +02:00
David deleted branch chore/use-rust-builder-glibc-image 2026-05-15 02:40:23 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/lets-chat!108
No description provided.