bored-art-40741
06/20/2021, 6:28 PMTarget subclass, JavaLibrary. When I use the java_library alias in a BUILD file with two Java sources present (using the default pattern to capture all non-test .java sources), I expect a single JavaLibrary target to be produced in the build graph. But instead, there are 3 targets: //:lib, which depends on //ExampleLib.java:lib and //OtherLib.java:lib (corresponding to the two source files). I can sort of see based on my past experience with Pants why we might be generating "synthetic" targets in this situation to more cleanly encapsulate source files, but here's the catch: the two "synthetic" targets depend on each other (circularly). This doesn't appear to directly upset the build graph, but it does cause my rule to break since it introduces a cycle in the rule graph. Am I using this API wrong, or is this just something that hasn't been an issue for Pants yet because the Python rules don't have to distinguish between direct and transitive dependencies much?bored-art-40741
06/20/2021, 7:23 PMbored-art-40741
06/20/2021, 7:27 PMbored-art-40741
06/20/2021, 8:13 PMTargets in my DependenciesRequest, I ask for ExplicitlyProvidedDependencies. This bypasses Subtarget generation (among other things), and ends up behaving how I expect.bored-art-40741
06/20/2021, 8:35 PMwitty-crayon-22786
06/21/2021, 4:08 PMwitty-crayon-22786
06/21/2021, 4:09 PMwitty-crayon-22786
06/21/2021, 4:09 PMwitty-crayon-22786
06/21/2021, 4:11 PMwitty-crayon-22786
06/21/2021, 4:22 PMbored-art-40741
06/25/2021, 11:53 PMTargets instead of ExplicitlyProvidedDependencies, and then compile at the per-file level, but I'm immediately going to run into issues with subtarget cycles at that point. Do you have a feel for the level of difficulty for adding support to request the coursened graph as a product?witty-crayon-22786
06/26/2021, 12:25 AMwitty-crayon-22786
06/26/2021, 12:31 AMbored-art-40741
06/26/2021, 12:33 AMwitty-crayon-22786
06/26/2021, 1:17 AMwitty-crayon-22786
06/26/2021, 1:18 AMbored-art-40741
06/26/2021, 1:44 AMbored-art-40741
06/26/2021, 10:55 PMTargets and work from there, and I discovered UnparsedAddressInputs, which has a docstring that suggests it does exactly what I want in a test:
await Get(Targets, UnparsedAddressInputs([...], owning_address=Address("original"))bored-art-40741
06/26/2021, 10:55 PMRuleRunner to do this, and I can't find a missing rulebored-art-40741
06/26/2021, 10:56 PMtargets = rule_runner.request(Targets, [UnparsedAddressInputs(["//:lib"], owning_address=None)])bored-art-40741
06/26/2021, 10:56 PME Exception: No installed QueryRules can compute Targets given input Params(UnparsedAddressInputs), but it can be produced using:
E Params(Addresses)bored-art-40741
06/26/2021, 10:56 PMAddresses first, but it seems to be leading me in the wrong direction:
E Exception: No installed QueryRules can compute Addresses given input Params(UnparsedAddressInputs), but it can be produced using:
E Params((OptionsBootstrapper, Specs))bored-art-40741
06/26/2021, 10:59 PMRuleRunner seems to already have an OptionsBootstrapper, so this is where I'm stuckbored-art-40741
06/26/2021, 11:09 PMAddresses into UnexpandedTargets into Targetsbored-art-40741
06/26/2021, 11:11 PMUnparsedAddressInputs -> Addresses, not the restbored-art-40741
06/26/2021, 11:54 PMQueryRule(Targets, [UnparsedAddressInputs])bored-art-40741
06/26/2021, 11:55 PMRuleRunner, it would transitively hook up A -> C if it had A -> B and B -> C, but it doesn'twitty-crayon-22786
06/27/2021, 1:13 AMbored-art-40741
06/27/2021, 1:44 AMwitty-crayon-22786
06/27/2021, 5:57 PMwitty-crayon-22786
06/27/2021, 5:57 PMwitty-crayon-22786
06/27/2021, 5:58 PMbored-art-40741
06/27/2021, 7:17 PMwitty-crayon-22786
06/28/2021, 9:57 PM