<#20732 Visibility rules with tags not working wit...
# github-notifications
c
#20732 Visibility rules with tags not working with overrides Issue created by isra17 Is your feature request related to a problem? Please describe. Given the following target generator:
Copy code
# foo/bar/BUILD
python_sources(overrides={"biz.py": dict(tags=["core"])})
and the following visibility rule:
Copy code
("*", "[//**](core)")
It appears that the visibility rule won't ever match
foo/bar/biz.py
. Adding
tags=["core"]
to the generator fixes it. Diving in Pants source, it seems like the visibility engine is working with
TargetAdaptor
which represent the generator
python_sources
and not the final
python_source
with the override applied. I'm not that familiar with Pants source and it look like the visibility engine is hooking deep in the dependency engine. Is there strong limitation of why it is not handling the generated targets? I suppose it could be hacked around by checking the overrides tags if getting the generated target is not possible. Describe the solution you'd like I think it would be fair to assume that rules are being run against the generated targets and not the generator. Do you have any pointer for this? I could try to work out something. I'm trying to setup something so I can rely heavily on tags to define my dependency rules (Make it so that
core
target can depends on other
core
targets, etc.) pantsbuild/pants