Skip to content

with build --emit-c fails on hello world with the installed compiler: import module not found 'std.re.defs' #2118

Closed

Description

@ehartford

Found while verifying README claims (installed compiler from main dad25d8, v0.15.3.0), outside the repository:

echo 'print("hi")' > h.w
with build h.w --emit-c -o h.c
error: import module not found: 'std.re.defs' (build-generated modules live under out/gen; run `with build` once in a fresh checkout)

with run h.w works in the same directory. The C backend asks for the regex bundle's source modules, which an installed compiler does not carry (it has the .wo bundle). Either the C backend links bundles as the LLVM backend does, or --emit-c says plainly that it needs a source checkout.

Activity

  1. ehartford commented on Oct 5, 2026

    @ehartford
    ContributorAuthor

    Fixed on main 0ade380 (stack #2175, battery green; the stack top also builds and passes its new tests on linux-x86_64 and windows-x86_64).

  2. ehartford commented on Oct 5, 2026

    @ehartford
    ContributorAuthor

    Both halves: --emit-c/--emit-obj accept a file with top-level statements, and outside a checkout the error now names the bundle ('module std.re.defs is in this compiler as the pcre2 bundle, an object without source … run it from a With source checkout'). It prints once per bundled module, which is noisy; hello world still compiles all of pcre2 into its C inside a checkout (19 MB).

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