Weird. The dep cycle issue reported in <#CGZFJRY85...
# development
h
Weird. The dep cycle issue reported in #pantsd is only when the Protobuf dependency injection rules are triggered, and only when using transitive deps. When using transitive deps, the last line of the below doesn’t resolve properly. It gives back a reference to only one target, and the wrong target:
Copy code
@rule
async def transitive_target(wrapped_root: WrappedTarget) -> TransitiveTarget:
    root = wrapped_root.target
    if not root.has_field(Dependencies):
        return TransitiveTarget(root, ())
    dependency_addresses = await Get[Addresses](DependenciesRequest(root[Dependencies]))
Unregistering the protobuf rule fixes it all.
e
As with the last bug, if the issue is only in pantsd equals/hash are the prime suspects. Has that class of issue been ruled out?
h
I think, as this fails without pantsd too.
e
Is
root[Dependencies]
legit? I though Dependencies were async now and had to be awaited.
h
root[Dependencies]
gets the
Dependencies
field, which stores a
sanitized_raw_value
. Then, you say
await Get[Addresses](DependenciesRequest(dependencies_field))
e
Oh.. can answer that from context. Dependencies must just be strings
h
Yes. Technically, the
sanitized_raw_value
is a
Tuple[Address, ...]
because of the
@addressable
mechanism
Oh, one other key detail. My pdb statement in the resolve_dependencies rule never triggers with Protobuf activated, but otherwise it does. Meaning, I think, the
await Get
is being satisfied some other way