Skip to content
This repository was archived by the owner on Nov 3, 2026. It is now read-only.

fix: pass every meta cargo command through to cargo - #15

Merged
gold-silver-copper merged 4 commits into
mainfrom
fix/cargo-passthrough
Oct 25, 2026
Merged

gold-silver-copper merged 4 commits into
mainfrom
fix/cargo-passthrough

Conversation

@gold-silver-copper

@gold-silver-copper gold-silver-copper commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

What and why

meta-rust advertised only cargo build, cargo test, rust build, rust test. meta_cli sends any meta cargo … to it (it matches on the first word), and the plugin answered everything else with its help. So meta cargo fmt, meta cargo clippy, meta cargo --version, meta cargo update printed help instead of running. Many people have meta-rust installed from earlier make installs, so this has to just work once they update.

Now meta cargo <any cargo args> runs cargo <args> in each selected repo that has a Cargo.toml:

$ meta cargo --version                     # before: plugin help
meta-rust: skipping ., docs (no Cargo.toml)

✓ ./rusty:
cargo 1.99.0 (5f94df478 2026-08-27)

1 commands complete

Changes, all in src/lib.rs / src/main.rs:

  • Passthrough. The plugin advertises one command, cargo, and plans cargo <args> for any args. Bare meta cargo and any --help/-h show the plugin help without running anything, as before (keeps the side-effect-free help from 1f62fc2). meta_cli sends help requests without the repo list, so passing --help on to cargo could not reach each repo anyway.
  • Skips are visible. Repos without a Cargo.toml are listed on stderr (meta-rust: skipping docs (no Cargo.toml)); --silent hides it.
  • Args are shell-quoted on Unix (shlex). Plans run through $SHELL -c, so --features "a b" used to split. On Windows loop_lib runs plans with cmd.exe /c, which has no POSIX quoting, so args are joined as given, exactly as before.
  • The meta root no longer runs twice. meta_cli already puts the meta root first in projects; the plugin added . again, so a Rust meta root ran twice. It now uses projects as given (or . when empty, which only happens outside a real run).
  • Every selected Rust repo runs, workspace members included. When one repo is the root of a Cargo workspace whose members are other selected repos (like this repo's parent gitkb/meta), cargo runs in the root and in each member. Skipping the members would be wrong for commands that depend on the current package (run, add, install --path ., third-party subcommands). To run such a workspace once, use plain cargo in its root; the help says so.
  • Help is truthful: usage meta cargo <cargo args>, examples that work, a note on what is skipped and on workspaces.
  • Removed: the rust build / rust test aliases (meta cargo … is the one command; pre-release, no shim), the dead get_help_text, a test that only tested meta_plugin_protocol serialization, and the now-unused meta_core, anyhow and serde_json deps.

Help, before → after:

# before                                  # after
meta cargo <command> [args...]            meta cargo <cargo args>
       meta rust <command> [args...]
Commands:                                 Commands:
  build  Build all Rust projects…           cargo  Run cargo with your args in each
  test   Run tests across all…                     selected repo that has a Cargo.toml

How it was verified

  • cargo test -p meta_rust_cli, cargo clippy -p meta_rust_cli --all-targets -- -D warnings, cargo fmt --check. Three tests: an arbitrary subcommand (fmt --check -- --config 'a b') plans cargo … only in the Rust repo, quoted, with non-Rust repos skipped; and a workspace root and its member both get cargo run, while --include member plans only the member; and bare args or any --help give the plugin help. The quoting assertion expects 'a b' on Unix and the plain join on Windows; CI runs both.
  • Live, with meta built from meta_cli main and this plugin, both installed into a throwaway CARGO_INSTALL_ROOT first on PATH (the real install untouched), in a scratch meta repo with one Rust and one non-Rust repo:
    • meta cargo --version → runs in rusty, skips . and docs, exit 0.
    • meta cargo fmt --check → passes, exit 0; after unformatting rusty/src/lib.rs it shows the diff and exits 1.
    • meta --dry-run cargo build --features 'a b' → cargo build --features 'a b' in rusty only.
    • meta --include docs cargo --version, meta --exclude rusty cargo check → "No Rust projects found".
    • meta cargo, meta cargo --help, meta cargo build --help → plugin help, nothing runs. meta --help lists cargo with its real description.
    • In the gitkb/meta workspace: meta --primary --dry-run cargo fmt --check plans 11 runs (root + 10 member repos), skipping agent and meta-plugins (no Cargo.toml).

Look closely at

  • The plugin applies include/exclude itself (a copy of loop_lib's substring rule) so the skip note and "No Rust projects found" talk only about selected repos. loop_lib still filters the plan afterwards, so nothing can run outside the selection, but if the two rules drift apart the plugin could show wrong notes or drop a repo loop_lib would have run. They match today.
  • Windows keeps the old plain join: an arg with spaces is still split there. Quoting for cmd.exe belongs with loop_lib, which picks the shell; not changed here.
  • meta rust build / meta rust test now give meta's "unrecognized command" error.
  • meta_cli strips --json, --verbose, --silent, --recursive, --strict, --primary anywhere on the line before the plugin sees it (extract_global_flags), so meta cargo build --verbose sets meta's verbose, not cargo's. Not changed here.
  • The root gitkb/meta Cargo.lock needs the dep change (shlex in; meta_core, anyhow, serde_json out); on-child-update.yml carries that over after merge.

Related

meta-rust only handled cargo build/test and answered everything else
(fmt, clippy, --version, ...) with its help. It now runs cargo with the
given args in each selected repo that has a Cargo.toml, skips the others
with a note, quotes args for the shell, stops running the meta root twice,
and runs a Cargo workspace once from its root instead of again in each
member repo. The rust build/test aliases are gone; meta cargo is the one
command.

Implements [[tasks/harmony-2746]]
Skipping members of a workspace rooted at another selected repo is wrong
for commands that depend on the current package (run, add, install
--path ., third-party subcommands). Drop it; plain cargo in the root runs
a cross-repo workspace once.

Implements [[tasks/harmony-2746]]
@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 99ed7eba-717c-4835-a79c-7fb6ec60b4d4
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

Implements [[tasks/harmony-2746]]
gold-silver-copper added a commit to gitkb/meta-archive that referenced this pull request Oct 24, 2026
meta exec runs commands as typed (gitkb/meta_cli#39); meta cargo passes
any cargo command through (gitkb/meta_rust_cli#15). Skill copies come
from meta_cli via make skills; Cargo.lock follows meta_rust_cli's deps.

Implements [[tasks/harmony-2743]]
cmd.exe has no POSIX quoting, so shlex quoting broke args like
--features=foo,bar there; Windows keeps the plain join. meta_cli sends
help requests without the repo list, so any --help/-h shows the plugin
help again instead of running cargo in the current directory only.

Implements [[tasks/harmony-2746]]
gold-silver-copper added a commit to gitkb/meta_cli that referenced this pull request Oct 24, 2026
Matches gitkb/meta_rust_cli#15, which drops meta rust build/test. Also
covers the reported cargo --version shape in the routing test.

Implements [[tasks/harmony-2745]]
@gold-silver-copper
gold-silver-copper merged commit 35eac6e into main Oct 25, 2026
7 checks passed
gold-silver-copper added a commit to gitkb/meta_cli that referenced this pull request Oct 25, 2026
fix(exec): run commands as typed, never through a plugin

`meta exec -- cargo --version` printed meta-rust's help instead of running
cargo: exec offered every command to plugins first, and a plugin claiming
`cargo build` also took every other `cargo ...` command by its first word.

`meta exec` now always runs the command in each repo. Plugins are only
consulted for `meta <command>`, matched on whole argv words: the longest
claimed command wins, otherwise the plugin owning the first word gets the
whole command and handles subcommands it does not implement. The unused
`handles_command` copy of the old matching is gone.

Implements [[tasks/harmony-2745]]

test(plugins): show namespace fallback takes the whole command

Implements [[tasks/harmony-2745]]

docs(skills): meta-rust runs any meta cargo command

Matches gitkb/meta_rust_cli#15, which drops meta rust build/test. Also
covers the reported cargo --version shape in the routing test.

Implements [[tasks/harmony-2745]]

docs(exec): point git users at meta git; drop tests of removed logic

meta exec -- git runs plain git, without meta-git's no-prompt env, so the
exec help no longer uses git fetch as its example and the skill says so.
Six plugin_git tests only re-ran copies of the old clone detection and
arg splitting inline; route and plugin_routing cover the real code.

Implements [[tasks/harmony-2745]]
gold-silver-copper added a commit to gitkb/meta-archive that referenced this pull request Oct 25, 2026
#110)

fix(build): make install overwrites untracked binaries; drop meta-rust

cargo install --path always rebuilds, so --force only changes the case
where a binary cargo doesn't track (a release download) is in the way.
meta-rust leaves make install to match what releases ship.

Implements [[tasks/harmony-2743]]

fix(build): make uninstall still removes meta-rust

Earlier make installs put meta-rust in ~/.cargo/bin; leaving it there
keeps breaking meta exec -- cargo commands other than build and test.

Implements [[tasks/harmony-2743]]

docs(readme): meta-rust is optional; name both install script dirs

Implements [[tasks/harmony-2743]]

fix(build): install and ship meta-rust again

make install keeps installing meta-rust, and releases now ship it too
(archives, Homebrew, install scripts), so every install path agrees.

Implements [[tasks/harmony-2743]]

docs: describe meta exec and meta cargo as the sibling PRs ship them

meta exec runs commands as typed (gitkb/meta_cli#39); meta cargo passes
any cargo command through (gitkb/meta_rust_cli#15). Skill copies come
from meta_cli via make skills; Cargo.lock follows meta_rust_cli's deps.

Implements [[tasks/harmony-2743]]

test(help): cargo help as meta_rust_cli#15 ships it

Implements [[tasks/harmony-2743]]

docs(skills): sync meta-plugins skill from meta_cli#39

Implements [[tasks/harmony-2743]]

docs: README routing matches meta_cli#39; bump the Claude plugin for …

…its skill changes

Implements [[tasks/harmony-2743]]

docs(skills): sync meta-exec skill from meta_cli#39

Implements [[tasks/harmony-2743]]

docs(architecture): meta exec -- git is plain git; use meta git

Implements [[tasks/harmony-2743]]
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant