Link forms, standard levels and path lengths: #641 and #642 (2026.9.15.2) - #644
Merged
Merged
Conversation
…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.
…ngth paths (#641 item 3)
…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.
… build program (#642 E1, E2)
…kage that constrains its form
…onsumer writes; e2e 693 leg F
…t its sources mark with default visibility
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.pinned_versions_for). A fresh home no longer resolvesrequires = ["mcpp:compiler=llvm"]to the Android NDK'sllvm@30.0.16248370, andcompiler=emsdk/compiler=android-ndkfind their own pins instead of a false refusal.[package] standardcompiles its implementation units at exactly that level; module units, the std module included, stay at the graph's level. A c++20 program can usellvm.libcxx. The level enters the dependency cache key and the fingerprint; a provider that states nothing is byte-identical.__pkg/<owner>/...) or a hashed directory (__ext/<hash>/); the host-tool sub-build scratch is<cache>/tool/.build/<hash>; ninja-invoked engine subcommands open files through an extended-length path helper on Windows.mcpp pack --featuresreaches every build pass of the pack;mcpp run --formatpasses its features to the pack it performs.shared-library-cxx-runtime), naming the remedies; undercxx_runtime = { shared = "self-contained" }it links a private copy of the runtime. Measured: with a private copy per image,std::runtime_errorthrown in the library is not caught by that class in the program, which the refusal states.linkage = "static" | "shared"in[targets.<n>]and[target.<sel>.targets.<n>]states a package's default link form;kind = "shared"stays the constraint. The consumer's edge and a writtendependency_linkageoverride it with an information line, which--strictaccepts.MCPP_DEP_<NAME>_LINKAGEandmcpp::dep_linkage(name).Closes #641
Closes #642
Test plan
mcpp test(120 unit binaries) andmcpp test -p manifest|platform|buildmcpp|dyndep|versioning|toolchain-modelpass locally (Linux x86_64)check_docs_style,check_docs_structure,check_version_pins,check_modules_wiring,check_narrow_conversions,check_matrix_reasons,check_target_tiers