https://pantsbuild.org/ logo
#general
Title
# general
r

red-balloon-89377

12/11/2019, 2:18 PM
Maybe not the best place to put it, but any intuition on why the v1
context.target_roots
is a list and not a set?
e

enough-analyst-54434

12/11/2019, 3:02 PM
Off the top of my head, target_roots (at one point?) represented the targets listed by a user on the CLI. They could certainly list a target more than once. I'm not sure that's the reason though.
r

red-balloon-89377

12/11/2019, 3:03 PM
Hmm, I can’t see why ordering and repeats would matter to any task, but if any task did need ordering, I guess it would make sense to keep them as a list
thanks!
a

aloof-angle-91616

12/11/2019, 3:29 PM
i don’t know of any task that makes use of the ordering of targets on the command line (except maybe ./pants paths??)
tasks will and should typically use topological_order=True in self.invalidated() if they want ordering
r

red-balloon-89377

12/11/2019, 3:31 PM
I agree 🙂 But that’s a different kind of ordering, not what the user specified. I can’t see a reason to not turn it into a set, just wanted to ask if someone knew off the top of their heads
e

enough-analyst-54434

12/11/2019, 7:08 PM
Agreed on
./pants paths
example being pertinent here. I can't think of an example that breaks with deduping though. That said, it seems to make sense to keep some faithful representation of the initial request somewhere for access by rules.
5 Views