Fix turbine direct classpaths for targets with no deps
If the list of direct deps is empty, it's either because the action doesn't
distinguish between direct and transitive deps, or because the target has no
deps at all. The 'direct classpath optimization' can still be applied in the
latter case.
@@ -487,7 +487,7 @@ public class JavaHeaderCompileAction extends SpawnAction {
/** Returns true if the header compilation classpath should only include direct deps. */
boolean useDirectClasspath() {
- if (directJars.isEmpty()) {
+ if (directJars.isEmpty() && !classpathEntries.isEmpty()) {
// the compilation doesn't distinguish direct deps, e.g. because it doesn't support strict
// java deps
return false;
