Skip to content

Support multi-layer image resolution in ww run #33

@lthibault

Description

@lthibault

Summary

Extend ww run to accept multiple positional arguments, each a path (local filesystem or IPFS-family). The runtime merges them into a unified FHS root via per-file union before loading bin/main.wasm.

ww run <path> [<path> ...]

Later arguments override earlier arguments at the file level. Directories merge, files replace. No deletes.

Motivation

This enables overlay patterns where a base image provides defaults and overlays customize specific parts (e.g. swap boot/ peers for local dev without forking the whole image). It also lays the groundwork for --stem integration, where the contract's head CID becomes the base layer.

Design

See docs/architecture.md (on feat/ww-run-image) — "Configuration" and "Layer resolution" sections.

Key rules:

  • Per-file union: each layer contributes files, later layers win on conflict
  • Directories merge, files replace
  • No deletes — to remove something from a lower layer, publish a new version without it
  • The union must contain bin/main.wasm — no single layer needs to be complete

Implementation sketch

  • Change ww run's image: String to images: Vec<String> (one or more positional args)
  • Add a UnionLoader (or LayeredLoader) to src/loaders.rs that stacks multiple image roots and resolves paths top-down
  • CellBuilder takes the merged root instead of a single path
  • Unit tests for layer resolution (override, merge, missing bin/main.wasm error)

Depends on

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions