Skip to content

Bazel Macro issue #259

Open
Open
@lukasmi93

Description

I noticed some strange behavior of bazel-diff and bazel Macros after upgrading to bazel 7.
Before upgrading to bazel 7, any changes made to the Macro function code caused all Macro calls in BUILD files to be listed in the output of the bazel-diff get-impacted-targets command.

Simple example:

`def miniature(name, src, size="100x100", **kwargs):
"""Create a miniature of the src image.

The generated file is prefixed with 'small_'.
"""
native.genrule(
name = name,
srcs = [src],
outs = ["small_" + src],
cmd = "convert $< -resize " + size + " $@",
**kwargs
)`

`load("//path/to:miniature.bzl", "miniature")

miniature(
name = "logo_miniature",
src = "image.png",
)

cc_binary(
name = "my_app",
srcs = ["my_app.cc"],
data = [":logo_miniature"],
)`

Based on our example any code changes in the miniature function (e.g. add print()) caused the bazel-difff listed logo_miniature in the output.
Bazel-diff doesn't not respond to such changes and doesn't list any resources after bazel upgrade.

Could you help determine what may have changed in the bazel-diff?

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions