Skip to content

comptime evaluator: str.trim (build/seed.w seed_lock_value) is not evaluable, so :seed fails whenever the native runner is not usable #1866

Closed

Description

@ehartford

Repro

A checkout where the native build runner cannot be linked yet (an out/bootstrap-lib from another compiler generation, the #1797 gate) runs every action in the seed's comptime evaluator. build/seed.w's seed_lock_value calls line.trim(), which the evaluator does not implement:

cd <fresh checkout of main@173d8aa4>; cp <pinned seed> src/main
mkdir -p out/bootstrap-lib && touch out/bootstrap-lib/cimport_stubs.o   # foreign-generation root: runner gate refuses
rm -rf out/.build-state
WITH=$PWD/src/main src/main build :seed

Actual:

error: action target 'seed' failed during comptime evaluation: str method 'trim' is not comptime-evaluable yet
survey: 1 target(s) failed:
  failed: seed

Expected: :seed succeeds. The evaluator is the bootstrap path (prepare-bootstrap-link-root cannot have completed before :seed, any --no-deps action in a fresh checkout), so it must run every action the build layer writes.

Cause

src/ComptimeEval.w eval_str_method_call covers len/to_owned/byte_at/slice/contains/starts_with/ends_with/find/replace/split/clone; the MirLower str intrinsic set also has trim, to_upper, to_lower, index_of, repeat. build/seed.w uses trim and index_of in seed_lock_value, seed_lock_block_asset and seed_lock_workflow_drift.

Fix

Implement the missing str methods in the evaluator's one dispatch (eval_str_method_call), add comptime-diff tests, and sweep every str/Vec/Option method the build layer (build.w, build/*.w, lib/std/build.w) calls against the evaluator's dispatch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions