Warning
This ruleset is under active development. The API is subject to breaking changes before a v1 release.
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).
To install, follow instructions from the release you wish to use.
See the docs folder for rule documentation and examples.
load("@diff.bzl//diff:defs.bzl", "diff")
diff(
name = "patch"
args = ["--unified"],
srcs = ["a.txt", "b.txt"],
patch = "a.patch"
)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.