Skip to content

0.27.0: tools-steps runs step programs with the collection's own runner - #62

Draft
Sunrisepeak wants to merge 4 commits into
mainfrom
eco/steps-program
Draft

Sunrisepeak wants to merge 4 commits into
mainfrom
eco/steps-program

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

The plugin side of mcpp-community/mcpp#955, as design 2026-11-19 §8.4 and §14.2 item 7 state it: a step program is run by steps, a program of this package that the feature tools-steps declares as its tool, instead of cmake -P. mcpp#955 asked the engine to interpret the step operations; mcpp 2026.11.19.1 instead gives a feature's tools to every build program that links the package with the feature active (SPEC-007 R6.3), so the operations remain this package's vocabulary and change with its version.

Changes

  1. The runner and the backend. tools/steps_main.cpp is the kind = "bin" target steps; [features.tools-steps] gains tools = ["steps"]. Its mcpplibs.os dependency sits on [features.steps-runner], which only the runner's own tool build activates (required_features). mcpp::tools::steps::command writes <base>.steps only when its text changes and returns {runner, file}, both declared as inputs; runner() reads mcpp::dep_bin("mcpp.plugins", "steps") and missing_runner() is the refusal text. The CMake backend, runner_spec, cmake_backend::render and the options::cmake of dist-apk and dist-apple are removed.
  2. The step file (mcpp::plugins::steps in the lib root, shared by the writer and the reader): a mcpp-steps 1 line, then one record per operation with every operand and value written as <bytes>:<value>. Nothing is quoted or escaped, so spaces, semicolons, backslashes, quotes, line breaks and non-ASCII text survive on every host.
  3. Semantics. The runner keeps what 0.25.0 and 0.26.0 stated and what their backend, CMake 4 (the only CMake the index offers), decided where the statement was silent: sorted matches spelled from the pattern's directory, names matched without case on Windows and macOS, exclusions compared exactly, no link entered by a recursive glob, copy_tree keeping links, times and permissions, read-only entries removed and replaced, and relative program paths resolved from the working directory. Three details differ, each where CMake altered a value or read a byte as a character: a value holding ; stays one value, a list is empty only when it holds no value, and ? and bracket expressions match one UTF-8 character. docs/tools-steps.md states all of it.
  4. dist-apple refreshes the bundle with the step operation touch instead of /usr/bin/touch. It had no #!/bin/sh action left: 0.25.0 had already turned its framework copy and disk-image staging into step programs.
  5. xim:cmake is removed from dist-apk and dist-apple. deps-cmake and deps-archive keep it, because they run cmake themselves.
  6. 0.27.0, with the package floor mcpp >= 2026.11.19.1 and CI's MCPP_VERSION set to it. README, docs/tools-steps.md, docs/dist-apk.md, docs/dist-apple.md, docs/plugin-development.md (rule 5 and the engine floor), docs/tool-sources.md and tools/README.md describe the runner. The sentences that said the runner would stay cmake "until mcpp runs them itself (#955)" now record how #955 was answered.

Tests

  • tests/steps-consumer (new; Linux job, cross-platform job, llvm lane) runs every operation under a root whose name holds a space, a semicolon and ü. The tree it works on has a link to a directory and read-only files and directories. steps-probe checks 24 properties of the result: argument vectors passed verbatim, list order, exclude, relative_to, if_exists both ways, negated and ranged brackets, the host's case rule, link and permission preservation, copies over read-only files, and read-only removal. check-steps.sh also checks that require on an empty list fails with the member's message, that a program exiting 3 fails the step and is named with its status, and that an unchanged step does not run again.
  • tests/all-rules-compile round-trips a program through the step file, compares it byte for byte with the documented text, and checks that the reader refuses a bad list name, another format and a broken count.
  • The macOS and iOS plan checks pass the runner's path to the build program and assert that every dist-apple step program, the bundle's refresh included, is {runner, file}.

CI before mcpp 2026.11.19.1 exists

Every job fails until mcpp 2026.11.19.1 is released and indexed. The jobs fetch MCPP_BOOTSTRAP (2026.11.7.1), which the new package floor refuses. As the workflow's own comment prescribes, MCPP_BOOTSTRAP and MCPP_EDITOR_VERSION move to 2026.11.19.1 once that release exists. Until then, a dispatch whose mcpp_source_ref names an engine ref that already carries version 2026.11.19.1 measures the branch. The floor is not worked around.

This branch is to be rebased onto 0.26.1, the release that moves the existing mcpplibs.os lines to 0.4.5. The two new lines ([feature-deps.steps-runner] and the fixture's probe) already name 0.4.5.

The runner of a step program is this package's program `steps`
(tools/steps_main.cpp), which the feature tools-steps declares as its tool
(`tools = ["steps"]`): the engine builds it once for the machine that builds
and gives its path to every build program that links mcpp.plugins with the
feature active. `command` writes the program as a step file of counted values
(`mcpp::plugins::steps` in the lib root, shared by the writer and the runner)
and returns `{runner, file}`, both declared as inputs. The cmake -P backend,
`runner_spec` and the `options::cmake` of dist-apk and dist-apple are removed.

The runner keeps the semantics of 0.25.0 and 0.26.0 as CMake 4 implemented
them: matches sorted and spelled from the pattern's directory, names matched
without case on Windows and macOS, no link entered by a recursive glob, a
copied tree keeping links, times and permissions, and read-only entries
removed and replaced. A value that holds `;` stays one value, and a list is
empty only when it holds no value.

tests/steps-consumer runs every operation under a root whose name holds a
space, a semicolon and non-ASCII text, over a link to a directory and
read-only entries, and checks `require` on an empty list, a failing program,
and that an unchanged step does not run again.
The bundle step, the plan's sole terminal artifact, refreshes the bundle
directory's time with the step operation `touch`, run by the runner `steps`,
instead of naming the host program /usr/bin/touch. Every dist-apple plan
therefore resolves the runner, which the feature tools-steps carries wherever
the member is active; the framework copy and the disk-image staging were step
programs already.

The macOS and iOS plan checks hand the build program the runner's path and
assert that the bundle step is a step program whose only operation touches
the bundle.
dist-apk and dist-apple no longer declare xim:cmake: their step programs run
with the collection's runner, which tools-steps carries, so a pack downloads
no CMake. deps-cmake and deps-archive keep it, since each runs cmake itself:
to configure and build a subproject, and as `cmake -E tar` to extract an
archive.

The cross-host dist-apk step says that its javac, d8 and libs steps run
without a shell or xim:cmake.
…be the runner

The package floor is mcpp 2026.11.19.1, the release that gives a feature's
`tools` to every build program that links the package with the feature active
(SPEC-007 R6.3), which is how tools-steps brings its runner; CI's MCPP_VERSION
names it. tools-steps, dist-apk and dist-apple state that floor in the member
table.

docs/tools-steps.md describes the runner, the step file format, the semantics
it keeps from the CMake backend of 0.25.0 and 0.26.0 and the three details in
which it differs, and states that mcpp-community/mcpp#955 was answered by a
feature carrying the package's own program rather than by the engine running
step programs. dist-apk and dist-apple no longer name xim:cmake or
options::cmake; rule 5 of the plugin conventions admits a program of the
plugin's own package that its feature declares as a tool; the tool-sources
table lists the runner.
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.

1 participant