Repository dependencies in workspace rules #8780
Labels
not stale
Issues or PRs that are inactive but not considered stale
P3
We're not considering working on this, but happy to review a PR. (No assignee)
team-ExternalDeps
External dependency handling, remote repositiories, WORKSPACE file.
type: feature request
Description of the problem / feature request:
In a workspace rule, I can specify attributes of Label type. These labels, however, can only be used in limited ways. In particular, when fed to
repository_ctx.path()
they must refer to one regular file, and a regular file at that, and one that can't be generated. If I want one external repository A to depend on the entire content of another repository B, I can't express that. I have to list specific files as inputs. If the content of those files I list as inputs doesn't change as frequently as B, then I get an under approximation of how often the rule for A has to be rerun.Feature requests: what underlying problem are you trying to solve with this feature?
In
BUILD
files, I can depend on targets rather than files. So I can have a target that stands for say a filegroup of all files under a directory. InWORKSPACE
files, I don't have that. Understandably, I can't depend on generated files, but it would be very convenient if target-like special cases would be supported. For example, I would imagine that allowing a label that refers to the entire external repository would be easy to implement.For the sake of discussion, let me steal some syntax for such a label. Say
@foo
means "all the files in repository foo". Then I could have:Then Bazel would always rerun the rule for
@bar
if it reran the rule for@foo
.cc @guibou
The text was updated successfully, but these errors were encountered: