Skip to content

infs single-file run does not resolve [wasm-dependencies] #367

Description

@0xGeorgii

Problem

infs run <path> (single-file mode) compiles via compile_to_wasm (apps/infs/src/commands/run.rs), which forwards the enclosing manifest's [build] wasm-features but never its [wasm-dependencies] — no --wasm-dep is passed, and RunArgs has no -L/--wasm-lib-dir flag either. Every other compilation path forwards the manifest deps: single-file infs build (apps/infs/src/commands/build.rs) and, since #361, project-mode build and run (apps/infs/src/commands/project_build.rs).

Consequence: infs run on a file that binds externals (use { f } from module) fails external resolution — while infs build on the same file links — unless the user hand-crafts INFERENCE_WASM_LIB_PATH. Since single-file run overwrites the same out/<stem>.wasm that build writes, the two commands also disagree about whether the project's artifact can exist at all.

Fix

Resolve the enclosing manifest's [wasm-dependencies] in single-file run's compile_to_wasm exactly as single-file build does (same enclosing_manifest walk, same --wasm-dep <name>=<path> forwarding); decide whether run should also grow -L/--wasm-lib-dir.

Acceptance

infs run path/to/file.inf inside a project with [wasm-dependencies] + bound externs compiles, links, and executes with no env workaround; the docs' "tracked separately" caveat can point here.

Provenance: split out of #361, which fixed the project-mode half; the gap was previously documented in apps/infs docs as "tracked separately" with no tracking issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions