can1357/oh-my-pi · error · Error

--no-build but no tarball found; pass --tarball or drop --no

Error message

--no-build but no tarball found; pass --tarball or drop --no-build

What it means

When package building is disabled (--no-build, i.e. cfg.build is false) and no explicit tarball was given, the runner falls back to the newest prebuilt tarball in the _bench jobs directory. If none exists, it cannot proceed and throws, telling the user to either pass --tarball or re-enable building.

Source

Thrown at packages/metaharness/src/runner.ts:1577

	fs.mkdirSync(benchDir, { recursive: true });
	if (!cfg.resume && !cfg.dryRun) {
		// Snapshot the resolved launch config so a later `--resume <job>` can
		// rebuild the exact same invocation without re-specifying flags.
		fs.writeFileSync(path.join(benchDir, "runner-config.json"), JSON.stringify({ ...cfg, jobName }, null, "\t"));
	}

	const version = readPkgVersion();

	// tarball (local install only)
	let tarball: string | null = cfg.tarball;
	if (cfg.agent === "omp" && cfg.install === "local" && !cfg.binaryArm64 && !cfg.binaryX64) {
		if (tarball) {
			process.stdout.write(dim(`using tarball ${tarball}\n`));
		} else if (cfg.build) {
			tarball = buildTarball(path.join(cfg.jobsDir, "_bench"));
		} else {
			tarball = newestTarball(path.join(cfg.jobsDir, "_bench"));
			if (!tarball) throw new Error("--no-build but no tarball found; pass --tarball or drop --no-build");
		}
	}

	// source mount (default): repo bind-mounted read-only + cached linux deps tree
	let source: SourceMount | null = null;
	if (cfg.agent === "omp" && cfg.install === "source" && !cfg.binaryArm64 && !cfg.binaryX64) {
		source = prepareSourceDeps(cfg);
	}

	// models.yml (gateway)
	let modelsYaml = "";
	if (cfg.agent === "omp" && cfg.gateway) {
		modelsYaml = writeModelsYaml(benchDir, cfg);
		if (!gatewayHealthOk(cfg.gatewayUrl)) {
			process.stderr.write(
				yellow(
					`warning: gateway ${cfg.gatewayUrl} health check failed (continuing). Is the pm2 'omp-auth-gateway' running?\n`,
				),

View on GitHub (pinned to 9690622007)

Solutions

  1. Pass an explicit package tarball: --tarball /path/to/package.tgz
  2. Drop --no-build so the runner builds the tarball itself via buildTarball()
  3. Run a build once to populate <jobsDir>/_bench with a tarball, then rerun with --no-build
  4. Check you passed the correct --jobs-dir containing the _bench tarballs

Example fix

// before
$ omp-metaharness --no-build
// Error: --no-build but no tarball found

// after
$ omp-metaharness --no-build --tarball ./dist/oh-my-pi-1.0.0.tgz
// or simply
$ omp-metaharness
Defensive patterns

Strategy: validation

Validate before calling

const tarball = opts.tarball ?? newestTarball(path.join(cfg.jobsDir, "_bench"));
if (!cfg.build && !tarball) {
  throw new Error("--no-build requires --tarball or an existing tarball in <jobsDir>/_bench");
}

Try / catch

try {
  await runBenchmark(cfg);
} catch (err) {
  if (err instanceof Error && err.message.includes("no tarball found")) {
    console.error("Build a tarball first or pass --tarball <path>.tgz");
    process.exitCode = 1;
    return;
  }
  throw err;
}

Prevention

When it happens

Trigger: Invoking the runner with build disabled (cfg.build false via --no-build) without --tarball, when path.join(cfg.jobsDir, '_bench') contains no tarball artifacts (empty dir, wrong --jobs-dir, or first run with nothing previously built).

Common situations: Fresh checkout or clean CI workspace with no prior build artifacts; pointing --jobs-dir at the wrong directory; typo'd or missing --tarball path combined with --no-build.

Related errors


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