docs: dependency notes as the review left them
The README's section: notes are labelled by name, the file is written in place, a project.cpp that fails to load gets no update, `test --list` writes nothing, the section follows what the build loaded, and tests' dependencies don't count. The AGENTS.md gotcha: an unpinned dependency can change this file's section on any build here, and the dirty tree then rebuilds crafter.build-lib under a new version. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
ec9790589f
commit
ae5e3b6b32
2 changed files with 11 additions and 10 deletions
19
README.md
19
README.md
|
|
@ -102,7 +102,7 @@ An agent working on a project reads its `AGENTS.md`, which says nothing about th
|
|||
<!-- crafter-build: dependency notes begin -->
|
||||
<!-- Written by crafter-build from the AGENTS.consumer.md each dependency ships, and rewritten on every build. Edit those files, not this section; cfg.dependencyNotes in project.cpp picks which dependencies are included. -->
|
||||
|
||||
<!-- from https://forgejo.catcrafts.net/Catcrafts/Crafter.Math.git -->
|
||||
<!-- from Crafter.Math -->
|
||||
## Crafter.Math
|
||||
|
||||
...
|
||||
|
|
@ -110,21 +110,22 @@ An agent working on a project reads its `AGENTS.md`, which says nothing about th
|
|||
<!-- crafter-build: dependency notes end -->
|
||||
```
|
||||
|
||||
- Each file goes in as written, under a line naming where it came from: the git URL, or for a `LocalProject` the file's path relative to the consumer. It lands among the consumer's own headings, so start it with a `##` heading that names the library.
|
||||
- The section is appended the first time and rewritten in place after that, wherever it has been moved to. Edits inside it are lost on the next build; the rest of the file is never touched. The file is written only when the section changes, and an `AGENTS.md` is never created.
|
||||
- The update runs after `project.cpp` loads and before anything compiles, so a build that fails still has the notes. `lint`, `format`, `run` and `clean` leave the file alone.
|
||||
- An unpinned dependency's notes follow its default branch, as its code does, so the section can change on any build. Pin a `commit` to decide when.
|
||||
- Unbalanced markers leave the file as it is, and a notes file that would break the section (a code block it never closes, a marker line of its own) is left out; both are reported as warnings. Markers quoted inside a fenced code block don't count.
|
||||
- Each file goes in as written, under a line naming the dependency: its repository's name, or a `LocalProject`'s directory name. That reads the same on every machine, and for a `--local` checkout and its git clone alike. The file lands among the consumer's own headings, so start it with a `##` heading that names the library.
|
||||
- The section is appended the first time, after a blank line, and rewritten in place after that, wherever it has been moved to. Edits inside it are lost on the next build; the text around it is left as it is. The file is written only when the section changes, in place, so hard links, ownership and a read-only `AGENTS.md` are respected, and an `AGENTS.md` is never created.
|
||||
- The update runs once `project.cpp` has loaded and before the project compiles, so a build that fails still has the notes. A `project.cpp` that fails to load gets no update. `test --list`, `lint`, `format`, `run` and `clean` leave the file alone.
|
||||
- The section follows what the build loaded: a dependency that only some flags pull in (a `--target=`, a flag of the project's own) comes and goes with them. An unpinned dependency's notes follow its default branch, as its code does, so the section can change on any build. Pin a `commit` to decide when.
|
||||
- A library reached through two specs, pinned at one revision here and another further down, is described once, as the nearer one has it.
|
||||
- When there are notes to write, unbalanced markers leave the file as it is, with a warning. A notes file that would break the section (a code block it never closes, a marker line of its own) is left out, also with a warning. Markers quoted inside a fenced code block don't count.
|
||||
|
||||
`cfg.dependencyNotes` picks the dependencies:
|
||||
|
||||
| Value | Notes from |
|
||||
|---|---|
|
||||
| `DependencyNotes::Transitive` (default) | everything the project builds against, all the way down: its `dependencies`, its tests' dependencies and its own `#pragma crafter dependency` tooling |
|
||||
| `DependencyNotes::Direct` | only the projects the project's own configurations, tests and `#pragma crafter dependency` lines name |
|
||||
| `DependencyNotes::Transitive` (default) | everything the project builds against, all the way down: its `dependencies` and its own `#pragma crafter dependency` tooling |
|
||||
| `DependencyNotes::Direct` | only the projects the project's own configurations and `#pragma crafter dependency` lines name |
|
||||
| `DependencyNotes::None` | none, and a section from an earlier build is removed |
|
||||
|
||||
Two things never count: the project's own `AGENTS.consumer.md`, and a dependency's `#pragma crafter dependency` tooling, which is about how the dependency is built, not how it is used.
|
||||
Three things never count: the project's own `AGENTS.consumer.md`; its tests' dependencies, since a plain build never looks at the tests; and a dependency's `#pragma crafter dependency` tooling, which is about how the dependency is built, not how it is used.
|
||||
|
||||
## Tests
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue