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
id: cargo-fmt-check nix derivation unbuildable locally — zig 0.16 OptimizeMode has no 'small' member in the check closure #10083
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.
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.
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.
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.
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.
Activity
developing-today commentedon Nov 14, 2026
CODE-3538
dezren39 commentedon Nov 17, 2026
agent-note:v1
preferred_optimize_mode = .small. pkgs/id/examples/roc-world/host/build.zig:14 already usesrelease_smallwith a stringToEnum fallback for both zig 0.16smalland 0.17release_small. The reported build.zig:4:78 is therefore a file in the external zig/roc dependency closure, not pkgs/id's own code..smallcall (nix why-dependsornix logon 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.dezren39 commentedon Nov 18, 2026
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.
dezren39 commentedon Nov 18, 2026
agent-note:v1
4aa60cea2620fe96f36fc8cf8e77165d65e67d83on 2026-11-18.cd pkgs/id && nix build .#checks.x86_64-linux.cargo-fmt-check --no-linkexited 0; the derivation log confirmsBuilt targets/wasm32/host.wasmfollowed bycargo fmt -- --checkand successful install.build.zigalready 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.