Skip to content

id: cargo-fmt-check nix derivation unbuildable locally — zig 0.16 OptimizeMode has no 'small' member in the check closure #10083

Open

Description

@dezren39

Finding

The nix derivation for the pkgs/id cargo-fmt-check flake check cannot build in a local nix sandbox: it fails while building a zig component in the check's dependency closure, before the fmt recipe ever runs.

Evidence (2026-11-14, laptop, reproduced identically on clean main bc42ebf2 and on an unrelated fix branch — so it is not diff-caused):

$ cd pkgs/id && nix build .#checks.x86_64-linux.cargo-fmt-check --no-link
build.zig:4:78: error: enum 'builtin.OptimizeMode' has no member named 'small'
    const optimize = b.standardOptimizeOption(.{ .preferred_optimize_mode = .small });
note: enum declared in /nix/store/…-zig-0.16.0/lib/zig/std/builtin.zig (OptimizeMode)

The check's zig toolchain resolves to zig 0.16.0, whose OptimizeMode has no small member, while some build.zig in the closure (a dependency of the check sandbox, not pkgs/id's own code — pkgs/id has no build.zig) calls standardOptimizeOption(.{ .preferred_optimize_mode = .small }).

Impact

  • Any check sharing this mkCheck sandbox shape may be unbuildable locally even when its recipe is green (cargo fmt -- --check passes on the same tree), which hides real fmt verdicts behind a toolchain failure and pushes verification to CI runners only.
  • Found during main-broken: developing-today/code id @3b8741d — basic: nix flake check (cargo-check) #9928's breakage verification: prettier/shellcheck/shfmt/rustfmt check derivations all build locally; cargo-fmt-check's does not, on clean main.

Acceptance

  • nix build .#checks.x86_64-linux.cargo-fmt-check succeeds locally on a clean main checkout (the zig component in the closure builds, or the check sandbox no longer depends on it), and the check's verdict again reflects the fmt recipe alone.
  • The zig version mismatch is resolved at its source (pin the closure's zig to a version whose OptimizeMode matches the build.zig, or update the build.zig call), not by dropping the check.

Activity

  1. added
    kind/ciCI/CD pipelines, workflows, and build automation
    priority/normalOrdinary priority (the default)
    on Nov 14, 2026
  2. developing-today commented on Nov 14, 2026

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

    @dezren39
    MemberAuthor

    agent-note:v1

    • lane: openchamber-scheduled-lane (code-f), queue task 19102, worker repo-worker-code
    • verdict: triaged. Issue is open and reproducible from the report; no dependency.
    • Fresh repo check: no in-repo build.zig calls preferred_optimize_mode = .small. pkgs/id/examples/roc-world/host/build.zig:14 already uses release_small with a stringToEnum fallback for both zig 0.16 small and 0.17 release_small. The reported build.zig:4:78 is therefore a file in the external zig/roc dependency closure, not pkgs/id's own code.
    • Next step (follow-up, not started here): identify which fetched dependency's build.zig carries the .small call (nix why-depends or nix log on the failing check derivation), then pin the zig toolchain or patch that dependency. Recommended first: pin the check's zig to the version whose OptimizeMode matches.
    • no PR opened; no code changed.
  4. added and removed on Nov 17, 2026
  5. dezren39 commented on Nov 18, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    {"kind":"triaged","worker":"repo-worker-code","lane":"code-i","queue_task":20473,"date":"2026-11-18"}

    Triage verdict (openchamber scheduled lane code-i, task 20473): still open and reproducible from the 2026-11-14 report. Confirmed fresh: no in-repo build.zig uses preferred_optimize_mode .small; the failing call sits in an external zig/roc dependency of the check closure. Follow-on: a small_fix packet to identify that dependency and pin the check toolchain (or patch the call), timebox 60 minutes, with the cargo-fmt-check check kept. No PR opened here; no code changed.

  6. dezren39 commented on Nov 18, 2026

    @dezren39
    MemberAuthor

    agent-note:v1

    • lane: openchamber-scheduled-lane (code-f), queue task 20783, worker repo-worker-code
    • verdict: triaged. The reported failure did not reproduce on clean main 4aa60cea2620fe96f36fc8cf8e77165d65e67d83 on 2026-11-18. cd pkgs/id && nix build .#checks.x86_64-linux.cargo-fmt-check --no-link exited 0; the derivation log confirms Built targets/wasm32/host.wasm followed by cargo fmt -- --check and successful install.
    • The issue was not shown fixed by a change since the report; the roc-world host build.zig already contains Zig 0.16/0.17 OptimizeMode compatibility. This run establishes only that current main passes in this environment; the exact reported external dependency was not identified.
    • no code changed; no PR opened. Please provide the failing derivation/dependency log if this still reproduces.
  7. removed their assignment
    on Nov 20, 2026
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

    kind/ciCI/CD pipelines, workflows, and build automationpriority/normalOrdinary priority (the default)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions