Giter VIP home page Giter VIP logo

bazel-paq's Introduction

Release MIT licensed

bazel-paq

Bazel rule for hashing targets.

Easily track and deploy build deltas.

An optimization for monorepo releases.

Purpose

Reduce bazel build deployments to unreleased targets.

Requires cache of build target hashes.

Usage

Module

Not supported in this release.

Workspace

Add http_archive to WORKSPACE file in respective project repository.

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "bazel_paq",
    sha256 = "369d2fb4b3d8375e4ec93cfcd86fab11885ba552fc533b1e40802f873a385f55",
    strip_prefix = "bazel-paq-1.0.1",
    url = "https://github.com/gregl83/bazel-paq/archive/refs/tags/v1.0.1.tar.gz",
)

load("@bazel_paq//:deps.bzl", "bazel_paq_dependencies")

bazel_paq_dependencies()

Invoke paq rule in BUILD file for each repository target as needed.

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

# Produces file named `hash.paq` in bazel-bin target directory.
paq(
    name = "hash",
    source = ":<file-or-dir-build-target>",
)

Rule Output

Invoking the paq bazel rule outputs a file named using the rule name argument value and the .paq filename extension.

Output paq files are valid JSON and contain a single blake3 hash in double quotes for a supplied bazel target.

Hashing Algorithm

A rust powered executable named paq uses blake3 to hash either a single file or directory.

Output hashes can be validated by installing paq and using it to hash build targets in bazel's bazel-bin directory.

For more information see the paq project repository.

Examples

See examples directory for bazel build targets using bazel-paq.

Using Bazel Paq in Releases

  1. Read target hash from .paq file.

  2. Read target release hash stored in cache.

  3. Compare target and target release hashes.

    a. Equal - Skip already released target.

    b. Unequal - Release new target.

  4. Store target release hash in cache using target hash value.

License

MIT

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.