<@U06A03HV1> / <@U053HNE90>: I’m triggering the co...
# development
f
@witty-crayon-22786 / @bored-art-40741: I’m triggering the condition at https://github.com/pantsbuild/pants/blob/372b368aa08e667b5e4557082be4f0a7c2a2277e/src/python/pants/backend/java/compile/javac.py#L73-L79 when switching from file sibling deps to same pacage type inference for Java. what does that condition represent?
w
It just means something failed to compile
Add the @logging decorator from the rule_runner package to your test method
f
that worked. thanks.
Copy code
lib/A.java:2: error: package org.pantsbuild.b does not exist
import org.pantsbuild.b.B;
                       ^
lib/A.java:4: error: cannot find symbol
class C implements B {}
                   ^
  symbol: class B
2 errors
19:05:57.83 [ERROR] Completed: Compile with javac - lib/B.java failed (exit code 1).
lib/B.java:2: error: package org.pantsbuild.a does not exist
import org.pantsbuild.a.A;
                       ^
lib/B.java:4: error: cannot find symbol
class C implements A {}
                   ^
  symbol: class A
2 errors
the test is putting files from different packages into the same java_sources target (i.e., not 111) and expecting sibling file inference to be in effect. although java import dep inference should have provided the dep.
b
Some of those tests were designed to document how things worked at the time, without necessarily being regression tests to show that that's how things should work
So at the very least if you're making changing to dep inference, it should break in ways you expect, and the test can be updated (or removed) accordingly
f
it works once I added the dep inference rules to the RuleRunner
these tests probably need an assertion that the expected UnionRule’s are registered
will add to the PR
b
Ahh yeah, that would do it