gorhill/uBlock · error · SystemExit

Build dir missing.

Error message

Build dir missing.

What it means

make-chromium-meta.py is a build-time post-processor for the Chromium manifest. It requires exactly one CLI argument: the build directory that contains manifest.json (opened at lines 19-21). If argv has no argument or an empty-string argument it aborts via SystemExit before any work (lines 8-9), because there is no build directory to read from or write back to.

Source

Thrown at tools/make-chromium-meta.py:9

#!/usr/bin/env python3

import os
import json
import re
import sys

if len(sys.argv) == 1 or not sys.argv[1]:
    raise SystemExit('Build dir missing.')

proj_dir = os.path.join(os.path.split(os.path.abspath(__file__))[0], '..')
build_dir = os.path.abspath(sys.argv[1])

version = ''
with open(os.path.join(proj_dir, 'dist', 'version')) as f:
    version = f.read().strip()

manifest_out = {}
manifest_out_file = os.path.join(build_dir, 'manifest.json')
with open(manifest_out_file) as f:
    manifest_out = json.load(f)

manifest_out['version'] = version

# Development build? If so, modify name accordingly.
match = re.search(r'^\d+\.\d+\.\d+\.\d+$', version)
if match:

View on GitHub (pinned to c68df492fd)

Solutions

  1. Invoke as `python tools/make-chromium-meta.py <build_dir>` where <build_dir> holds the built manifest.json.
  2. Run through the project's normal build tooling (npm scripts) which supplies the argument correctly.
  3. If wrapping the script, assert the build-dir argument is non-empty before invoking it.

Example fix

# before
python tools/make-chromium-meta.py        # SystemExit: Build dir missing.

# after
python tools/make-chromium-meta.py build/chromium
Defensive patterns

Strategy: validation

Validate before calling

import sys
if len(sys.argv) < 2 or not sys.argv[1].strip():
    raise SystemExit('Usage: make-chromium-meta.py <build_dir>')
build_dir = sys.argv[1]

Prevention

When it happens

Trigger: Running `python tools/make-chromium-meta.py` with no argument, or with an empty-string argument. Invoking it through a wrapper or make target whose build-dir variable was left unset or expanded to empty.

Common situations: Running the script manually during local packaging without passing the build output dir; a Makefile/npm script with an empty $(BUILD_DIR) placeholder; copy-pasting the command and dropping the trailing path argument.

Related errors


AI-assisted analysis of gorhill/uBlock@c68df492fd (2026-08-12). Data as JSON: /api/errors/e6fc94098867be4a. Report an issue: GitHub.