amos 9d633e9e67 Batch 15 (20261023-C-hwe-scale-15): 320 HWE-derived repair tasks
One user-space repair task per eligible HWE debug-diag / compile-deploy base
ID: 320 admitted (C 218, C++ 97, build scripts 5), 1 skipped by the content
filter. Each ships a public spec with a check-to-basis table, at least two
defects with single-fix fixtures, a symptom-masking fixture and an alternative
correct implementation. Claude re-checked all 320: structure, the HWE quality
items and trace6 Docker calibration receipts against current digests
(320/320 USABLE). Difficulty is unmeasured. Known follow-up: 212 tasks use 120
ad-hoc family names; the next batch maps them to the canonical list.
The batch's 1,256-line progress log stays in its factory report and the
36-local branch batch15-hwe.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 01:55:56 +08:00

4.8 KiB
Raw Blame History

Cross build plan port

This project prints a deterministic plan for a target build. It does not invoke the named cross tools or create a target ELF. Its own executable is built with the host g++ supplied by the runtime image. The plan models the choice of C versus C++ compiler and the target runtime library closure that a cross build must use.

Input

  1. Input is ASCII. A request is a sequence of LF terminated records ending in an exact END line with no surrounding whitespace. The program accepts consecutive requests until EOF. A blank line is invalid. CR is not part of this protocol. Fields in other records are separated by one or more ASCII spaces or tabs. No quoting or escaping is available.
  2. The first record is CONFIG target sysroot cc cxx cruntime cppruntime. target, cc, cxx, cruntime, and cppruntime are nonempty tokens using letters, digits, _, ., +, or -; tool tokens cc and cxx may also contain /. A runtime name is not . or ... sysroot is an absolute path of components using that same token alphabet, with no . or .. component and no trailing slash except /. Its only role is in printed plan paths.
  3. Then zero to 64 UNIT name language origin deps records occur. name has 1 to 32 characters from letters, digits, _, ., or -, starts with a letter, and is unique. language is C or CPP. origin is TARGET or HOST. deps is - for none or a comma joined list of distinct unit names; at most 16 dependencies per unit. A dependency name obeys the same name syntax. Units may be declared in any order.
  4. Exactly one ROOT name follows all units. It names a declared unit. END closes the request. Records in any other order, extra fields, unknown verbs, duplicate CONFIG or ROOT, malformed tokens, or missing END are rejected. A request after an END starts fresh.
  5. A rejected request prints ERROR code followed by END. Codes are FORMAT, DUPLICATE, MISSING, CYCLE, HOST_DEP, LIMIT, and NO_ROOT. FORMAT covers lexical and record shape errors; DUPLICATE covers repeated names or dependency names; MISSING covers a referenced but undeclared unit; CYCLE covers a dependency cycle reachable from root; HOST_DEP covers a reachable HOST unit; LIMIT covers the documented count bounds; NO_ROOT covers missing CONFIG, ROOT, or root unit. On multiple faults, any applicable code is acceptable. One malformed request does not stop later complete requests. An unterminated final request is rejected with ERROR FORMAT and END.

Plan semantics

  1. Only units reachable by following dependencies from ROOT appear in a successful plan. For every reachable C unit, the TOOL observation names the CONFIG cc. For every reachable CPP unit, it names CONFIG cxx. The two choices are independent even when both languages occur in the same target graph.
  2. A successful target plan must contain no reachable HOST unit. HOST units unrelated to ROOT do not affect the plan. A reachable dependency does not become a host dependency merely because its direct parent is C or CPP; its own origin decides.
  3. The target C runtime from CONFIG always appears. The target C++ runtime from CONFIG appears if any reachable unit, including an indirect dependency, has language CPP. A C ROOT may therefore require the C++ runtime. Both runtime locations are printed under sysroot/lib/; never substitute an unprefixed host runtime path. If sysroot is /, print /lib/name, with one slash.
  4. A successful plan consists of PLAN target root, one TOOL name driver for each reachable unit, one EDGE parent dependency for each reachable dependency edge, one DEPTH name number for each reachable unit, one LINK driver, one or two RUNTIME name path lines, and final END. The depth of a leaf is zero; the depth of another unit is one plus the maximum depth of its direct dependencies. The link driver is cxx if any reachable unit is CPP, otherwise cc. Records may appear in any order between PLAN and END; each required record appears exactly once. No extra records are permitted. Every output field is separated by exactly one ASCII space, with no leading or trailing space. All output records are ASCII LF terminated. stderr may contain any diagnostic bytes and is ignored by the plan protocol.

Build and demo

  1. Run make to build the native planning executable build/plan; make clean removes that derived executable. A supported self test is make demo, which pipes examples/demo.plan into build/plan and prints the resulting plan. g++ and make are available in the fixed runtime image.
  2. The submitted files are src/main.cpp, src/planner.cpp, src/planner.hpp, and Makefile. The public documentation and example are supplied unchanged in the workspace. Acceptance requires all clauses 1–9, including accepted nondefault graphs, rather than matching the single demo output.