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
{{ message }}
Repository navigation
A repeated -p keeps only the last value: mcpp test -p a -p b tests b alone, and says nothing #750
-p/--package selects one workspace member. When it is given twice, the first value is dropped without a word: mcpp test -p a -p b builds and tests only b, and mcpp build -p a -p b builds only b. The exit status is 0 and the summary line counts only b's tests, so a script or CI step that lists members this way looks as if it tested both.
The cause is in the argument parser rather than in mcpp itself. -p is declared with takes_value() and without multiple() on build, run, test, pack and emit build-database (cli.cppm L390, L436, L538, L660, L707), and the selection it feeds is a single string (prepare.cppm L635). In mcpplibs.cmdline 0.0.1, an option without multiple() that appears again simply replaces the value it had (cmdline.cppm L206-L207). That holds for every single-valued option, --profile included, but -p is the one where repeating it reads like a reasonable request.
Either of two behaviors would be fine: accept several -p values and act on each named member, the way --workspace acts on all of them, or refuse a repeated -p with an error that mentions --workspace. Keeping the last value silently is the one outcome that hides the mistake.
Reproduction
mcpp 2026.9.30.1, llvm@22.1.8, Linux x86_64 (host target). The declarations above are unchanged at main (8e00a18, 2026.9.30.2).
mcpp.toml:
[workspace]
members = ["a", "b"]
[toolchain]
default = "llvm@22.1.8"
a/mcpp.toml (b is the same with b in place of a, here and in the two files below):
[package]
name = "a"version = "0.1.0"
[targets.a]
kind = "lib"
$ mcpp test -p a -p b
Workspace building member 'b'
Resolving toolchain
Resolved llvm@22.1.8 → @mcpp/registry/data/xpkgs/xim-x-llvm/22.1.8/bin/clang++
Target x86_64-unknown-linux-gnu
Compiling workspace v0.0.0 (.)
Compiling b (path)
Compiling b v0.1.0 (b)
Compiling test_b (test)
Running bin/test_b
test_b ... ok (0.02s)
test result ok. 1 passed; 0 failed; finished in 0.39s (build 0.20s + run 0.02s)
The exit status is 0. Swapping the order, mcpp test -p b -p a tests only a, and mcpp build -p a -p b builds only b.
Activity
2026.10.1.1: member selection, build programs prepared once, a pack o…