Skip to content

fix(image): copy tooling/sql into the build stage - #5

Merged
sajonaro merged 1 commit into
mainfrom
fix-image-missing-sql-library
Aug 24, 2026
Merged

fix(image): copy tooling/sql into the build stage#5
sajonaro merged 1 commit into
mainfrom
fix-image-missing-sql-library

Conversation

@sajonaro

Copy link
Copy Markdown
Contributor

The failure

The publish run stopped in stage 1:

File "tooling/cli/dune", line 34, characters 61-69:
34 |  (libraries writ_data writ_syntax writ_runtime writ_loadpath writ_sql))
                                                                  ^^^^^^^^
Error: Library "writ_sql" not found.
-> required by library "writ_cli" in _build/default/tooling/cli

Why

The Dockerfile enumerates the source directories the build stage needs, one COPY per library — deliberately, since that list is the check that writ and writ-mcp are a small closed set. writ_cli gained a dependency on writ_sql; the list did not gain tooling/sql.

It builds everywhere else because everywhere else has the whole tree. Only the image sees the subset, and nothing builds the image on push — image.yml fires on a v* tag or by hand — so the drift stayed invisible until publish.

The change

One COPY, plus a note in the comment block above the list recording this failure mode, since the list reads like documentation and is load-bearing.

Verification

Local docker build, changed layer uncached:

  • stage 1 compiled writ.exe and writ_mcp.exe
  • the in-Dockerfile smoke checks passed: writ checkstates: 2, writ derive(3 rows), writ-mcp initialize → protocolVersion
  • docker run --rm <image> --versionwrit 0.1.0
  • writ sql — the verb the missing library backs — runs in the finished image

Checked the rest of the closure against the dune files: writ.exe needs writ_data, writ_syntax, writ_runtime, writ_loadpath, writ_sql; writ_mcp.exe adds writ_json and writ_mcp. tooling/sql was the only gap.

🤖 Generated with Claude Code

The Dockerfile enumerates the source directories the build stage needs,
one COPY per library, and that list is the check that the two shipped
binaries are a small closed set. `writ_cli` gained a dependency on
`writ_sql` and the list did not gain `tooling/sql`, so the image build
stopped at "Library "writ_sql" not found" while every other build — which
sees the whole tree — kept passing.

Nothing builds the image on push (image.yml fires on a v* tag or by
hand), so the drift was invisible until publish. The comment above the
list now says so, because the list is load-bearing and reads like
documentation.

Verified by a local `docker build`: both executables compile, the
in-Dockerfile smoke checks pass, and `writ sql` — the verb the missing
library backs — runs in the finished image.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@sajonaro
sajonaro merged commit 7908ccc into main Aug 24, 2026
1 check passed
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant