Skip to content

comptime evaluator lane cannot run any .wo bundle action: wo_sha256_text's &raw mut digest[0] is 'not comptime-evaluable', and the driver's fallback error carries no source location #1046

Closed

Description

@ehartford

Observed (worktree c4r on main bb0039bb, seed v0.15.1.7-gbb0039bbd)

A with build that started while ~/.local/bin/with was still the pre-bb0039bb binary failed to link the native build runner (_with_fs_read_file_status — #953's new runtime export — undefined in the old seed's embedded rt), so the driver did what #921 designed:

warning: build runner compile failed; actions fall back to comptime evaluation
...
error: action target 'pcre2-wo-build' failed during comptime evaluation: expression kind 26 is not comptime-evaluable yet

Kind 26 is NK_UNARY. The expression is in build/wo.w:

fn wo_sha256_text(text: &str) -> str:
    var digest: [32]u8 = [0 as u8; 32]
    sha256_hash_str(text, &raw mut digest[0] as *mut u8)     // wo.w:86, UOP_RAW_REF_MUT
    sha256_hex(&digest[0] as *const u8)

ComptimeEval.eval_unary (src/ComptimeEval.w:6624-6653) evaluates -, not, ~, and treats &x/*x as identity; UOP_RAW_REF_CONST/UOP_RAW_REF_MUT fall to unsupported(node). wo_sha256_text is on every bundle action's path (wo_corpus_sha → the store key), so the whole .wo lane — pcre2-wo-build, wo-drift, the harness — cannot run under the evaluator: with build --strict-effects :pcre2-wo-build (build_runner_target_eligible, src/main.w:1439 routes strict-effects runs to the evaluator), or any run whose runner fails to build. The native runner lane is unaffected, which is why the battery never saw it. Pre-existing since afbe870f (the sha helper), not a C4 change.

Tool blind spot

ComptimeEval.fail records a span only into pending_diag when require_success != 0; the action driver (src/main.w:1787) prints result.error_msg alone, so the operator gets "expression kind 26" with no file:line. Finding the line took a source hunt; the message should carry the node's span.

Fix directions

  1. Either make wo_sha256_text pointer-free (a sha256_hex_str(text: &str) -> str in the sha module, or fs.sha256_file, which the evaluator already intercepts) or teach the evaluator a raw address of a comptime array element.
  2. unsupported/fail results reported by the build driver include the span (file:line:col) of the offending node.

Activity

  1. ehartford commented on Oct 25, 2026

    @ehartford
    ContributorAuthor

    Triage 2026-10-25, with v0.15.3.0 (main a261b65): does not reproduce. wo_sha256_text no longer exists (the .wo key moved in 030293c, #1869), and a comptime-evaluator refusal now carries its source location, for example:

    error: …/build.w:3:33: operator requires integer comptime values; reached through __with_build_eval_entry -> build -> pick
    
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions