Skip to content

Link forms, standard levels and path lengths: #641 and #642 (2026.9.15.2) - #644

Merged
Sunrisepeak merged 19 commits into
mainfrom
feat/641-642
Sep 14, 2026
Merged

Sunrisepeak merged 19 commits into
mainfrom
feat/641-642

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

Summary

The seven asks of #641 and #642, implemented in the engine as one change (2026.9.15.2). The triage record and the implementation plan are in .agents/docs/2026-09-15-641-642-*.md; every premise below was measured or read there.

Closes #641
Closes #642

Test plan

  • mcpp test (120 unit binaries) and mcpp test -p manifest|platform|buildmcpp|dyndep|versioning|toolchain-model pass locally (Linux x86_64)
  • New e2e 689, 690, 692, 693, 696, 698 pass with the fresh binary, and each fails on the released 2026.9.15.1 for the reason it covers
  • Neighbouring e2e pass: 01, 37, 55, 56, 57, 117, 124, 143, 184, 187, 193, 222, 234, 615, 638, 663, 665, 677, 678, 685, 688
  • check_docs_style, check_docs_structure, check_version_pins, check_modules_wiring, check_narrow_conversions, check_matrix_reasons, check_target_tiers
  • CI on Linux, macOS and Windows, including the Windows reading of e2e 698 leg C

speak-agent and others added 19 commits September 15, 2026 04:19
…d it states (#641 item 2)

A package that provides the C++ layer and states [package] standard now
compiles each C++ unit that neither provides nor imports a module at exactly
that level; module units, the std module included, stay at the graph's level.
The level is appended to the unit's own flag vector in make_plan, so the
compile edge, the scan edge, compile_commands.json and the build database read
one value. The provider predicate is factored into the manifest module and used
by the std module adoption. The dependency cache key and the fingerprint
metadata carry the stated level only when it exists; the higher-standard
warning no longer reports a provider whose level is applied.

Tests: unit CxxLayerStandard.* and CacheKey.ACxxLayerProvidersStatedStandardChangesTheKey;
e2e 696 (requires llvm). Docs: 07-workspace 4.2 and 22-target-side with mirrors.
…format passes its features to the pack (#641 item 4)
…em 1); a dependency's C++ shared library over a graph C++ runtime is refused or carries a stated private copy (#641 item 5)
…made the library shared; e2e 690 reads four legs
…ut with mirrors; CI runs the graph C++ runtime e2e scripts on the hermetic llvm job
…b-build scratch, extended-length opens on Windows (#641 item 3; M7, M8, M9)

M7. A source outside the package that declares it (a build program's
mcpp::source under a dependency's root) is addressed as
obj/<declaring>/__pkg/<owning package>/<path inside it>, or
obj/<declaring>/__ext/<8-hex hash of its directory>/ when no package contains
it. The mirror of the declaring-package-relative path, with one __up per
level, is gone for these sources; sources inside their declaring package,
root-owned flat addresses, the #233 census and backstop, and the cache address
(packageRel) are unchanged. In the root census branch the escaping form
applies only where the mirrored prefix was used (a basename collision), so the
flat obj/<name> of a generated OUT_DIR source (#239) is unchanged.

M8. The host-tool sub-build scratch moves from <entry>/build-<hash> to
<cache>/tool/.build/<hash of entry and consuming work root>
(tool_store::scratch_dir), keeping per-consumer isolation, re-run reuse and
removal after publish; the entry layout is unchanged.

M9. mcpp::platform::fs::extended_length (identity outside Windows; absolute,
normal, backslash, \\?\ or \\?\UNC\ form on Windows, idempotent) with the pure
spelling rule windows_extended_length_spelling. Call sites, enumerated from the
$mcpp rules of ninja_backend.cppm and the __action-stamp wrapper:
  src/cli/cmd_build.cppm  cmd_dyndep: --output; the --expect-* ddi read;
                          emit_dyndep_single input; emit_dyndep_from_files inputs
  src/cli/cmd_build.cppm  cmd_stage: source and --output (stage_file)
  src/cli/cmd_build.cppm  cmd_bmi_equal: both paths (bmi_equivalent)
  src/cli/cmd_build.cppm  cmd_coff_def: each object read; the .def write
  src/cli/cmd_build.cppm  cmd_bmi_compile: --bmi --slot --sem --command-file
                          --dep-from --dep-to (not --self, an executable)
  src/cli/cmd_build.cppm  cmd_bmi_supervise: --slot --token --command-file
  src/cli/cmd_build.cppm  cmd_bmi_await: --slot --object
  src/cli.cppm            __action-stamp: each stamp
Downstream opens receive the converted paths. Two follow-ons: the detached
compile's log opens with CreateFileW (CreateFileA does not honour the prefix
past MAX_PATH), and CompileRequest::bmiTarget keeps ninja's spelling of the
BMI for the copied depfile's target, which must not change.

Tests: unit ObjectAddress.ASourceUnderAnotherPackageIsAddressedByThatPackage,
ObjectAddress.AnUnownedEscapingSourceIsAddressedByAHashOfItsDirectory (both
fail on the previous object_for), ToolStoreScratch.IsShortPerConsumerAndStable,
PlatformFs.ExtendedLength* (four); e2e 698 (leg A fails on 2026.9.15.1 with
obj/installer/__up/__up/dep/platform/impl/helper.o). Docs: 30-build-mcpp and
its Chinese mirror.
…ram reads each dependency's form (#642 E1, E2)

- [targets.<n>] linkage and its row form state a library's default form; kind =
  "shared" stays the constraint. Precedence: the root edge, a written
  dependency_linkage, the package default, static. An explicit override is
  honoured with an information line and no degraded record.
- The link-form resolution is computed once before the root build program
  (hasSources from the scanner's own package_source_files) and applied after
  the scan as before.
- The root build program receives MCPP_DEP_<NAME>_LINKAGE under the names of
  MCPP_DEP_<NAME>_DIR; mcpp::dep_linkage() reads it. Dependency programs do not.
- Form B descriptors read linkage the same way.
- Unit tests (linkage_form, manifest, xpkg), e2e 692 and 693, docs 04, 22, 30
  with their Chinese mirrors, SPEC-004 1.4.
@Sunrisepeak
Sunrisepeak merged commit 55a856d into main Sep 14, 2026
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment