ripe-gigabyte-88964
09/25/2023, 2:20 PMB
is a union
with a member type C
- how can I use a rule that goes A -> C
for this get?ripe-gigabyte-88964
09/25/2023, 2:26 PMGet(B, A)
curved-television-6568
09/25/2023, 2:31 PMUnionRule
as described here: https://www.pantsbuild.org/docs/rules-api-unions#how-to-create-a-new-unioncurved-television-6568
09/25/2023, 2:32 PMripe-gigabyte-88964
09/25/2023, 2:34 PMNo installed rules return the type B
where B is the union base.curved-television-6568
09/25/2023, 2:36 PMripe-gigabyte-88964
09/25/2023, 2:38 PMcurved-television-6568
09/25/2023, 2:40 PMcurved-television-6568
09/25/2023, 2:41 PM@dataclass
class WrappedVehicle:
impl: Vehicle
@rule
def create_truck() -> WrappedVehicle:
return WrappedVehicle(Truck())
ripe-gigabyte-88964
09/25/2023, 3:07 PMNo installed rules return the type
for a type that is provided by the caller in every instance. 🤔ripe-gigabyte-88964
09/25/2023, 3:08 PMcurved-television-6568
09/25/2023, 3:08 PMcurved-television-6568
09/25/2023, 3:09 PMripe-gigabyte-88964
09/25/2023, 3:10 PMcurved-television-6568
09/25/2023, 3:10 PMripe-gigabyte-88964
09/25/2023, 3:11 PMcurved-television-6568
09/25/2023, 3:11 PM@union(in_scope_types=[EnvironmentName])
?ripe-gigabyte-88964
09/25/2023, 3:11 PMNo source of dependency Get(DigestContents, [Digest])
😅curved-television-6568
09/25/2023, 3:11 PMripe-gigabyte-88964
09/25/2023, 3:13 PMcurved-television-6568
09/25/2023, 3:13 PMfrom pants.engine.environment import EnvironmentName
btw.. if you didn’t have it.curved-television-6568
09/25/2023, 3:14 PMEnvironment
as input you’d have to provide itcurved-television-6568
09/25/2023, 3:15 PMcurved-television-6568
09/25/2023, 3:17 PMcurved-television-6568
09/25/2023, 3:17 PMripe-gigabyte-88964
09/25/2023, 3:24 PMUnionMembership
parameter even though the input type isn't a union class or member. Could that be the issue?curved-television-6568
09/25/2023, 3:25 PMUnionMembership
parameter is provided by the engine and is always available.curved-television-6568
09/25/2023, 3:26 PMcurved-television-6568
09/25/2023, 3:27 PM-ldebug
in which case you should get a .dot
graph in the logs you can render and make it easier to read the graph and spot the root issue.ripe-gigabyte-88964
09/25/2023, 3:29 PMcurved-television-6568
09/25/2023, 3:29 PMripe-gigabyte-88964
09/25/2023, 3:29 PM.pants.d
curved-television-6568
09/25/2023, 3:31 PM-ltrace
..curved-television-6568
09/25/2023, 3:31 PMripe-gigabyte-88964
09/25/2023, 3:44 PMgraph.001
but not in rule_graph
ripe-gigabyte-88964
09/25/2023, 3:47 PMMultiGet
in this code but I put all of the Get
objects into a dict and pass gets.values()
to the multiget. Could that be screwing with the ast parser?curved-television-6568
09/25/2023, 3:48 PMfresh-cat-90827
09/25/2023, 3:49 PMfresh-cat-90827
09/25/2023, 3:49 PMUnionRule
https://www.pantsbuild.org/docs/advanced-plugin-conceptsfresh-cat-90827
09/25/2023, 3:50 PMcurved-television-6568
09/25/2023, 3:51 PMpants help
that may be useful to see what’s loaded and not. try pants YourType --help-advanced
see what turns up 😉ripe-gigabyte-88964
09/25/2023, 4:05 PMripe-gigabyte-88964
09/25/2023, 4:08 PMcurved-television-6568
09/25/2023, 4:44 PM