Skip to main content

GhostBuild

Build it twice. Know what changed.

GhostBuild is a local-first command-line tool that independently rebuilds a software project and compares the resulting artifacts, so you can see whether your build is reproducible and, if not, which files differ.

Status: 0.2.0, early. Only Python projects are supported. Not yet published on PyPI.

Why it exists

A build that succeeds is not necessarily a reproducible one. Timestamps, tool versions, unpinned dependencies and file ordering can all change the bytes of a wheel or sdist without changing its behaviour. If you can't rebuild an artifact and get the same bytes, it is hard to confirm that what you published came from the source you reviewed. GhostBuild automates the "build it again and compare" step and explains differences.

How it works

  1. Inspect the project (reads files only; nothing is executed) and pick an adapter.
  2. Show you a plan and ask for consent, because builds run project code.
  3. Build the project in a temporary copy (the original build).
  4. Build a second, fresh copy in Docker (preferred) or, if you approve, on the same host.
  5. Compare artifacts by exact SHA-256 and inspect wheel/sdist members for the cause of any difference.
  6. Print a report and write result.json (and optionally report.html or report.md).

Verdicts:

  • reproducible: every artifact matches exactly under the comparison policy.
  • non-reproducible: at least one artifact differs, is missing, or is extra.
  • inconclusive: a build failed or timed out, no artifacts were found, or the comparison could not be completed.

Features

  • Python projects: setuptools, Hatch, Poetry, PDM (and Flit) detected via pyproject.toml; legacy setup.py projects too.
  • Wheel and sdist artifacts, compared by SHA-256.
  • For differing archives: per-member differences, timestamp/mode metadata, wheel WHEEL/METADATA fields, and hypotheses clearly labelled as unconfirmed.
  • Docker isolation, with a same-host fallback that needs explicit approval and is labelled in every report.
  • Terminal, JSON, Markdown and self-contained HTML reports.
  • Optional ghostbuild.toml. No accounts, no API keys, no telemetry.

Installation

Once published:

pip install ghostbuild

From a checkout today:

git clone https://github.com/LocalGhosters/ghostbuild.git
cd ghostbuild
pip install .
ghostbuild --version

Requires Python 3.10+. Docker is optional but recommended for independent rebuilds.

Quick start

ghostbuild scan ./my-project          # inspect only, runs nothing
ghostbuild verify ./my-project        # asks before running the build
ghostbuild verify ./my-project --format html --output ./results
ghostbuild compare ./build-one ./build-two
ghostbuild compare ./build-one ./build-two --format markdown >> "$GITHUB_STEP_SUMMARY"
ghostbuild report ./ghostbuild-results/

Commands

Command Purpose
ghostbuild Banner, version and examples.
ghostbuild scan [DIR] Show name, version, build system, config files, build requirements, available tools. Never builds.
ghostbuild verify [DIR] Full workflow. Options: --output, --format terminal|json|html|markdown, --keep-artifacts, --isolation auto|docker|local, --yes, --timeout, --config, --verbose, --no-color.
ghostbuild compare A B Compare two existing artifact directories. Runs no builds.
ghostbuild report [PATH] Display or regenerate a report from a stored result.json.
ghostbuild init [PATH] Write an example ghostbuild.toml.
ghostbuild version Print the version.

Exit codes: 0 reproducible, 1 non-reproducible, 2 usage error, 3 inconclusive, 4 error, 5 user declined.

Example output

The shape of a report (values depend on your project):

RESULT: NON-REPRODUCIBLE

Artifact                      Original       Rebuilt        Status
pkg-1.0-py3-none-any.whl      9f2c41ab07e1…  3be8d0c5a912…  different

Internal differences:
  pkg-1.0.dist-info/RECORD   metadata (timestamp)
Hypotheses (unconfirmed):
  - Archive member timestamps differ; the build may embed the current time.

Configuration

Everything is optional. See docs/configuration.md and examples/ghostbuild.example.toml. Generate a file with ghostbuild init.

Supported ecosystems

Ecosystem Status
Python (wheel, sdist) Implemented
Node.js, Cargo, Go, Java Planned, not implemented

Details: docs/supported-ecosystems.md.

Isolation and safety

Building runs arbitrary project code (build backends, setup.py, hooks). Only verify projects you trust.

  • Nothing is built without consent (--yes or an interactive confirmation). scan and compare never build.
  • The plan states what runs on the host and what runs in Docker.
  • Docker mode mounts the source read-only, drops capabilities and sets no-new-privileges. The container downloads the build frontend and build requirements.
  • If Docker is unavailable, --isolation auto stops and asks. A local rebuild uses the same interpreter and tools as the original build, so it only shows repeatability on this machine. A match is labelled "same-host check only". --isolation docker never falls back.
  • Your project directory is only read. Builds run in temporary copies. GhostBuild deletes only its own temporary directories.
  • No shell=True; every subprocess has a timeout; output is captured.
  • Builds get an allowlisted environment. Reports record variable names only, and secret-looking values are redacted from logs.
  • Archives are never extracted to disk; unsafe member names are rejected.

Limitations

  • Python only.
  • Only the exact comparison policy exists. There is no normalised comparison.
  • Hypotheses are hints from patterns, not proof of cause.
  • The Docker rebuild installs build tools from the network, so differing package versions between builds are possible; unpinned build requirements are flagged as a warning.
  • Python-version, OS and architecture differences are reported but not controlled.
  • Tested on Linux. Windows and macOS are not verified.

Disclaimer: reproducibility results depend on the environments and comparison policy used. A "reproducible" result means these two builds matched, not that every build everywhere will.

Development

pip install -e ".[dev]"
pytest
python -m build

Tests never run real project builds; subprocesses and Docker are faked. See docs/architecture.md.

More documentation

FAQ, CI usage, JSON format, roadmap and security policy.

Contributing

Contributions are welcome: see CONTRIBUTING.md and the Code of Conduct. Open areas include new ecosystem adapters, better diagnostics, other isolation providers and more test scenarios.

License

MIT. Copyright (c) 2026 LocalGhosters. See LICENSE.

Metadata

Release files for ghostbuild 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ghostbuild 0.2.0
File Size Uploaded Provenance Actions
ghostbuild-0.2.0.tar.gz 64.0 kB Without provenance Details for ghostbuild-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ghostbuild 0.2.0
File Interpreter ABI Platform Actions
ghostbuild-0.2.0-py3-none-any.whl Python 3 none any Details for ghostbuild-0.2.0-py3-none-any.whl

Total release size: 119.2 kB

Release files / ghostbuild-0.2.0.tar.gz

Download URL ghostbuild-0.2.0.tar.gz
Size 64.0 kB
Tags Source
SHA-256 checksum
How to use checksums
87ec85211373705d81c786e2669a2b3b6daf5b8166e0e6b7ef2df2164b927ca7
BLAKE2b-256 checksum
How to use checksums
2bb72fb03a0fc371ba9773b59ef24c7661be04da1b7810e38f54ab98c48d0a6d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.2

Release files / ghostbuild-0.2.0-py3-none-any.whl

Download URL ghostbuild-0.2.0-py3-none-any.whl
Size 55.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
94254f979ed03249b2bd2bb1d7e72605cf7c61c9c631f653ec192ec2a78d256d
BLAKE2b-256 checksum
How to use checksums
bf161368faacfd02f1a9ce01e715c97ac751aa645557dba9db393db207b5bb6f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.2

Security for ghostbuild 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page