{"record":{"id":"ce4d195d97a71073","repo":"zellij-org/zellij","slug":"flags-build-and-test-are-mutually-exclusiv","errorCode":null,"errorMessage":"flags '--build' and '--test' are mutually exclusive!","messagePattern":"flags '--build' and '--test' are mutually exclusive!","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"xtask/src/ci.rs","lineNumber":29,"sourceCode":"};\nuse xshell::{cmd, Shell};\n\npub fn main(sh: &Shell, flags: flags::Ci) -> anyhow::Result<()> {\n    let err_context = \"failed to run CI task\";\n\n    match flags.subcommand {\n        CiCmd::E2e(E2e {\n            build: false,\n            test: false,\n            ..\n        }) => Err(anyhow::anyhow!(\n            \"either '--build' or '--test' must be provided!\"\n        )),\n        CiCmd::E2e(E2e {\n            build: true,\n            test: true,\n            ..\n        }) => Err(anyhow::anyhow!(\n            \"flags '--build' and '--test' are mutually exclusive!\"\n        )),\n        CiCmd::E2e(E2e {\n            build: true,\n            test: false,\n            ..\n        }) => e2e_build(sh),\n        CiCmd::E2e(E2e {\n            build: false,\n            test: true,\n            args,\n        }) => e2e_test(sh, args),\n        CiCmd::Cross(Cross { triple, no_web }) => cross_compile(sh, &triple, no_web),\n        CiCmd::BuildRelease(BuildRelease { no_web }) => build_release(sh, no_web),\n    }\n    .context(err_context)\n}\n","sourceCodeStart":11,"sourceCodeEnd":47,"githubUrl":"https://github.com/zellij-org/zellij/blob/98a0837077492d53dd252ab30bc3e43e41e504f4/xtask/src/ci.rs#L11-L47","documentation":"--build and --test select mutually exclusive modes of `ci e2e` (build the E2E binary vs run the tests against it). Supplying both is rejected upfront by the flag-parsing match arms.","triggerScenarios":"Running `cargo xtask ci e2e --build --test`.","commonSituations":"Scripts trying to do build+test in one invocation; stale wrappers assuming a combined flag exists.","solutions":["Split into two invocations: `cargo xtask ci e2e --build && cargo xtask ci e2e --test`","Pass exactly one of the two flags"],"exampleFix":"# before\ncargo xtask ci e2e --build --test\n\n# after\ncargo xtask ci e2e --build && cargo xtask ci e2e --test","handlingStrategy":"validation","validationCode":"if [[ \"$BUILD\" == \"1\" && \"$TEST\" == \"1\" ]]; then\n  echo \"--build and --test are mutually exclusive; run them sequentially\"; exit 2\nfi","typeGuard":"fn e2e_flags_valid(build: bool, test: bool) -> bool {\n    build ^ test\n}","tryCatchPattern":null,"preventionTips":["Encode build-then-test as two sequential commands in CI, not one combined invocation","Keep wrapper scripts honest: derive flags from a single MODE variable"],"tags":["cli","usage","flags","ci","e2e"],"backgroundTag":null,"analyzedSha":"98a0837077492d53dd252ab30bc3e43e41e504f4","analyzedAt":"2026-08-16T13:02:01.396Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}