Repository navigation
0.25.0: tools-steps, a member describes a step and a backend runs it - #59
Merged
Merged
Conversation
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.
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.
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*.dexfiles 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-appleran/bin/shscripts, which a Windows host cannot start, anddist-apk0.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)programis a list of portable operations:run,touch,mkdir,remove,remove_glob,copy_file,copy_tree,copy_glob,rename,symlink,globinto a named list,appendandrequire.runcan add a list's values as further arguments.runner_spec(who)andcommand(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.cmake -Puntil 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, onlyrunner_specandcommandchange; no member does.plugins-core, because the general library knows no foreign tool (plugin-development §3).dist-apkanddist-appleimply it.dist-apkDistApk.javais gone.xim:cmakeis declared on request, andoptions::cmakeis new.dist-applesymlinkin place ofln -s), are programs.options::cmakeis new.mcpp.depsis unchanged. Its tool is CMake itself (cmake -Pover a script, and CMake configure and build).tests/all-rules-compilenamestools-stepsand asserts what the backend renders for a program.tests/app-framework-consumer/check-apple-plan.shasserts 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).docs/tools-steps.md; the README,tools/README.md,dist-apk.mdanddist-apple.mdare updated.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.shandcheck-apple-plan.shpass.check-apk-libraries.shpasses criteria 1–4. Criterion 5 cannot reachmaven.google.comfrom this machine.tests/all-rules-compileandtests/app-consumerbuild.dist-apple's steps run end to end only on the macOS row, anddist-apk's on the Windows row, so this PR's CI is their first run.