Skip to content

Fix failing CI: cargo bin target selection, rustfmt, and clippy#302

Merged
hyzyla merged 4 commits into
mainfrom
claude/pipeline-failures-gnj3lv
Jul 6, 2026
Merged

Fix failing CI: cargo bin target selection, rustfmt, and clippy#302
hyzyla merged 4 commits into
mainfrom
claude/pipeline-failures-gnj3lv

Conversation

@hyzyla

@hyzyla hyzyla commented Jul 5, 2026

Copy link
Copy Markdown
Collaborator

The Rust CI pipelines were all red for two independent reasons:

  • cli-smoke, catalyst-oracle and xcode-tests run cargo build --bin sweetpad
    from working-directory: sweetpad-lib. After the workspace split the
    sweetpad binary lives in the sweetpad-cli package, so cargo scopes
    --bin to the current member (sweetpad-lib) and fails with
    "no bin target named sweetpad in default-run packages". Select the
    package explicitly with -p sweetpad-cli.

  • The sweetpad-lib job failed at cargo fmt --all --check; reformat the tree
    so it is rustfmt-clean. With formatting fixed the job now reaches
    cargo clippy -D warnings, which surfaced four pre-existing lints:

    • app.rs plan: allow too_many_lines (matches build_context.rs precedent)
    • mod.rs: terminate the NDJSON println! arm with a semicolon
    • state.rs: hoist the SAVE_SEQ static above the statements in save
    • adversarial_inputs.rs: use BTreeMap::default() instead of Default::default()

fmt, clippy and cargo test --workspace all pass locally.

Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01Y2qAHe2kPbo3Q8ZCXzvJxh

claude added 4 commits July 5, 2026 21:52
The Rust CI pipelines were all red for two independent reasons:

- cli-smoke, catalyst-oracle and xcode-tests run `cargo build --bin sweetpad`
  from `working-directory: sweetpad-lib`. After the workspace split the
  `sweetpad` binary lives in the `sweetpad-cli` package, so cargo scopes
  `--bin` to the current member (sweetpad-lib) and fails with
  "no bin target named `sweetpad` in default-run packages". Select the
  package explicitly with `-p sweetpad-cli`.

- The sweetpad-lib job failed at `cargo fmt --all --check`; reformat the tree
  so it is rustfmt-clean. With formatting fixed the job now reaches
  `cargo clippy -D warnings`, which surfaced four pre-existing lints:
  - app.rs `plan`: allow `too_many_lines` (matches build_context.rs precedent)
  - mod.rs: terminate the NDJSON `println!` arm with a semicolon
  - state.rs: hoist the `SAVE_SEQ` static above the statements in `save`
  - adversarial_inputs.rs: use `BTreeMap::default()` instead of `Default::default()`

fmt, clippy and `cargo test --workspace` all pass locally.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y2qAHe2kPbo3Q8ZCXzvJxh
With the build-target fix in place, the macOS jobs now reach the CLI e2e
scripts, which parsed `--json` output at the top level and died with
`KeyError` (summary / targets / destinations). Every `--json` result is the
standardized `{schema, ok, data}` success envelope (output.rs::json_value —
"the single success-envelope site"); the scripts predate it and were never
exercised because the earlier `cargo build` step always failed first.

Read fields through the `data` payload:
- smoke.sh: unwrap once in the `assert_json` helper (all field expressions
  were written against the bare payload) and in the inline destination-list
  parser.
- catalyst-oracle.sh: `resolver_key` reads `d["data"]["targets"][0]["settings"]`.
- hot-reload-e2e.sh: unwrap the destination-list parser.

Verified the unwrap against real `doctor --json` and `settings show --json`
output; all three scripts pass `bash -n`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y2qAHe2kPbo3Q8ZCXzvJxh
…ands

`sweetpad simulator screenshot --output <file>` (and `record`/`bsp init`,
which had the same flag) panicked at parse time:

  Mismatch between definition and access of `output`.
  Could not downcast to OutputMode, need to downcast to std::path::PathBuf

The global `-o/--output` output-mode selector (GlobalArgs, `global = true`)
and these subcommands' `--output <file>` flags both registered the clap id
`output` with different value types; clap stored the PathBuf and the derived
GlobalArgs accessor then tried to read it as OutputMode. The CLI e2e smoke
test tripped it on the first `screenshot --output` call — previously masked
because the `cargo build` step failed before the tests ran.

The global `-o/--output` mode flag is the documented, unit-tested,
cross-cutting contract, so it keeps `--output`; the three file-destination
flags move to `--output-file` (distinct id, no collision). Updated
CLI_DESIGN.md and the smoke test to match. Verified `screenshot --help` now
shows both `--output-file` and `-o/--output`, the previously-panicking
invocation returns a clean error envelope, and `--output json` still selects
JSON mode. fmt, clippy and `cargo test --workspace` pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y2qAHe2kPbo3Q8ZCXzvJxh
The CLI e2e smoke test now runs to its final "error paths" section, where it
asserted that an unknown scheme, a missing container, and an unknown simulator
each exit 1. They are all `ErrorKind::TargetResolution`, which the CLI's
deliberate exit-code taxonomy maps to 4 (Generic 1, BuildFailure 3,
TargetResolution 4, ToolMissing 5, UserCancel 6 — see ErrorKind::exit_code,
which is unit-tested). The `expect_code 1` lines were written before that
taxonomy and never ran (the build step failed first).

Verified in a clean working directory that `derived-data path` (no container)
and `build start --scheme NoSuchScheme` both exit 4; `simulator screenshot`
against an unknown target takes the same TargetResolution path on a runner
where xcrun is present.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y2qAHe2kPbo3Q8ZCXzvJxh
@hyzyla hyzyla merged commit 39b43e3 into main Jul 6, 2026
6 checks passed
@hyzyla hyzyla deleted the claude/pipeline-failures-gnj3lv branch July 6, 2026 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants