https://pantsbuild.org/ logo
#development
Title
# development
f

fast-nail-55400

10/18/2021, 10:05 PM
@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

witty-crayon-22786

10/18/2021, 10:23 PM
It just means something failed to compile
Add the @logging decorator from the rule_runner package to your test method
f

fast-nail-55400

10/18/2021, 11:07 PM
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

bored-art-40741

10/19/2021, 1:58 AM
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

fast-nail-55400

10/19/2021, 2:15 AM
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

bored-art-40741

10/19/2021, 2:53 AM
Ahh yeah, that would do it