refactor(core/bundle): invert runner -> cli direction#154
Merged
Conversation
Add installAll, tapAdd, servicesStart entry points that take (allocator, name|packages, opts) instead of argv. The argv-taking execute functions stay as the interactive CLI path; these primitives are the seam for core/bundle to call into without argv synthesis.
runner.zig drops its cli/install, cli/tap, cli/services imports and routes each member through an injected Dispatcher vtable (supplied by cli/bundle.zig's default wiring). Bundle tests no longer drag the full CLI into their link. New RunnerError.NoDispatcher guards the in-process path when neither a dispatcher nor malt_bin is supplied.
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.
Description
Invert the
core/bundle/runner.zig -> cli/*direction. The runner now routes each bundle member through an injectedDispatcher(function-pointer vtable withinstallFormula/installCask/tapAdd/serviceStart). The CLI layer (cli/bundle.zig) supplies a default dispatcher that forwards to new non-argv primitives incli/install.zig::installAll,cli/tap.zig::tapAdd,cli/services.zig::servicesStart. The argv-takingexecutefunctions stay put as the interactive CLI entry point.Related Issue
Notes for Reviewers
RunnerError.NoDispatcheris raised when the runner is invokedin-process without a dispatcher and without
malt_bin; existing testseither use
dry_runormalt_bin = "/usr/bin/false"so they don't hitthis path.
cli/bundle.zig::cmdInstallalways supplies the default.