Diff Utils

Create and Update Patches

load("@bzlparty_tools//:diff.bzl", "diff", "update_patches")

diff(
    name = "module_bazel",
    source = "//:MODULE.bazel",
    target = ":MODULE.bazel",
)

update_patches()

> [!NOTE] > The diff rule uses the diff command from the host system. > There is no toolchain that uses a platform specific tool.

diff

diff(name, source, target, input)

Create a patch file from source and target files.

PARAMETERS

Name Description Default Value
name A unique name for the target. none
source Source file to create the patch for. none
target Target file to compare the source to. none
input Input patch file, optional. Defaults to a file named like the rule with the patch extension, e.g. module_bazel.patch. None

update_patches

update_patches(name, kwargs)

Macro to update all patch files in a package.

PARAMETERS

Name Description Default Value
name A unique name for the target. “update_patches”
kwargs All other arguments from write_source_files none