fix(build): copy fj-mcp askama.toml into Docker builds #74

Merged
David merged 1 commit from fix/FJ-60-copy-askama-toml-docker into main 2026-07-18 17:29:13 +02:00
Owner

Problem

The build-binary-static.yml publish job failed on main (run #381, commit 891d0d5e) with a real compile error in fj-mcp: template "instance.html" not found in directories ["/build/crates/fj-mcp/templates"], which makes the InstanceTemplate derive fail to compile.

Root cause

FJ-55 gave fj-mcp its own server-rendered Forgejo-instance page. The template lives at crates/fj-mcp/src/web/templates/instance.html, and crates/fj-mcp/askama.toml (dirs = ["src/web/templates"]) redirects the askama loader away from the default crates/fj-mcp/templates. The template file itself is committed and copied by COPY crates/fj-mcp/src, but all three build files copy the source without ever copying askama.toml. Inside the image askama therefore fell back to its default crates/fj-mcp/templates directory, found nothing, and failed the derive. The triage note on FJ-60 guessed the template was never committed; that is not the case, the config that points at it was simply never copied into the build.

Fix

Copy crates/fj-mcp/askama.toml alongside the crate source in all three build files: oci-build/Dockerfile, oci-build/Dockerfile.static, and oci-build/Dockerfile.windows. The dummy-prime layer needs no change, it compiles an empty lib.rs with no Template derives.

Verification

  • Built the Dockerfile.static builder stage (the exact file that failed CI): fj-mcp compiles cleanly with --features update-check, including the InstanceTemplate derive.
  • just pre-commit passed, whose check-docker step builds the regular oci-build/Dockerfile builder stage.

Closes FJ-60.

## Problem The `build-binary-static.yml` publish job failed on `main` (run #381, commit 891d0d5e) with a real compile error in `fj-mcp`: `template "instance.html" not found in directories ["/build/crates/fj-mcp/templates"]`, which makes the `InstanceTemplate` derive fail to compile. ## Root cause FJ-55 gave `fj-mcp` its own server-rendered Forgejo-instance page. The template lives at `crates/fj-mcp/src/web/templates/instance.html`, and `crates/fj-mcp/askama.toml` (`dirs = ["src/web/templates"]`) redirects the askama loader away from the default `crates/fj-mcp/templates`. The template file itself is committed and copied by `COPY crates/fj-mcp/src`, but all three build files copy the source without ever copying `askama.toml`. Inside the image askama therefore fell back to its default `crates/fj-mcp/templates` directory, found nothing, and failed the derive. The triage note on FJ-60 guessed the template was never committed; that is not the case, the config that points at it was simply never copied into the build. ## Fix Copy `crates/fj-mcp/askama.toml` alongside the crate source in all three build files: `oci-build/Dockerfile`, `oci-build/Dockerfile.static`, and `oci-build/Dockerfile.windows`. The dummy-prime layer needs no change, it compiles an empty `lib.rs` with no `Template` derives. ## Verification - Built the `Dockerfile.static` builder stage (the exact file that failed CI): `fj-mcp` compiles cleanly with `--features update-check`, including the `InstanceTemplate` derive. - `just pre-commit` passed, whose `check-docker` step builds the regular `oci-build/Dockerfile` builder stage. Closes FJ-60.
fix(build): copy fj-mcp askama.toml into Docker builds
All checks were successful
Check / fmt + clippy + build + tests (pull_request) Successful in 1m2s
Create release / Create release from merged PR (pull_request) Has been skipped
f52a5aff73
FJ-55 added the crate-local Forgejo-instance page (crates/fj-mcp/src/web/templates/instance.html) plus crates/fj-mcp/askama.toml, whose `dirs = ["src/web/templates"]` redirects the askama template loader away from the default crates/fj-mcp/templates. All three build files (oci-build/Dockerfile, Dockerfile.static, Dockerfile.windows) copy crates/fj-mcp/src but never copied askama.toml, so inside the image askama fell back to its default crates/fj-mcp/templates directory, could not find instance.html, and the InstanceTemplate derive failed to compile the fj-mcp lib (the CI failure captured in run #381 on build-binary-static.yml).

Copy crates/fj-mcp/askama.toml alongside the source in all three Dockerfiles. The dummy-prime layer needs no change: it compiles an empty lib.rs with no Template derives. Verified by building the Dockerfile.static builder stage (the file that failed CI) and via `just pre-commit`, whose check-docker step builds the regular Dockerfile builder stage.

#FJ-60
David merged commit 5d6a1d2eb9 into main 2026-07-18 17:29:13 +02:00
David deleted branch fix/FJ-60-copy-askama-toml-docker 2026-07-18 17:29:13 +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
pandoras-box/forgejo-cli!74
No description provided.