Skip to content

kormide/diff.bzl

Repository files navigation

Warning

This ruleset is under active development. The API is subject to breaking changes before a v1 release.

Bazel rules for GNU diffutils

GNU diffutils provides diff, cmp, diff3, and sdiff.

This project provides rules that run these programs as Bazel actions.

By default, the project registers toolchains for prebuilt binaries as diffutils only does source releases. You may alternatively register your own toolchain based on a source build of the diffutils BCR entry (see example).

Documentation

To install, follow instructions from the release you wish to use.

See the docs folder for rule documentation and examples.

Use cases

Create different types of patches

load("@diff.bzl//diff:defs.bzl", "diff")

diff(
    name = "patch"
    args = ["--unified"],
    srcs = ["a.txt", "b.txt"],
    patch = "a.patch"
)

Keep generated source files up to date

See Patching source files.

Support automatic patch workflows for CI

This ruleset outputs patches into a distinct diff_bzl__patch output group making it easier for patches to be collected and then applied using automation. See the build & patch example script.

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors