witty-crayon-22786
07/15/2020, 1:09 AMhundreds-father-404
07/16/2020, 12:18 AMdependencies
field in BUILD files. Pants will find all the owners of the file; if there’s 1 owner, then we will generate a subtarget from that owner which precisely owns that file. Otherwise, we will error.
What do y’all think about how to specify paths relative to the BUILD file, rather than relative to the BUILD root? Stu proposed `./`:
./relative.txt
//global.txt
demo/foo.txt
aloof-angle-91616
07/16/2020, 12:18 AMaloof-angle-91616
07/16/2020, 12:19 AMhundreds-father-404
07/16/2020, 12:19 AMambiguous.txt
would be the same thing as //ambiguous.txt
, I believe. I don’t love that that differs from the sources
field, but also the sources
field is different in that you can only refer to a child, not an ancestoraloof-angle-91616
07/16/2020, 12:20 AMhundreds-father-404
07/16/2020, 12:20 AMhundreds-father-404
07/16/2020, 12:21 AMdependencies
field is allowing ignores via !:ignore_me
aloof-angle-91616
07/16/2020, 12:22 AMhundreds-father-404
07/16/2020, 12:26 AMAddress
object to include, we will filter out with any excludes. So it solely would impact the result of await Get(Addresses, DependenciesRequest)
.
Unlike sources
, I think that we will possibly error (maybe warn) if an ignore is not applied.
The main motivation is an escape hatch for dep inference, if you don’t like what it inferred.hundreds-father-404
07/16/2020, 12:26 AMThe main motivation is an escape hatch for dep inference, if you don’t like what it inferred.It’d be goofy, but technically possible, to say
dependencies[":foo", "!:foo"]
hundreds-father-404
07/16/2020, 12:27 AMdependencies
for that target. It does not impact anything like transitive dependencies.aloof-angle-91616
07/16/2020, 12:30 AMaloof-angle-91616
07/16/2020, 12:31 AMaloof-angle-91616
07/16/2020, 12:31 AMhundreds-father-404
07/16/2020, 12:32 AMpytest_runner.py
. Rather, pytest_runner.py
gets a normal looking target right now and has no knowledge that it was generatedaloof-angle-91616
07/16/2020, 12:33 AMhundreds-father-404
07/16/2020, 12:33 AMaloof-angle-91616
07/16/2020, 12:35 AMhundreds-father-404
07/16/2020, 12:36 AM!
is meant to align with sources globshundreds-father-404
07/16/2020, 12:36 AMaloof-angle-91616
07/16/2020, 12:37 AMhundreds-father-404
07/16/2020, 12:41 AM@
for disambiguating when there are multiple owning targets for a file. For example, demo/app.txt@:tgt1
vs. demo/app.txt@:tgt2
.
Right now, we avoid that ambiguity ever being an issue, as follows:
- file arguments -> don’t use generated subtargets and use all the original owning targets
- dep infeerence -> no-op
- explicit BUILD files -> error
I personally advocate sticking with that and not using @
. It depends how much we care about making it ergonomic to have multiple owners over the same target.aloof-angle-91616
07/16/2020, 12:43 AMaloof-angle-91616
07/16/2020, 12:44 AMhundreds-father-404
07/16/2020, 12:44 AM@
to allow for the disambiguation. Notably, users would almost never actually have to write something that clunky. It would get inferred. Only the output of things like ./pants list
would show that new syntax.hundreds-father-404
07/16/2020, 12:44 AMhundreds-father-404
07/16/2020, 12:45 AMaloof-angle-91616
07/16/2020, 12:45 AMaloof-angle-91616
07/16/2020, 12:45 AM