Skip to content

0.17.0: the general library for build programs, the resolved toolset in deps-vcpkg and deps-cmake, and a test kit for plugins (mcpp#734) - #37

Merged
Sunrisepeak merged 9 commits into
mainfrom
feat/734-plugins-0.17.0
Sep 28, 2026
Merged

Sunrisepeak merged 9 commits into
mainfrom
feat/734-plugins-0.17.0

Conversation

@speak-agent

Copy link
Copy Markdown
Member

Implements the plugin half of mcpp-community/mcpp#734, as designed in mcpp's .agents/docs/2026-09-28-build-cost-foreign-toolsets-and-library-surface-design.md (§3, §6; §13.5 records the tasks and the departures). Release 0.17.0; the package floor is mcpp 2026.9.28.3 (mcpp-community/mcpp#735).

What changes

Item Change Test
U1 L2 behind plugins-core (renamed from surface, kept as an alias until 2027-03-28): mcpp.plugins.declare, the new mcpp.plugins.toolset and mcpp.plugins.fs. plugins-testing adds the test kit. [package] mcpp = ">=2026.9.28.3". Compatibility units under compat/, and a CI check that fails once a unit's date has passed. the package and all-rules-compile on every row; check-compat-retirement.sh
U2 mcpp.plugins.toolset: how the resolved toolset reaches a foreign build system. instance for a Visual Studio toolset, chain for a managed MSVC toolset and the clang rows, detected on request and on the Linux GCC row, whose payload driver is not a complete handover. tests/plugin-logic
U3 deps-vcpkg: the instance selected with VCPKG_VISUAL_STUDIO_PATH (same ABI hash as before), or a derived triplet <base>-mcpp-<hash> whose text and chain-loaded toolchain hold no path, the derived triplet as host triplet and the toolset's directories on a kept PATH on the MSVC ABI; an MSBuild port under chain refused by name; the C runtime follows the program's contract and a contradicting project triplet is refused. deps-cmake: the Visual Studio generator on that instance, or Ninja with mcpp's ninja; CMAKE_MSVC_RUNTIME_LIBRARY follows the program. docs/deps.md states each mechanism, the port kinds it builds, and the upgrade effect. the CI rows below
U4 mcpp.plugins.testing: a plugin function runs in a child process against a stated context, and its directives and files are checked. tests/plugin-logic: 14 cases; removing the host-triplet argument fails exactly the managed-row case

Readings

Dispatch run 36441093549 (mcpp_source_ref=feat/734-build-plugin-architecture), all four jobs green:

  • Linux. The test kit; the GCC row keeps vcpkg's detection and the standard triplet; under llvm@22.1.8 the ports build with mcpp's clang through a derived triplet and the two toolsets' prefixes coexist; deps-cmake with mcpp's clang; the compatibility check.
  • Windows with Visual Studio. The installation selects the instance and keeps x64-windows; a self-contained program's ports are x64-windows-static and link, and x64-windows named under it is refused naming both statements.
  • Windows with Visual Studio masked, managed msvc@14.44.35207. A CMake port (fmt) and a CMake subproject build with the toolset named; a make-based port (icu) builds with the toolset first on the kept PATH; an MSBuild port (libusb) is refused by name.
  • macOS. The test kit and every deps fixture.

Findings on the way, each fixed here and recorded in the design: the GCC payload driver is not a complete handover (it runs with a sysroot, binutils and a link model only mcpp's command lines carry); a variable_watch callback sees the caller's file, so the MSBuild refusal matches the call stack; the engine's tool_env PATH carries the whole process PATH (Git's msys tools broke icu's configure), so the chain's PATH is the tools' own directories; GCC 16 dropped an instantiation when the compatibility unit imported the toolset module.

The push-triggered CI pins the released mcpp 2026.9.27.1 and stops at the package floor until 2026.9.28.3 is released; the pin moves in this PR then.

…in deps-vcpkg and deps-cmake, and a test kit for plugins (mcpp#734)

- L2, `plugins-core` (renamed from `surface`, which is kept as an alias until
  2027-03-28): `mcpp.plugins.declare`, the new `mcpp.plugins.toolset`, which
  turns the engine's build information into how a toolset reaches a foreign
  build system (`instance`, `chain`, `detected`), and the new
  `mcpp.plugins.fs`, which takes `write_if_changed` and the placement helpers
  from `mcpp.deps`. `plugins-testing` adds `mcpp.plugins.testing`.
- deps-vcpkg builds the ports with the toolset mcpp resolved. A Visual Studio
  instance is selected with VCPKG_VISUAL_STUDIO_PATH and the standard triplet;
  any other toolset is named in a derived triplet `<base>-mcpp-<hash>` whose
  text and chain-loaded toolchain hold no path, with the derived triplet as the
  host triplet and a kept PATH on the MSVC ABI. An MSBuild port under `chain`
  is refused by name. The C runtime follows the program's contract, and a
  project triplet that contradicts it is refused naming both statements.
- deps-cmake: the Visual Studio generator pointed at the instance, or Ninja with
  mcpp's ninja and the named tools; CMAKE_MSVC_RUNTIME_LIBRARY follows the
  program; one build directory per toolset statement.
- Compatibility units under `compat/` (`toolset = detected`, the 0.16.0 names
  in `mcpp::deps`), and a CI check that fails once a unit's date has passed.
- `[package] mcpp = ">=2026.9.28.3"`.
- Tests: `tests/plugin-logic` (14 cases on stated contexts, every host), the C
  runtime leg on the Visual Studio row, and a Windows job with Visual Studio
  masked and the managed toolset: a CMake port, a CMake subproject, a make port
  (icu) and the MSBuild refusal (libusb).
…reads the call stack

- mcpp runs its GCC payload with a sysroot, a binutils directory and a link
  model that only its own command lines carry, so the driver alone is not a
  complete handover: vcpkg's compiler detection failed with it on CI. On that
  row the host compiler's libstdc++ is the program's C++ library, and
  `resolved` answers `detected`, stating why. The clang payloads are complete
  through their `.cfg` files and stay `chain`.
- The MSBuild watch matched the current file, which inside a function is the
  caller's (the portfile), so it never fired; it now matches the helper in the
  call stack, by its own directory and file names (measured with CMake 4.4:
  the helper is refused, a CMake helper's read is not).
…ng the toolset module

With mcpp.plugins.toolset in mcpp.deps' re-export chain, GCC 16 emitted no
vector<string>::push_back(string&&) for a build program that calls
deps::archive::unpack, and its link failed (the Linux archive-consumer row).
…ne's whole PATH

The engine's tool_env PATH is the cl.exe directory followed by the PATH of the
process that ran mcpp. Under Git Bash that carries Git's msys tools and
runtime, and icu's configure, run by vcpkg with that PATH kept, failed with
'invalid variable name: 0'. The toolset's and the SDK's binary directories are
what a foreign system needs, as the design's measurement M3c kept.
…t and the design records refer to the validation project

Two design records named after it are renamed accordingly.
@Sunrisepeak
Sunrisepeak merged commit fd8ed81 into main Sep 28, 2026
0 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants