hundreds-father-404
03/25/2020, 4:00 AMalias()
must have the field target
defined.
We could achieve this ad hoc, but do we anticipate this being a useful mechanism? For example, if we elevate it, then we can do nice things like say required
in the output of ./v2 target-types
average-vr-56795
03/25/2020, 11:06 AMaverage-vr-56795
03/25/2020, 11:07 AMaverage-vr-56795
03/25/2020, 11:07 AMaverage-vr-56795
03/25/2020, 11:07 AMhundreds-father-404
03/25/2020, 3:17 PM.py
, but that’s an interesting idea to generalize the mechanism! That’s very easy to do!hundreds-father-404
03/25/2020, 3:18 PMAlso libraries which depend on binaries! Bad!I’m not sure what this will look like yet because we still have to figure out hydration of
Dependencies
. (We start out with List[Address]
. I think hydration means getting a Sequence[Target]
for the direct dependencies). We could add post-hydration validation that no target types have the field BinarySources
average-vr-56795
03/25/2020, 3:32 PMWe already enforce that Python target types must end inI think we enforce that for source files, but not dependencies. I think I can write:,.py
python_library(dependencies = [":some_java_library"])
java_library(name = "some_java_library"])
And everything will be fine and the dep will just be ignored, which is kind of badhundreds-father-404
03/25/2020, 3:36 PMFiles
and Resources
, but that’s achievable.
It gets a little awkward that you can’t say assert isinstance(tgt, Files)
because that breaks custom target types like CustomFiles
, given the field-driven nature of the API. But, we could do assert tgt.has_field(FilesSources)
as a proxy to know it’s a Files targetaverage-vr-56795
03/25/2020, 3:55 PM