You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(hooks): ship it experimental — a hook gets no vote on the build
`[hooks]` is marked experimental, and the marking is enforced rather than
written down: `side_effect` now defaults to FALSE, and `side_effect = true` is
REFUSED by the manifest parser.
error: mcpp.toml: error: [hooks].side_effect = true is not available yet:
[hooks] is experimental and cannot decide whether a build succeeded. …
So every hook failure — cannot start, non-zero, timed out, failed to stay up —
is a warning, and `mcpp build` keeps the result it earned on its own.
Refused rather than quietly downgraded, because both silent behaviours are
worse than an error. Honouring `true` would ship an experimental feature with a
veto over every build. Ignoring it would leave a project believing its build is
gated on a notifier when nothing is — which is the "accepted and does nothing"
shape this design already rejects for `loop` on a self-closing event and for
`timeout_seconds` on `during_build`. Making an exception for the one key whose
wrong answer is invisible would be exactly backwards.
The key stays in the schema, so a manifest written today does not have to
change when the feature is promoted, and the mechanism under it already
implements both values: the `sideEffect == true` branch in `mcpp.hooks` is
unreachable today ON PURPOSE. Promotion is the deletion of one block in the
parser, not a reconstruction.
Two further limits are documented as permanent rather than provisional, so they
are not read as part of the experiment: a dependency's `[hooks]` is skipped
always (there is one Span construction and there are two invoke call sites, all
in run_build_with_hooks, all fed from the context's own manifest), and only
`mcpp build` runs hooks.
Criteria: the e2e now asserts BOTH halves — the exit code says the hook had no
vote, and the warning says the failure was not swallowed. Checking only the
exit code would pass just as well if hooks had stopped running altogether. The
timeout and give-up cases flipped from "build fails with error:" to "build
succeeds with warning:", and a negative assertion was rewritten as `if grep`
rather than `grep && { }`, whose exit status under `set -e` is an argument this
file should not be having.
Hook context (MCPP_PROFILE, MCPP_TARGET, …) is deferred; the experimental
window is where that interface can still be named deliberately.
0 commit comments