Skip to content

0.25.0: tools-steps, a member describes a step and a backend runs it - #59

Merged
Sunrisepeak merged 2 commits into
mainfrom
feat/script-actions
Nov 18, 2026
Merged

Sunrisepeak merged 2 commits into
mainfrom
feat/script-actions

Conversation

@Sunrisepeak

@Sunrisepeak Sunrisepeak commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Some steps are more than one command, or need a file set that exists only when they run: javac, then a stamp for outputs no plan can list; d8, which takes no directory; an archive that gains classes*.dex files whose names are known only after d8 has run; emptying a staging directory, copying a bundle into it and creating a link. An action runs one program, with no shell. Each member solved this its own way: dist-apple ran /bin/sh scripts, which a Windows host cannot start, and dist-apk 0.24.0 ran a Java helper (DistApk.java).

This adds one mechanism for it, tools-steps. A member describes the step and a backend runs it.

  • tools-steps (tools/steps.cppm, mcpp.tools.steps)
    • program is a list of portable operations: run, touch, mkdir, remove, remove_glob, copy_file, copy_tree, copy_glob, rename, symlink, glob into a named list, append and require. run can add a list's values as further arguments.
    • Every value is taken verbatim, so a path keeps its spaces, semicolons and backslashes. Members never write the backend's language.
    • runner_spec(who) and command(runner, base, who, program) write the program only when it changes. They return the action's argument vector, and the inputs: the runner and the written program.
    • The backend is cmake -P until the engine runs step programs itself. That is Portable multi-step actions: run a step program in the engine, not through cmake -P or a shell mcpp#955, filed for this, following rule 8. When the engine does it, only runner_spec and command change; no member does.
    • It is an L3 member, not part of plugins-core, because the general library knows no foreign tool (plugin-development §3). dist-apk and dist-apple imply it.
  • dist-apk
    • The javac and kotlinc steps (run, then touch), d8 (glob the classes, require, remove the stale dex, run with the list), libs and the App Bundle's base module are programs. DistApk.java is gone.
    • xim:cmake is declared on request, and options::cmake is new.
    • The runner is resolved after the project's own inputs are checked.
  • dist-apple
    • The framework copy and signature, and the disk-image staging (symlink in place of ln -s), are programs.
    • The runner is asked for only when a plan has one of these steps. options::cmake is new.
  • mcpp.deps is unchanged. Its tool is CMake itself (cmake -P over a script, and CMake configure and build).
  • Tests
    • tests/all-rules-compile names tools-steps and asserts what the backend renders for a program.
    • tests/app-framework-consumer/check-apple-plan.sh asserts that a framework step and the disk-image staging run a program through the runner, declare both as inputs, and copy and sign ad hoc (no signature on the simulator).
  • Conventions: rule 5 names step programs and refuses a shell script as an action's program. New docs/tools-steps.md; the README, tools/README.md, dist-apk.md and dist-apple.md are updated.
  • New code indexes rather than iterating a string. GCC 16.1 cannot inline that in an importer, and the first revision of this PR failed on exactly that.
  • Version 0.25.0.

Measured locally on Linux with mcpp 2026.11.17.1:

  • check-apk-features.sh, check-apk-closure.sh (two ABIs and an App Bundle), check-apk-graph.sh, check-ios-plan.sh and check-apple-plan.sh pass.
  • check-apk-libraries.sh passes criteria 1–4. Criterion 5 cannot reach maven.google.com from this machine.
  • tests/all-rules-compile and tests/app-consumer build.

dist-apple's steps run end to end only on the macOS row, and dist-apk's on the Windows row, so this PR's CI is their first run.

An action whose work is more than one command is cmake -P over a script the
member writes. The deps members did this through helpers private to mcpp.deps,
dist-apk ran a Java helper of its own, and dist-apple ran /bin/sh scripts. The
mechanism is now the member tools-script (mcpp.tools.script): the xim:cmake
spec, bracket arguments, one command as execute_process that fails the script,
and the script written only when it changes and declared with cmake as the
action's inputs. It is an L3 member rather than part of plugins-core because
the general library knows no foreign tool.

mcpp.deps re-exports cmake_spec and bracket under its own names. dist-apk's
javac, kotlinc, d8, libs and base-module steps and dist-apple's framework copy
and disk-image staging are scripts; DistApk.java and the shell helpers are
gone. Both members declare xim:cmake on request and take options::cmake.
Rule 5 of the plugin conventions names the mechanism and refuses a shell
script as an action's program.
The previous revision of this change made the mechanism CMake's: members
wrote CMake script text. A step of more than one command is now a program of
portable operations (run, touch, mkdir, remove, copy, rename, symlink, glob
into a list, append, require) that a member builds, and mcpp.tools.steps
runs it through a backend. The backend is cmake -P until the engine runs
step programs itself (mcpp-community/mcpp#955); runner_spec and command are
the only functions that change then. Values are taken verbatim, and a list
built when the step runs follows a command's own arguments.

mcpp.deps is unchanged: its tool is CMake itself. dist-apk and dist-apple
describe their steps as programs; dist-apple's plan check asserts the
runner, the program as an input, and the program's copy and signature.
Loops in the new code index rather than iterate a string, which GCC 16.1
cannot inline in an importer.
@Sunrisepeak Sunrisepeak changed the title 0.25.0: tools-script, one mechanism for a step of more than one command 0.25.0: tools-steps, a member describes a step and a backend runs it Nov 18, 2026
@Sunrisepeak
Sunrisepeak merged commit 836fd45 into main Nov 18, 2026
6 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.

1 participant