bazel-diff icon indicating copy to clipboard operation
bazel-diff copied to clipboard

Change in rule attribute not detected

Open BalestraPatrick opened this issue 3 years ago • 3 comments

Hello! I've noticed that one type of change isn't detected by bazel-diff. The situation is as follows: We have a custom rule that has a tool has a default executable attribute that looks something like this.

def _my_rule_impl(ctx):
    # TODO

_my_rule = rule(
    implementation = _my_rule_impl,
    attrs = {
        "_tool": attr.label(
            default = "//tools/release:ios_release",
            executable = True,
            cfg = "host",
        ),
    },
    executable = True,
)

def my_rule(name, **args):
    _my_rule(name, **args)

I can see in a diff that changes to //tools/release:ios_release are correctly identified, but I would expect also all my_rule definitions to show up in the diff since they all depend on //tools/release:ios_release, but they're not.

BalestraPatrick avatar Jun 03 '21 08:06 BalestraPatrick

Hello @BalestraPatrick ! Thanks for the report. Do you have a small sample repo I can work with? Makes it easier to debug what is going on.

tinder-maxwellelliott avatar Jun 03 '21 15:06 tinder-maxwellelliott

Hey @tinder-maxwellelliott! I have an example project that tries to reproduce exactly what I'm seeing in my project but the bug isn't reproducible. There must be something slightly different in my project, so I'll have to dig more and see if I can reproduce it fully in the example project.

BalestraPatrick avatar Jun 09 '21 08:06 BalestraPatrick

Hey @BalestraPatrick, did you manage to figure this out? I'm having the same issue and I'm not able to reproduce it in a fresh repo.

salvozappa avatar Aug 25 '21 12:08 salvozappa

I believe this should be resolved now using https://github.com/Tinder/bazel-diff/commit/5b29fb65defd0757f49708fe664954df9d8e1d48

tinder-maxwellelliott avatar Jun 06 '23 13:06 tinder-maxwellelliott