Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/scripts/check-toolchain-lanes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ llvm_full=(
"island-interface|^all ok"
"archive-consumer|^archive-consumer: 'greetings from the archive'"
"spirv-module-consumer|^all ok"
"steps-consumer|^steps-consumer ok"
)
llvm_configure_only=(qt-consumer qt-widgets-consumer qt-sdk-consumer qt-import-only)

Expand Down
38 changes: 34 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,15 @@ env:
# older engine, and docs/deps.md states the requirement where cross builds
# are described. So here, as for 0.20.0's SYCL lane, `MCPP_VERSION` is the
# newest engine a lane needs and the floor the oldest the collection loads on.
MCPP_VERSION: 2026.11.7.1
#
# 2026.11.19.1 IS WHAT 0.27.0 NEEDS, and the package floor states it
# (mcpp#955, SPEC-007 R6.3): a feature's `tools` reaches every build program
# that links this package with the feature active, which is how
# `tools-steps` brings its runner `steps` to `dist-apk`, `dist-apple` and
# tests/steps-consumer. Until that release exists the jobs fetch
# `MCPP_BOOTSTRAP`, which the floor refuses, unless `mcpp_source_ref` names
# the engine to build.
MCPP_VERSION: 2026.11.19.1
# THE RELEASE EVERY JOB FETCHES, WHICH IS NOT ALWAYS THE ONE UNDER TEST.
#
# `MCPP_VERSION` states the engine this collection's lanes need -- the package
Expand Down Expand Up @@ -1197,6 +1205,18 @@ jobs:
done
echo "ok: N inputs, one header, one table"

# tools-steps (0.27.0): every operation of a step program, run by the
# collection's own runner `steps`, which the feature carries to the build
# program, under a root whose name holds a space, a semicolon and a
# non-ASCII character, over a link to a directory and read-only entries;
# `require` on an empty list and a program that exits 3, each failing the
# step by name; and an unchanged step not run again.
# The fixture declares no `xim:cmake`, so nothing but the runner can run
# the steps.
- name: tools-steps runs every operation with the collection's own runner
working-directory: tests/steps-consumer
run: MCPP="$MCPP" bash check-steps.sh

# ── dist: what comes out of the LINK ────────────────────────────────
#
# Every step above asserts what reaches a COMPILE. These assert what
Expand Down Expand Up @@ -2246,6 +2266,15 @@ jobs:
fi
echo "ok: the boundary is generated and namespaced on this host"

# The step programs on this host (0.27.0), with the Linux job's criteria:
# the runner starts each program with no shell, so its arguments arrive
# as the member wrote them on Windows too, and its names reach the file
# system in UTF-8.
- name: tools-steps runs every operation with the collection's own runner on this host
if: ${{ !cancelled() }}
working-directory: tests/steps-consumer
run: MCPP="$MCPP" bash check-steps.sh

# ── dist, on the platform each member serves ────────────────────────
#
# A PLAN-LEVEL ASSERTION IS NOT A MEASUREMENT. `plan_for()` returning
Expand Down Expand Up @@ -2605,12 +2634,13 @@ jobs:
# dist-apk ON A HOST THAT IS NOT LINUX (0.24.0). Every tool the member
# runs is a native program (`aapt2`, `zipalign`) or a jar on the JDK's
# `java`, and each step of more than one command is a step program
# (0.25.0, `tools-steps`), so no step needs a shell and a Windows host
# (0.25.0, `tools-steps`), run from 0.27.0 by the collection's own
# runner, so no step needs a shell or `xim:cmake` and a Windows host
# packs what a Linux host does. On Windows the NDK's
# libc++ module sources come from `xim:android-ndk-libcxx-modules`,
# which `xim:android-ndk`'s windows entry depends on. The criteria are the
# level-0 step's on the Linux job, plus a level-1 package whose dex holds
# the activity: that is the javac, d8 and libs scripts all having run.
# the activity: that is the javac, d8 and libs steps all having run.
- name: dist-apk packs a signed APK on this host, level 0 and level 1
if: ${{ !cancelled() }}
working-directory: tests/apk-consumer
Expand Down Expand Up @@ -2653,7 +2683,7 @@ jobs:
grep -q "org.mcpp.apkconsumer.$c;" dexdump.log \
|| { echo "FAIL: the dex does not hold org.mcpp.apkconsumer.$c"; exit 1; }
done
echo "ok: level 1 -- the javac, d8 and libs scripts ran on this host, and the dex holds the activity and the generated class"
echo "ok: level 1 -- the javac, d8 and libs steps ran on this host, and the dex holds the activity and the generated class"

- name: the rule declared its own compiler
working-directory: tests/spirv-consumer
Expand Down
31 changes: 18 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module name the member declares, and configures it there.

```toml
[build-dependencies.mcpp]
plugins = { version = "0.26.0", features = ["rules-spirv"], host-module = true }
plugins = { version = "0.27.0", features = ["rules-spirv"], host-module = true }
```

```cpp
Expand Down Expand Up @@ -51,13 +51,15 @@ naming it to avoid a download, and the scenarios on both sides -- is in

## Members

From 0.21.0 the package as a whole needs mcpp 2026.10.30.1 (`[package] mcpp`),
which writes the configuration's contract that `deps-cmake` compiles a cross
build from (0.20.0 needed 2026.10.27.1, whose protocol 17 states a platform's
fields and whose `mcpp pack` writes `mcpp-package.json` beside every staged
tree; 0.19.0 needed 2026.10.1.3, whose
protocol 15 states where each tool and payload comes from); the column states
the release each member's behaviour first needed.
From 0.27.0 the package as a whole needs mcpp 2026.11.19.1 (`[package] mcpp`),
which gives a feature's tool to every build program that links the package with
the feature active, the way `tools-steps` brings its runner (0.21.0 needed
2026.10.30.1, which writes the configuration's contract that `deps-cmake`
compiles a cross build from; 0.20.0 needed 2026.10.27.1, whose protocol 17
states a platform's fields and whose `mcpp pack` writes `mcpp-package.json`
beside every staged tree; 0.19.0 needed 2026.10.1.3, whose protocol 15 states
where each tool and payload comes from); the column states the release each
member's behaviour first needed.

Cross CMake subprojects that link executables or shared libraries require
mcpp 2026.11.7.1 or later; cross configuration requires CMake 3.19 or later.
Expand All @@ -75,14 +77,14 @@ mcpp 2026.11.7.1 or later; cross configuration requires CMake 3.19 or later.
| `rules-sycl` | `mcpp.rules.sycl` | 2026.10.1.3 | Compiles SYCL (`*.sycl`) with DPC++. | [rules](docs/rules.md#rules-sycl) |
| `tools-embed` | `mcpp.tools.embed` | 2026.9.5.4 | Writes a data file into a header the program compiles in. | [tools-embed](docs/tools-embed.md) |
| `tools-island` | `mcpp.tools.island` | 2026.9.7.1 | Generates the `extern "C"` boundary and the C++ module of a code island. | [tools-island](docs/tools-island.md) |
| `tools-steps` | `mcpp.tools.steps` | 2026.10.1.3 | Describes an action whose work is more than one command as portable operations a backend runs; implied by `dist-apk` and `dist-apple`. | [tools-steps](docs/tools-steps.md) |
| `tools-steps` | `mcpp.tools.steps` | 2026.11.19.1 | Describes an action whose work is more than one command as portable operations, which `steps`, the collection's own runner, performs; implied by `dist-apk` and `dist-apple`. | [tools-steps](docs/tools-steps.md) |
| `dist-appimage` | `mcpp.dist.appimage` | 2026.10.1.3 | Turns the tree `mcpp pack` stages into an AppImage (Linux). | [dist](docs/dist.md#dist-appimage) |
| `dist-deb` | `mcpp.dist.deb` | 2026.10.30.1 | Installs the staged tree under `/opt/<name>` with a launcher, a desktop entry and an icon, as a Debian package (Linux targets). | [dist](docs/dist.md#dist-deb-and-dist-rpm) |
| `dist-rpm` | `mcpp.dist.rpm` | 2026.10.30.1 | The same installation as an RPM package (Linux targets). | [dist](docs/dist.md#dist-deb-and-dist-rpm) |
| `dist-wix` | `mcpp.dist.wix` | 2026.10.1.3 | Builds an MSI of the staged tree, and a Burn bundle chaining it (Windows). | [dist](docs/dist.md#dist-wix) |
| `dist-apple` | `mcpp.dist.apple` | 2026.9.14.2 | Lays out a macOS or iOS application bundle, signs it and writes a disk image. | [dist-apple](docs/dist-apple.md) |
| `dist-apple` | `mcpp.dist.apple` | 2026.11.19.1 | Lays out a macOS or iOS application bundle, signs it and writes a disk image. | [dist-apple](docs/dist-apple.md) |
| `dist-web` | `mcpp.dist.web` | 2026.9.13.1 | Copies a `wasm32-emscripten` program and its files into a web directory with an `index.html`. | [dist](docs/dist.md#dist-web) |
| `dist-apk` | `mcpp.dist.apk` | 2026.10.1.3 | Packs the native closure into a signed APK or App Bundle, with Java, Kotlin and Maven libraries. | [dist-apk](docs/dist-apk.md) |
| `dist-apk` | `mcpp.dist.apk` | 2026.11.19.1 | Packs the native closure into a signed APK or App Bundle, with Java, Kotlin and Maven libraries. | [dist-apk](docs/dist-apk.md) |
| `deps-vcpkg` | `mcpp.deps.vcpkg` | 2026.10.1.3 | Installs a `vcpkg.json` manifest as an action with the toolset mcpp resolved, and maps the prefix into the build. | [deps](docs/deps.md#deps-vcpkg) |
| `deps-cmake` | `mcpp.deps.cmake` | 2026.10.1.3; a cross build 2026.10.30.1 | Builds and installs a CMake subproject as an action with Ninja and the toolset mcpp resolved -- for another target, the compilers and words of the engine's contract -- keeps the installation for any build with the same key, and maps the prefix into the build. | [deps](docs/deps.md#deps-cmake) |
| `deps-archive` | `mcpp.deps.archive` | 2026.10.1.3 | Extracts a zip archive the project keeps and places its tree beside the program. | [deps](docs/deps.md#deps-archive) |
Expand Down Expand Up @@ -118,8 +120,9 @@ declaration (0.15.0 removed `rules-qt-xim*`; see [rules-qt](docs/rules-qt.md)).
```
mcpp.toml the package: one feature per member
src/plugins.cppm export module mcpp.plugins; the version, mcpp::plugins::surface
(the declarations a consumer names), mcpp::plugins::xml and
mcpp::plugins::package (a staged package's metadata)
(the declarations a consumer names), mcpp::plugins::xml,
mcpp::plugins::package (a staged package's metadata) and
mcpp::plugins::steps (the step file the runner reads)
src/declare.cppm, the general library for build programs (`plugins-core`):
src/toolset.cppm, mcpp.plugins.declare, mcpp.plugins.toolset, mcpp.plugins.fs
src/fs.cppm
Expand All @@ -129,6 +132,8 @@ src/compat/, deps/compat/
compatibility units, each retired on the date its header states
rules/<x>.cppm export module mcpp.rules.<x>;
tools/<x>.cppm export module mcpp.tools.<x>;
tools/<x>_main.cpp the package's programs: `steps`, the runner `tools-steps`
carries, and `mcpp-embed`
dist/<x>.cppm export module mcpp.dist.<x>;
deps/<x>.cppm export module mcpp.deps.<x>; deps/deps.cppm is shared
tests/<consumer>/ one project per member, built by CI with the pinned mcpp
Expand Down
24 changes: 6 additions & 18 deletions dist/apk.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,6 @@ struct options {
// `platform` is a root carrying `android.jar`; `keystore_package` above
// stays the way a keystore package is named.
mcpp::plugins::tool::choice build_tools, platform, jdk, bundletool_dir, kotlin, coursier;
// The runner of the steps of more than one command (0.25.0,
// `mcpp.tools.steps`; `cmake` until mcpp#955): the `xim:cmake` payload,
// asked for when a package is planned, or a program named here.
mcpp::plugins::tool::choice cmake;
std::string keystore_alias;
// The NAME of an environment variable `apksigner` itself reads
// (`--ks-pass env:<NAME>`) -- this member never reads the secret; only
Expand Down Expand Up @@ -2271,21 +2267,13 @@ inline plan plan_for(options opt = {}) {
// runs; the linked archive gains the native libraries, the assets and every
// `classes*.dex` d8 wrote; an App Bundle's base module is the linked archive
// laid out as bundletool reads it. Each is a step program
// (`mcpp.tools.steps`): this member describes it, and its runner runs it,
// so no step needs a shell on any host and the runner and the written
// program are inputs of the step.
// (`mcpp.tools.steps`): this member describes it, and the runner `steps`,
// this package's program, runs it (0.27.0), so no step needs a shell on any
// host and the runner and the written program are inputs of the step.
namespace steps = mcpp::tools::steps;
// Resolved here, once the project's own inputs have been checked, so a
// refusal about them is not hidden behind a tool that is still to come.
const auto runnerSpec = steps::runner_spec("mcpp.dist.apk");
const auto runnerTool = mcpp::plugins::tool::resolve(runnerSpec, opt.cmake);
if (runnerTool.pending()) return refuse(p, "cmake requested", {});
if (!runnerTool) {
return refuse(p, "cmake not found",
mcpp::plugins::tool::describe_missing(runnerSpec, runnerTool)
+ "\n So this plan packs nothing.");
}
const std::string runner = runnerTool.program;
const std::string runner = steps::runner();
if (runner.empty())
return refuse(p, "no step runner", steps::missing_runner("mcpp.dist.apk") + "\n So this plan packs nothing.");
const auto attach = [&](step& s, std::string_view name, const steps::program& program) {
const auto how = steps::command(runner, outDir / "steps" / std::string(name), "mcpp.dist.apk", program);
s.argv = how.argv;
Expand Down
51 changes: 19 additions & 32 deletions dist/apple.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ export module mcpp.dist.apple;
import std;
import mcpp;
import mcpp.plugins;
import mcpp.plugins.tool;
import mcpp.tools.steps;

// Nothing here uses `std::println`, and that is not a style choice: both of
Expand Down Expand Up @@ -337,12 +336,6 @@ struct options {
std::string volume_name;
std::string dmg;

// The runner of the steps of more than one command (0.25.0,
// `mcpp.tools.steps`; `cmake` until mcpp#955): the `xim:cmake` payload,
// asked for only when a plan copies a framework or stages a disk image,
// or a program named here.
mcpp::plugins::tool::choice cmake;

std::string out_dir = std::string(mcpp::out_dir());
};

Expand Down Expand Up @@ -432,11 +425,11 @@ inline plan& refuse(plan& p, std::string reason, const std::string& message) {
return p;
}

// A step of more than one command (0.25.0): a step program
// (`mcpp.tools.steps`) written into `<out_dir>/dist-apple/steps/`, so no step
// is a shell script. The runner and the written program join the step's inputs.
// `name` is used as a file name; anything but letters, digits, `-` and `.`
// becomes `_`.
// A step whose work is file operations, alone or around commands (0.25.0; the
// bundle's refresh from 0.27.0): a step program (`mcpp.tools.steps`) written
// into `<out_dir>/dist-apple/steps/`, so no step is a shell script. The runner
// and the written program join the step's inputs. `name` is used as a file
// name; anything but letters, digits, `-` and `.` becomes `_`.
inline void attach(step& s, const std::string& runner, const std::string& out_dir,
const std::string& name, const mcpp::tools::steps::program& program) {
std::string file = name;
Expand Down Expand Up @@ -1307,22 +1300,14 @@ inline plan plan_for(options opt = {}) {
}
}

// `cmake` runs the steps of more than one command (0.25.0): a framework's
// copy and signature, and a disk image's staging. Asked for only when the
// plan has one.
// The runner `steps`, this package's program (0.27.0), runs the step
// programs: a framework's copy and signature, a disk image's staging, and
// the bundle's refresh, which every plan has. The feature that carries the
// runner is active wherever this member is, so asking costs nothing.
namespace steps = mcpp::tools::steps;
std::string runner;
if (!frameworks.empty() || dmg) {
const auto runnerSpec = steps::runner_spec("mcpp.dist.apple");
const auto runnerTool = mcpp::plugins::tool::resolve(runnerSpec, opt.cmake);
if (runnerTool.pending()) { p.reason = "cmake requested"; return p; }
if (!runnerTool) {
return refuse(p, "cmake not found",
mcpp::plugins::tool::describe_missing(runnerSpec, runnerTool)
+ "\n So this plan bundles nothing.");
}
runner = runnerTool.program;
}
const std::string runner = steps::runner();
if (runner.empty())
return refuse(p, "no step runner", steps::missing_runner("mcpp.dist.apple") + "\n So this plan bundles nothing.");

// THE FRAMEWORKS: each copied from the staged tree and, when the bundle is
// signed, signed before the bundle is -- a bundle signature seals nested
Expand Down Expand Up @@ -1454,16 +1439,18 @@ inline plan plan_for(options opt = {}) {
// stamp included, when it ran, so the bundle is not the terminal until
// signing (the last thing that can still fail) has happened. A directory
// is an acceptable action output (the engine verifies `is_regular_file
// || is_directory`); `touch` has nothing to write, only a mtime to
// || is_directory`); the step has nothing to write, only a mtime to
// refresh, and refreshing it is what makes ninja record the edge as run
// rather than replay a stale one.
// rather than replay a stale one. The refresh is the step operation
// `touch` (0.27.0) rather than `/usr/bin/touch`: an operation the
// collection performs itself needs no program at a fixed place on the host.
step bundle;
bundle.id = "mcpp.dist.apple.bundle";
bundle.role = "artifact";
bundle.description = "APP BUNDLE";
bundle.argv = { "/usr/bin/touch", bundlePath };
bundle.inputs = assembled;
bundle.outputs = { bundlePath };
bundle.inputs = assembled;
attach(bundle, runner, opt.out_dir, "bundle", steps::program{}.touch(bundlePath));
bundle.outputs = { bundlePath };
p.steps.push_back(bundle);

// `--format dmg`: the bundle beside an `Applications` link, then the image.
Expand Down
Loading