Skip to content

id(cli): pkgs/id does not compile on main — PR #3738 inserted parse_result_limit between Command's derive and the enum #3751

Closed

Description

@dezren39

id(cli): pkgs/id does not compile on main — PR #3738 inserted parse_result_limit between Command's derive and the enum

Evidence (verified 2026-11-01, main e49c0be)

pkgs/id/src/cli.rs lines ~199–212 on current main:

#[derive(Subcommand, Debug)]
/// Parses a result limit (`--first` / `--last` / peek `--lines`): zero is
/// rejected with a clear error instead of silently producing an empty result
/// or a header-only preview (#3059). ...
fn parse_result_limit(raw: &str) -> Result<usize, String> { ... }

pub enum Command {

The parse_result_limit function (added by PR #3738, "id(cli/repl): reject zero result limits at both boundaries (#3059)", merged 2026-11-01 09:03 CST as 5fa0650) was inserted between #[derive(Subcommand, Debug)] and the pub enum Command it belongs to. The derive now targets a function and the enum has no derive.

cargo test --lib in pkgs/id on main therefore fails with 24 errors, including:

  • error[E0774]: derive may only be applied to structs, enums and unions (the misplaced attribute)
  • error[E0277]: cli::Command doesn't implement Debug (×15, from test code formatting {other:?})
  • error[E0277]: the trait bound cli::Command: Subcommand is not satisfied
  • error[E0609]: no field format / format_error on Result<FindArgs, anyhow::Error> (cascade)

Full log from the discovering run: laptop /tmp/test-4789.log (queue task 4789's verification build, 2026-11-01).

Impact

pkgs/id does not compile on main at all — every id change is unverifiable and any CI leg building pkgs/id is red until this is fixed. Discovered while verifying task 4789 / PR #3748 (directory_auth, #1732), which is unrelated and blocked on this for its test run.

Fix

Move parse_result_limit (with its doc comment) so #[derive(Subcommand, Debug)] sits directly above pub enum Command again — e.g. place the function after the enum or above the derive. No behaviour change: the function body and all value_parser = parse_result_limit call sites stay as PR #3738 wrote them.

Acceptance

Activity

  1. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    priority/highImportant and time-sensitive
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    on Nov 1, 2026
  2. developing-today commented on Nov 1, 2026

    @developing-today
    Contributor
  3. dezren39 commented on Nov 1, 2026

    @dezren39
    MemberAuthor

    Fixed on main by PR #3754 (merged as dad9ddd, commit 47b0620) — an independent lane repaired the same break in parallel with this issue being filed. Verified on current main: #[derive(Subcommand, Debug)] sits directly above pub enum Command in pkgs/id/src/cli.rs, and the stale parse_find_args test call sites in pkgs/id/src/repl/runner.rs all unwrap the Result. A duplicate fix PR (#3757, from queue task 4789) was closed after a salvage diff found nothing unique. Closing as completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    app/idPackage/app: id (pkgs/ or apps/ in this repo)kind/bugSomething isn't working (prefixed form of the classic bug label)priority/highImportant and time-sensitivestatus:done

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions