In the upgrade of rules_java from 8.14.0 to 8.15.2 , the java compiler gets much picker about missing transitive dependencies.
As a result trying to build a pkl_java_library (like as follows)
pkl_java_library(
name = "schema",
srcs = [
"//project/src/main/resources:schema.pkl",
],
generate_getters = False,
visibility = ["//:__subpackages__"],
)
fails with this error:
ConnectService.java:68: error: [strict] Using type org.pkl.core.Duration from an indirect dependency (TOOL_INFO: "@@rules_jvm_external++maven+rules_pkl_deps//:org_pkl_lang_pkl_core"). See command below **
public final @NonNull Duration startStopTimeout;
^
** Please add the following dependencies:
@@rules_jvm_external++maven+rules_pkl_deps//:org_pkl_lang_pkl_core to //project/src/main/java/com/config/pkl/schema:schema_compiled
The obvious solution of adding pkl_java_deps = ["@rules_pkl//:org_pkl_lang_pkl_core"], to work around this problem the build then fails with the following:
ERROR: error loading package '@@rules_pkl+//': Unable to find package for @@[unknown repo 'bazel_gazelle' requested from @@rules_pkl+]//:def.bzl: The repository '@@[unknown repo 'bazel_gazelle' requested from @@rules_pkl+]' could not be resolved: No repository visible as '@bazel_gazelle' from repository '@@rules_pkl+'.
ERROR: /project/src/main/java/com/pkl/schema/BUILD.bazel:3:17: error loading package '@@rules_pkl+//': Unable to find package for @@[unknown repo 'bazel_gazelle' requested from @@rules_pkl+]//:def.bzl: The repository '@@[unknown repo 'bazel_gazelle' requested from @@rules_pkl+]' could not be resolved: No repository visible as '@bazel_gazelle' from repository '@@rules_pkl+'. and referenced by '//build:target'
Workaround: Downgrade your rules_java to 8.14.0 until this can be fixed.
In the upgrade of
rules_javafrom 8.14.0 to 8.15.2 , the java compiler gets much picker about missing transitive dependencies.As a result trying to build a
pkl_java_library(like as follows)fails with this error:
The obvious solution of adding
pkl_java_deps = ["@rules_pkl//:org_pkl_lang_pkl_core"],to work around this problem the build then fails with the following:Workaround: Downgrade your
rules_javato 8.14.0 until this can be fixed.