can1357/oh-my-pi · error · RuntimeError

OMP_BENCH_INSTALL=local requires OMP_BENCH_TARBALL (host tar

Error message

OMP_BENCH_INSTALL=local requires OMP_BENCH_TARBALL (host tarball path)

What it means

omp_local's install() supports an install mode 'local' (_install_local) that uploads a prebuilt omp tarball from the host into the environment. If OMP_BENCH_INSTALL=local is set but no tarball path was configured (OMP_BENCH_TARBALL unset), it raises this RuntimeError before doing any work, since there is nothing to upload.

Source

Thrown at packages/metaharness/agent/omp_local.py:370

        self._bun = self._source_bun
        cli = f"{self._source_dir}/packages/coding-agent/src/cli.ts"
        q = shlex.quote
        await self.exec_as_agent(
            environment,
            command=(
                "set -e; "
                f"test -x {q(self._source_bun)} || {{ echo 'omp source mode: bun mount missing' >&2; exit 5; }}; "
                f"test -f {q(cli)} || {{ echo 'omp source mode: repo mount missing' >&2; exit 5; }}; "
                f"test -d {q(self._source_dir + '/node_modules/@oh-my-pi')} || "
                "{ echo 'omp source mode: linux deps mount missing' >&2; exit 5; }; "
                f"{q(self._source_bun)} --version"
            ),
        )
        return cli

    async def _install_local(self, environment: BaseEnvironment) -> str:
        if not self._tarball:
            raise RuntimeError(
                "OMP_BENCH_INSTALL=local requires OMP_BENCH_TARBALL (host tarball path)"
            )
        await environment.upload_file(self._tarball, _TARBALL_DST)
        app = f"{self._home}/.omp-bench/app"
        await self.exec_as_agent(
            environment,
            command=self._wrap(
                "set -e; "
                f"mkdir -p {shlex.quote(app)}; "
                f"tar xzf {_TARBALL_DST} -C {shlex.quote(app)} --strip-components=1; "
                f"cd {shlex.quote(app)}; "
                # Bundle inlines workspace TS; only externalized deps are needed.
                # Skip heavy optionals (transformers/sherpa) but add the native addon.
                "bun install --production --omit=optional; "
                "arch=$(uname -m); "
                'case "$arch" in aarch64|arm64) na=arm64 ;; x86_64|amd64) na=x64 ;; '
                '*) echo "unsupported arch $arch" >&2; exit 4 ;; esac; '
                # Native leaf MUST match the bundle version exactly (loader/API skew

View on GitHub (pinned to 9690622007)

Solutions

  1. Set OMP_BENCH_TARBALL to a valid host path to the omp tarball before running.
  2. Alternatively pick a different install mode (source or binary) that doesn't need a tarball.
  3. Verify the env var is actually exported (export OMP_BENCH_TARBALL=...) so it propagates to the harness process.
  4. Check the tarball path exists on the host; otherwise the subsequent upload will fail too.

Example fix

# before
OMP_BENCH_INSTALL=local bun run bench
# after
OMP_BENCH_INSTALL=local OMP_BENCH_TARBALL=/tmp/omp.tgz bun run bench
Defensive patterns

Strategy: validation

Validate before calling

import os, pathlib
if os.environ.get("OMP_BENCH_INSTALL") == "local":
    tb = os.environ.get("OMP_BENCH_TARBALL")
    assert tb, "OMP_BENCH_INSTALL=local requires OMP_BENCH_TARBALL"
    assert pathlib.Path(tb).is_file(), f"tarball missing: {tb}"

Try / catch

try:
    await harness.install(env)
except RuntimeError as e:
    if "requires OMP_BENCH_TARBALL" in str(e):
        print("Set OMP_BENCH_TARBALL to a host tarball path, or choose install=source|binary")
        sys.exit(2)
    raise

Prevention

When it happens

Trigger: Setting install mode to local (via OMP_BENCH_INSTALL=local env var or equivalent option) while self._tarball (parsed from OMP_BENCH_TARBALL) is None/empty, then calling install().

Common situations: Environment variable typo or not exported to the harness process; running the harness from a shell where OMP_BENCH_TARBALL was never set; switching install mode to local without updating the tarball config.

Understand the failure class

Background: "environment variable is not set" and "Missing keys in environment" errors: what missing required env var messages mean and how to fix them — this error's family across 28 libraries.

Related errors


AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31). Data as JSON: /api/errors/a3a15ab549a01b43. Report an issue: GitHub.