Skip to content

build: afm dev-env hygiene (cargo decouple) + pre-push mirrors CI#38

Merged
P4suta merged 2 commits into
mainfrom
ci/lefthook-pre-push-mirror
May 30, 2026
Merged

build: afm dev-env hygiene (cargo decouple) + pre-push mirrors CI#38
P4suta merged 2 commits into
mainfrom
ci/lefthook-pre-push-mirror

Conversation

@P4suta

@P4suta P4suta commented May 30, 2026

Copy link
Copy Markdown
Owner

Two dev-loop fixes that make a fresh checkout's just ci actually run,
and bring afm's pre-push in line with the sibling aozora repo.

1. Cargo caches out of the bind mount (build:)

The cargo volumes were mounted at /workspace/{target,.cargo,.sccache},
nested inside the .:/workspace bind mount; the root dev container made
the daemon create root-owned ./target / ./.cargo / ./.sccache on
the host. Moved them to /cargo/* (outside the mount). Mirror of the
aozora fix. Verified: docker compose run dev leaves host ./target
absent.

2. pre-push runs just ci (ci:)

The pre-push hook ran only test / deny / prop-deep in parallel
which also raced the shared cargo target lock — even though the repo owns
an 18-step just ci. Switch to parallel: false + run: just ci +
trailing prop-deep, matching aozora, and add aozora's lefthook
output: block + per-command fail_text:. Verified: just ci
"✓✓✓ all 18 steps passed".

🤖 Generated with Claude Code

P4suta and others added 2 commits May 31, 2026 04:04
Mirror of the sibling aozora fix. The cargo-target / cargo-registry /
cargo-git / sccache named volumes were mounted at
/workspace/{target,.cargo,.sccache} — nested inside the `.:/workspace`
source bind mount. Because the dev container runs as root, the Docker
daemon created those host-side mountpoints (./target, ./.cargo,
./.sccache) as root, littering the working tree with root-owned dirs and
breaking any host-side cargo invocation.

Move all four caches to /cargo/* (CARGO_HOME=/cargo/home,
CARGO_TARGET_DIR=/cargo/target, SCCACHE_DIR=/cargo/sccache) — outside the
bind mount. The daemon no longer touches the host tree and the checkout
stays clean. The named volumes still persist the caches between runs. The
build-time rustup override (CARGO_HOME=/usr/local/cargo for the fuzz
stage's nightly install) is unaffected.

Verified: `docker compose run dev` leaves the host ./target absent.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The pre-push hook ran only `test` / `deny` / `prop-deep` (in parallel),
even though the repo already owns an 18-step `just ci` recipe — so a push
could still introduce a lint / check / doc / spec / coverage /
upstream-diff / verify-version-pins / book regression that only surfaced
on the PR. Mirror the sibling aozora repo: run `just ci` sequentially
(cheap-to-expensive) with `prop-deep` as a trailing deep sweep, and drop
the now-redundant standalone `test` / `deny`.

Also bring over aozora's lefthook DX: an explicit `output:` block so
failures stay loud across lefthook version bumps, and a `fail_text:` on
every command with a concrete repro hint (matches the project's
dev-visibility / "no silent death" posture). `prop-deep` is tagged `deep`
for `SKIP_TAGS=deep` opt-out.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@P4suta P4suta merged commit af6e206 into main May 30, 2026
21 checks passed
@P4suta P4suta deleted the ci/lefthook-pre-push-mirror branch May 30, 2026 19:49
P4suta added a commit that referenced this pull request May 30, 2026
Align afm's rustdoc posture with the sibling aozora repo (all eight
rustdoc lints `deny`). afm previously denied only
`broken_intra_doc_links`
and left the rest at `warn`.

- Promote all rustdoc lints to `deny`. This surfaced real defects: the
  `ir` module doc linked private items (`build_ir`, `OpenContainer`,
  `ast_splice`, `projection`, `types`, `SentinelCursor`, `ParaScan`).
- Fix at the root by demoting those intra-doc links to code spans. afm's
  `just strict-code` forbids `#[allow]` outright (even with a `reason`),
  so refactoring — not silencing — is the only sanctioned fix.
- Drop `criterion` + `insta` from `[workspace.dependencies]`: declared
but
  used by zero crates (no benches/, no .snap), contradicting the udeps
  discipline `just ci` runs.

`just strict-code` + `just doc` + full `just ci` green.

> Stacked on #38; retarget to `main` once that merges.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
P4suta added a commit that referenced this pull request May 30, 2026
…ote (#40)

Three small dev-loop / hygiene fixes, aligning with the sibling aozora
repo.

- **mold linker**: the Dockerfile installs mold + clang and writes a
  `/root/.cargo/config.toml` to use them, but since the cargo-dirs
  decouple set `CARGO_HOME=/cargo/home`, cargo never reads that config —
so afm's host-triple builds silently used the default linker. Drive mold
via target-scoped env in `docker-compose.yml`, scoped to the host triple
  so `wasm-pack` (rust-lld) is unaffected. Matches aozora.
- **.gitignore**: the bare `fuzz/{target,corpus,artifacts}/` rules
matched
  a nonexistent top-level `fuzz/` — the real crate is
  `crates/afm-markdown/fuzz/`. Replace with `crates/*/fuzz/*`.
- **release.yml**: header said "five target triples"; the matrix has
three.

`just ci` green (incl. the mold-linked build).

> Stacked on #38; retarget to `main` once that merges.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
P4suta added a commit that referenced this pull request May 30, 2026
…#41)

- Add a PR-time `wasm-build` job (needs: check) running `just
wasm-build`
  + `just playground-build`. afm-wasm and the Vite playground were built
  only post-merge in docs.yml, so a wasm-pack / playground break stayed
  invisible until it blocked the Pages deploy — now it fails the PR.
Mirrors aozora's PR-time wasm job. (aozora's native cross-target jobs —
  wasip1 / aarch64 / ffi / pandoc / wheel — are correctly NOT ported.)
- Add `RUSTDOCFLAGS: "-D warnings"` to docs.yml's `cargo doc` step as
  defense-in-depth for the deploy build.

This gate verifies afm-wasm BUILDS; whether it should be PUBLISHED to
npm
(vs build-from-source for sibling hosts) is an open owner decision, out
of
scope here.

> Stacked on #38; retarget to `main` once that merges.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@P4suta P4suta restored the ci/lefthook-pre-push-mirror branch June 1, 2026 14:35
@P4suta P4suta deleted the ci/lefthook-pre-push-mirror branch June 1, 2026 15:03
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