diff --git a/TODO.md b/TODO.md index 3194bce..5335e78 100644 --- a/TODO.md +++ b/TODO.md @@ -21,6 +21,14 @@ fmt-check, and commit. # Completed Steps +- 2026-10-06: `REPO_POLICIES.md` and both checklists now say that a checkout + whose `.git` is a file, a linked worktree or a repository checked out as a + submodule, is the exception to a plain `docker build .` succeeding (issue + 111): that file points to a git directory outside the build context, so the + build cannot read the version and the version check in the canonical + `Dockerfile` stops it. Such a build is given its version with + `--build-arg VERSION=...`, as `script/docker` and `script/cibuild` already do. + The check itself is unchanged. - 2026-10-06: The canonical `.gitignore` and `.editorconfig` now each end with a comment saying the repository's own entries go below it and a re-vendor keeps them (issue 103, which took in issue 104), as `.dockerignore`'s header already diff --git a/prompts/EXISTING_REPO_CHECKLIST.md b/prompts/EXISTING_REPO_CHECKLIST.md index 28bb055..9073b0e 100644 --- a/prompts/EXISTING_REPO_CHECKLIST.md +++ b/prompts/EXISTING_REPO_CHECKLIST.md @@ -91,8 +91,13 @@ with your task. version still comes out empty, `dev` or `unknown`. A plain `docker build .` with no build arguments must succeed; a Dockerfile that refuses an empty build argument drops that refusal and keeps the argument. - `script/docker` and `script/cibuild` pass the version they compute on the - host; it takes precedence. A tag-derived version additionally needs + A checkout whose `.git` is a file (a linked worktree, or a repository + checked out as a submodule) is the exception: that file points to a git + directory outside the build context, so the build cannot read the version + and a plain `docker build .` fails; pass the version with + `--build-arg VERSION=...`, as `script/docker` and `script/cibuild` already + do. `script/docker` and `script/cibuild` pass the version they compute on + the host; it takes precedence. A tag-derived version additionally needs `fetch-depth: 0` on the CI checkout step, which clones shallow and fetches no tags by default. - [ ] Gitea Actions workflow in `.gitea/workflows/` runs `script/cibuild` on diff --git a/prompts/NEW_REPO_CHECKLIST.md b/prompts/NEW_REPO_CHECKLIST.md index 56619a3..598a556 100644 --- a/prompts/NEW_REPO_CHECKLIST.md +++ b/prompts/NEW_REPO_CHECKLIST.md @@ -97,6 +97,12 @@ Template files can be fetched from: version still comes out empty, `dev` or `unknown`. A plain `docker build .` with no build arguments must succeed; a Dockerfile that refuses an empty build argument drops that refusal and keeps the argument. + A checkout whose `.git` is a file (a linked worktree, or a repository + checked out as a submodule) is the exception: that file points to a git + directory outside the build context, so the build cannot read the version + and a plain `docker build .` fails; pass the version with + `--build-arg VERSION=...`, as `script/docker` and `script/cibuild` already + do. - The Dockerfile carries a `lint` phase and a `test` phase, each invoking its tool directly rather than through `make` or `script/`, and the final stage carries a `COPY --from=` of a harmless file from each so the image diff --git a/prompts/REPO_POLICIES.md b/prompts/REPO_POLICIES.md index c72195c..ceeb07f 100644 --- a/prompts/REPO_POLICIES.md +++ b/prompts/REPO_POLICIES.md @@ -281,6 +281,12 @@ style conventions are in separate documents: `.git` and the version still comes out empty, `dev` or `unknown`. A plain `docker build .` with no build arguments must succeed; a Dockerfile that refuses an empty build argument drops that refusal and keeps the argument. + A checkout whose `.git` is a file (a linked worktree, or a repository + checked out as a submodule) is the exception: that file points to a git + directory outside the build context, so the build cannot read the version + and a plain `docker build .` fails; pass the version with + `--build-arg VERSION=...`, as `script/docker` and `script/cibuild` already + do. - Every repo should have a Gitea Actions workflow (`.gitea/workflows/`) that runs `script/cibuild` on push, and checks out the repo as its only other step.