docs: correct what the sibling-args docs promise
All checks were successful
Flatpak / flatpak (pull_request) Successful in 7m27s
All checks were successful
Flatpak / flatpak (pull_request) Successful in 7m27s
The README suggested giving one sibling a list without a flag only the project reads, so that the sibling would not get a build directory of its own. When another path loads the same sibling with the full list, that filter is what gives it the second directory: two builds of one project, both in the program (#41). It now says to build such a list once and give it to every sibling. It also says the default is read when the spec is made, so a spec made at namespace scope, on another thread or in a script forwards nothing, and that cfg.projectArgs, the part ApplyStandardArgs did not interpret, is no substitute: it drops the target and the build type. The comments on ProjectArgs() and on Configuration::projectArgs say the same. The spec comment named --local as a flag the default carries down a chain of siblings. Through a GitProject hop it breaks: the clone has no checkouts beside it. The GitProject comment said the clone is keyed by the args; only the Configuration is, and every arg list builds in the one clone. AGENTS.md now notes that a stale harness gives no symptom for a changed default member initialiser: project.cpp silently gets the old default. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
70b68b98a5
commit
84d9d66649
4 changed files with 21 additions and 12 deletions
|
|
@ -483,7 +483,9 @@ export namespace Crafter {
|
|||
// cfg.files, say), and without it both flag settings share one bin dir
|
||||
// and interleave their outputs there. Populated by ApplyStandardArgs;
|
||||
// the args it does recognise are excluded, since their effect already
|
||||
// shows up in target/march/mtune/debug/sysroot/type.
|
||||
// shows up in target/march/mtune/debug/sysroot/type. For the same
|
||||
// reason this is not what to hand a sibling project: ProjectArgs() is
|
||||
// every arg, the recognised ones included.
|
||||
std::vector<std::string> projectArgs;
|
||||
std::vector<Test> tests;
|
||||
// Lint rules for `crafter-build lint`. Populate via AddLintRule.
|
||||
|
|
|
|||
|
|
@ -93,21 +93,26 @@ export namespace Crafter {
|
|||
// remote's default branch HEAD (sloppy but convenient), set branch to
|
||||
// track a branch tip, or set commit to pin to an immutable SHA. args are
|
||||
// what the dep's CrafterBuildProject receives. They default to this
|
||||
// project's own, so --target=, --march=, --debug and flags of its own
|
||||
// such as --local reach a whole chain of sibling projects without being
|
||||
// passed. Set them to forward something else: a copy without one of this
|
||||
// project's flags, one with an extra --target=, or {} for nothing.
|
||||
// project's own, read when the spec is made, so --target=, --march=,
|
||||
// --debug and the project's own flags reach every sibling down a chain
|
||||
// without being passed. Set them to forward something else: {} for
|
||||
// nothing, or a list built from this project's args, such as one without
|
||||
// a flag only this project reads. Give such a list to every sibling: a
|
||||
// project that two paths load with two different lists is built twice,
|
||||
// and the program ends up with both builds.
|
||||
struct GitProjectSpec {
|
||||
GitSource source;
|
||||
fs::path projectFile = "project.cpp";
|
||||
std::vector<std::string> args = ProjectArgs();
|
||||
};
|
||||
|
||||
// Clones the spec's git URL into the per-project external cache (keyed by
|
||||
// url+branch+commit+args+projectFile), recursively LoadProject's the
|
||||
// remote's project.cpp, and returns a stable Configuration* you can drop
|
||||
// into cfg.dependencies. The Configuration is owned by an internal cache
|
||||
// for the lifetime of the build; identical specs share one Configuration.
|
||||
// Clones the spec's git URL into the external cache, recursively
|
||||
// LoadProject's the remote's project.cpp, and returns a stable
|
||||
// Configuration* you can drop into cfg.dependencies. The clone is keyed by
|
||||
// url+branch+commit+projectFile alone, so every arg list builds in the
|
||||
// same working tree, each into variant directories of its own. The
|
||||
// Configuration is owned by an internal cache for the lifetime of the
|
||||
// build, keyed by the clone and the args: identical specs share one.
|
||||
Configuration* GitProject(const GitProjectSpec& spec);
|
||||
|
||||
// Specification for a local sibling crafter-build project (e.g. an
|
||||
|
|
|
|||
Loading…
Reference in a new issue