I'm unable to enable --incompatible_stop_exporting_language_modules because rules_java still relies on the native (i.e. not from rules_cc) CcInfo in one place:
https://github.com/bazelbuild/rules_java/blob/master/java/common/rules/java_import.bzl#L59
I've tried adding --incompatible_autoload_externally=CcInfo to my Bazel options, but I receive this error:
java.lang.IllegalStateException: Symbol 'CcInfo' can't be removed, because it's still used by: java_library, java_import, java_runtime, java_binary, java_common, JavaInfo
at com.google.devtools.build.lib.packages.AutoloadSymbols.<init>(AutoloadSymbols.java:214)
at com.google.devtools.build.lib.skyframe.SkyframeExecutor.preparePackageLoading(SkyframeExecutor.java:1500)
at com.google.devtools.build.lib.skyframe.SkyframeExecutor.syncPackageLoading(SkyframeExecutor.java:2727)
at com.google.devtools.build.lib.skyframe.SkyframeExecutor.sync(SkyframeExecutor.java:2682)
at com.google.devtools.build.lib.skyframe.SequencedSkyframeExecutor.sync(SequencedSkyframeExecutor.java:282)
at com.google.devtools.build.lib.runtime.CommandEnvironment.syncPackageLoading(CommandEnvironment.java:779)
at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.execExclusively(BlazeCommandDispatcher.java:585)
at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.exec(BlazeCommandDispatcher.java:253)
at com.google.devtools.build.lib.server.GrpcServerImpl.executeCommand(GrpcServerImpl.java:607)
at com.google.devtools.build.lib.server.GrpcServerImpl.lambda$run$0(GrpcServerImpl.java:677)
at io.grpc.Context$1.run(Context.java:566)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
When I instead use --incompatible_autoload_externally=+CcInfo, I receive this error:
ERROR: /home/jpeterson/.cache/bazel/_bazel_jpeterson/efdf13d3d934dae6a315d1b620777c3e/external/rules_java+/java/common/rules/java_import.bzl:59:23: CcInfo may only be used from one of the following repositories or prefixes: @@_builtins//, @@bazel_tools//, @@local_config_cc//, @@rules_cc//, tools/build_defs/cc. It may be temporarily re-enabled for general use by setting --incompatible_stop_exporting_language_modules=false
Could we explicitly load CcInfo in java_import.bzl, or is it not imported there for a reason?
I'm unable to enable
--incompatible_stop_exporting_language_modulesbecause rules_java still relies on the native (i.e. not fromrules_cc)CcInfoin one place:https://github.com/bazelbuild/rules_java/blob/master/java/common/rules/java_import.bzl#L59
I've tried adding
--incompatible_autoload_externally=CcInfoto my Bazel options, but I receive this error:When I instead use
--incompatible_autoload_externally=+CcInfo, I receive this error:Could we explicitly
loadCcInfoinjava_import.bzl, or is it not imported there for a reason?