bazel_paq 1.5.0Latest published 6d ago
MODULE.bazel
bazel_dep(name = "bazel_paq", version = "1.5.0")
README

Build Release MIT licensed

bazel-paq

Bazel aspect for computing target output hashes.

Easily track build deltas by comparing output hashes with deployed artifacts or previous builds.

Usage

Workspace Configuration

1. Add Module Dependency

Add the following to the dependency section the workspace MODULE.bazel:

bazel_dep(name = "bazel_paq", version = "1.5.0")

2. Add Load Definition

Add the following to the workspace defs.bzl:

load("@bazel_paq//:defs.bzl", "paq_aspect")

Executing Builds

Short Command

Add the following to the workspace .bazelrc configuration file:

build:paq --aspects=@bazel_paq//:defs.bzl%paq_aspect
build:paq --output_groups=+paq_files

Execute build:

bazel build --config=paq //...

Long Command

bazel build //... --aspects=@bazel_paq//:defs.bzl%paq_aspect --output_groups=+paq_files

Executing Tests

bazel test tests:all --test_output=all

Aspect Output

Executing bazel build with the bazel-paq aspect configured will compute unique hashes for every build target output.

Output hash filenames are target_output_filename.ext.paq for files and .paq for directories.

Files are valid JSON and contain a single blake3 hash in double quotes.

Hashing Algorithm

The paq executable used in bazel-paq is powered by the blake3 hashing algorithm.

Output Hash Validation

  1. Install: Make the paq executable available on validation system.
  2. Compute: Hash a build target output using paq.
  3. Compare: Open respective .paq build output and validate it equals computed hash from Step 2.

Example Workspace

The example directory contains a complete Bazel module workspace demonstrating bazel-paq usage.

Output Structure

Target output hash files use .paq extension.

bazel-bin
|-- configuration
|   |-- config.out.json
|   `-- config.out.json.paq
|-- infrastructure
|   |-- templates.manifest
|   |-- templates.tar
|   `-- templates.tar.paq
|-- python-service
|   |-- app
|   |-- app.paq
|   |-- app.repo_mapping
|   `-- app.runfiles_manifest
`-- rust-command
    |-- command
    |-- command.paq
    |-- command.repo_mapping
    `-- command.runfiles_manifest

License

MIT

About

🟩△ Bazel Aspect for Computing Output Hashes

@gregl83/bazel-paq@gregl83
Homepage
5stars
Wednesday, September 23, 2026 (6 days ago)
@gregl83#10691 add bazel_paq 1.5.0 (#10691)

Languages

Python40.3%
Shell1.8%
Dockerfile1.5%
Rust0.1%

Maintainers

@gregl83

Versions

1.5.0 +8.9mo2026-09-23
1.4.1 +14d2025-12-30
1.4.0 +18d2025-12-16
1.3.32025-11-27