Skip to content

2026.10.1.2: a pack states its build, every drive takes the job count, and a unit's compile does not depend on the member selection (#751, #753) - #754

Merged
speak-agent merged 8 commits into
mainfrom
feat/selection-independent-compile
Oct 1, 2026
Merged

speak-agent merged 8 commits into
mainfrom
feat/selection-independent-compile

Conversation

@speak-agent

Copy link
Copy Markdown
Member

Implements .agents/docs/2026-10-01-pack-drive-and-selection-independent-compile-design.md (revision 2; D1 to D4 accepted as recommended, D5: one pull request). Resolves #751 and #753.

A. Every ninja drive of a plan is configured from the plan (#753)

  • The backend takes -j from plan.scheduleNinjaJobs and reclaims stale detach-codegen tokens once per build directory per command. BuildOptions::parallelJobs is removed. Measured on 2026.10.1.1: [build] jobs = 3 reached ninja from mcpp build only; mcpp test and mcpp pack ran ninja's default.
  • A drive is reported whenever the command opened the report (BuildOptions::Report::Region, the default); mcpp test's own drives pass Caller.
  • mcpp pack builds every configuration group, writes one Finished, then stages and dispatches; the dispatch pass is reported; a failed drive is reported once (report_failed_drive); the global dependency cache is filled after a pack's build (populate_dependency_cache).

B. A unit's compile does not depend on the member selection (#751)

Three facts about the whole graph reached other members' commands, so each switch between --workspace and -p recompiled them:

  1. BMI placement and importer flags (W10's census of module names over the graph). Now every package's BMIs lie below its own directory except the root's (the [bug] 对象路径按「父目录名+文件名」折叠,不同目录同名源文件冲突(multiple rules generate *.ddi) #233 rule), and each unit reads one module map of the modules it reaches through its imports: -fmodule-mapper= on GCC, @<build dir>/modmap/<package>-<hash>.modmap on clang and MSVC. A project whose modules are all its own is byte-identical. The global cache now serves qualified BMIs (DepArtifacts::bmiBuildRel).
  2. A file a member lists from outside its directory was owned by the virtual root, whose object census depended on the selection (found by the whole-argument-list criterion; this is GalTranslPP's boost.ixx case).
  3. needsPic was a census of shared link units. Position independence now follows the target: every unit of an ELF target that is not freestanding.

Criteria

  • Unit: tests/unit/test_module_address.cpp (5 tests), ObjectAddress.AMembersOutsideSourceIsImmuneToAnotherMemberListingIt (fails without the fix).
  • e2e 871 (pack report, JSON, jobs = 1 no-overlap for build/test/pack) and 872 (no recompile across selections, per-source argument-list equality of the build databases, the feature-union exception, a cache-served dependency module). Both fail on 2026.10.1.1 and pass on this branch, locally under GCC 16.1.0 and clang 22.1.8.
  • Restated: e2e 09, 847 A/G, 849 B (a dependency's BMI path gains its package directory).

Measurements before implementation (design section 8)

  • M1: relocated BMIs load through a complete map on GCC 16.1.0 and clang 22.1.8.
  • M2: clangd 22.1.8 expands @file relative to the database directory; mcppls expands response files and drops module mechanics, including an unexpanded @*.modmap.

…, and a unit's compile does not depend on the member selection (#751, #753)

Implements .agents/docs/2026-10-01-pack-drive-and-selection-independent-compile-design.md.

- Every ninja drive takes the job count and the stale-token reclaim from the
  plan, and is reported whenever the command opened the report, unless its
  caller states that it writes its own lines (mcpp test's per-test drives).
- mcpp pack states its build: package lines, the status row, and Finished
  before the first Packing line; one Finished for several configurations; the
  dispatch pass is reported; a pack fills the global dependency cache.
- Every package's BMIs lie below its own directory except the root's, as
  object files do since #233; a unit reads one module map of what it reaches
  through its imports (a GCC mapper, or a clang/MSVC argument file).
- A file a member lists from outside its directory belongs to that member, not
  to the workspace's virtual root.
- Position independence follows the target: every unit of an ELF target that
  is not freestanding is compiled with -fPIC.
…ch clang 22 can read back from the module; the sandbox verification script of 2026.10.1.2
…line, which is how cl.exe reads a command file
…own output, module maps rewritten when they differ, and a workspace addresses a member's outside source by its place in the workspace
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant