witty-crayon-22786
07/23/2020, 12:22 AMwitty-crayon-22786
07/23/2020, 12:25 AMhundreds-father-404
07/23/2020, 12:26 AMhundreds-father-404
07/23/2020, 12:26 AMpython_requirement_library
)witty-crayon-22786
07/23/2020, 12:29 AMwitty-crayon-22786
07/23/2020, 12:30 AMhundreds-father-404
07/23/2020, 12:37 AMwitty-crayon-22786
07/23/2020, 4:38 PMwitty-crayon-22786
07/23/2020, 4:41 PM(Target, Optional[File])
or (Address, Optional[File])
is that it doesn’t address the fact that Target
owns zero or more sources right nowwitty-crayon-22786
07/23/2020, 4:42 PMAddress
being either a “for a file” or a “for a target” makes sensehundreds-father-404
07/23/2020, 4:43 PMis that it doesn’t address the fact that Target owns zero or more sources right nowIt addresses in that you would have one pair for each file belonging to a target. If you don’t care about files, we strip those all back down into just the single `Address`/`Target`
witty-crayon-22786
07/23/2020, 4:44 PMwitty-crayon-22786
07/23/2020, 4:44 PMwitty-crayon-22786
07/23/2020, 4:45 PMwitty-crayon-22786
07/23/2020, 4:45 PMwitty-crayon-22786
07/23/2020, 4:45 PMTarget
itself could have the optional file.witty-crayon-22786
07/23/2020, 4:46 PM(Fields, Optional[Source])
witty-crayon-22786
07/23/2020, 4:47 PMhundreds-father-404
07/23/2020, 4:48 PMAddress
?
Is your proposal basically “generated subtargets, but always used no matter what”?witty-crayon-22786
07/23/2020, 4:48 PMhundreds-father-404
07/23/2020, 4:49 PMwitty-crayon-22786
07/23/2020, 4:49 PMwitty-crayon-22786
07/23/2020, 4:49 PMwitty-crayon-22786
07/23/2020, 4:49 PMhundreds-father-404
07/23/2020, 4:51 PMwhen you generate a base targetDo you know what BUILD files would look like? If we allow you to still have a target in a BUILD file that has multiple files in its
sources
, then I think this needs to be flipped. Our starting point is the base target which has multiple files. From there, we can generate the subtargets. I think you’re proposing that then from there, we can generate a new base target that no longer owns sources?witty-crayon-22786
07/23/2020, 4:51 PMwitty-crayon-22786
07/23/2020, 4:52 PMwitty-crayon-22786
07/23/2020, 4:52 PMwitty-crayon-22786
07/23/2020, 4:53 PMhundreds-father-404
07/23/2020, 4:54 PMdependees
.
My criticisms of generated subtargets are almost entirely based on the user experience of things like file args vs. target args giving a different experience. Afaict, this would still be the case.witty-crayon-22786
07/23/2020, 4:55 PMMy criticisms of generated subtargets are almost entirely based on the user experience of things like file args vs. target args giving a different experience. Afaict, this would still be the case.that part isn’t clear to me actually. it depends what the rules do with the targets.
witty-crayon-22786
07/23/2020, 4:56 PMhundreds-father-404
07/23/2020, 4:56 PMwitty-crayon-22786
07/23/2020, 4:56 PMhundreds-father-404
07/23/2020, 4:57 PMwhat rules would do today would be run each subtarget individuallyThis is already the case with generated subtargets, though? I don’t understand how this improves upon the current implementation.
witty-crayon-22786
07/23/2020, 4:57 PMwitty-crayon-22786
07/23/2020, 4:58 PMwitty-crayon-22786
07/23/2020, 4:58 PMhundreds-father-404
07/23/2020, 4:58 PMi mean that it would happen uniformly, regardless of the CLI specsSo, with something like the current
pytest_runner.py
implementation, you’re saying that no matter what we would always run one-file-at-a-time?witty-crayon-22786
07/23/2020, 4:59 PMwitty-crayon-22786
07/23/2020, 4:59 PMwitty-crayon-22786
07/23/2020, 5:00 PMwitty-crayon-22786
07/23/2020, 5:00 PMwitty-crayon-22786
07/23/2020, 5:01 PMwitty-crayon-22786
07/23/2020, 5:02 PMhundreds-father-404
07/23/2020, 5:02 PMit would be uniformI see. And I acknowledge that uniformity is one of my main criticisms of generated subtargets / file level deps. An alternative, maybe simpler, approach would be to make changes so that file arguments always no matter what use generated subtargets. We could do that if we add the way to disambiguate between multiple owners, e.g.
@
. Then, with file args, you always get generated subtargets. With target args, you always get normal targetswitty-crayon-22786
07/23/2020, 5:03 PMAn alternative, maybe simpler, approach would be to make changes so that file arguments always no matter what use generated subtargets.yes, i think that this should happen… this was one of the things that i think we agreed on in the design session
witty-crayon-22786
07/23/2020, 5:03 PM./pants test ::
and ./pants test '**/*'
would be different, and that that is ok.hundreds-father-404
07/23/2020, 5:03 PMwitty-crayon-22786
07/23/2020, 5:04 PMwitty-crayon-22786
07/23/2020, 5:05 PMhundreds-father-404
07/23/2020, 5:05 PMthis was one of the things that i think we agreed on in the design sessionIndeed. But we punted on it to avoid inventing this new disambiguation syntax. I think the past two weeks show it may be worth it.
hundreds-father-404
07/23/2020, 5:05 PMwitty-crayon-22786
07/23/2020, 5:07 PMwitty-crayon-22786
07/23/2020, 5:07 PMhappy-kitchen-89482
07/23/2020, 5:42 PMtarget_type(sources=[a, b, c], field1=foo, field2=bar)
acts like a macro that expands to
target_type(source=a, field1=foo, field2=bar)
target_type(source=b, field1=foo, field2=bar)
target_type(source=c, field1=foo, field2=bar)
happy-kitchen-89482
07/23/2020, 5:43 PMhappy-kitchen-89482
07/23/2020, 5:43 PMwitty-crayon-22786
07/23/2020, 5:43 PMwitty-crayon-22786
07/23/2020, 5:43 PMwitty-crayon-22786
07/23/2020, 5:43 PMtarget_type(dependencies=['a', 'b', 'c'], field1=foo, field2=bar)
target_type(source=a, field1=foo, field2=bar)
target_type(source=b, field1=foo, field2=bar)
target_type(source=c, field1=foo, field2=bar)
witty-crayon-22786
07/23/2020, 5:44 PMhappy-kitchen-89482
07/23/2020, 5:51 PMwitty-crayon-22786
07/23/2020, 5:57 PM