bazelbuild / intellij

IntelliJ plugin for Bazel projects
https://ij.bazel.build/
Apache License 2.0
764 stars 304 forks source link

[Bazel CI] No repository visible as '@android_studio_2023_1' from main repository with Bazel@HEAD #6680

Closed sgowroji closed 1 month ago

sgowroji commented 2 months ago

CI: https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/4087#01919c53-4f61-459b-9d5d-440eb41ecd70

Platform: Ubuntu

Logs:

(04:10:41) ERROR: no such package '@@[unknown repo 'android_studio_2023_1' requested from @@]//': The repository '@@[unknown repo 'android_studio_2023_1' requested from @@]' could not be resolved: No repository visible as '@android_studio_2023_1' from main repository
(04:10:41) ERROR: /var/lib/buildkite-agent/builds/bk-docker-1lm9/bazel-org-repo-root/intellij/intellij_platform_sdk/BUILD:1125:10: no such package '@@[unknown repo 'android_studio_2023_1' requested from @@]//': The repository '@@[unknown repo 'android_studio_2023_1' requested from @@]' could not be resolved: No repository visible as '@android_studio_2023_1' from main repository and referenced by '//intellij_platform_sdk:application_info_json'
(04:10:41) ERROR: Analysis of target '//aswb:normal_integration_tests_api_version' failed; build aborted: Analysis failed
(04:10:41) INFO: Elapsed time: 1.694s, Critical Path: 0.07s
(04:10:41) INFO: 5 processes: 5 internal.
(04:10:41) ERROR: Build did NOT complete successfully
(04:10:41) FAILED:

Culprit: bazelbuild/bazel@5881c38

Steps:

 git clone https://github.com/bazelbuild/intellij
git reset a510e66ce2b8ba468c144f2b13c564dbeb294ae6  --hard
export USE_BAZEL_VERSION=00f45195f34bf31b021c6a9568189f4f871ad6ff
bazel build //aswb/... 

CC Greenteam @mai93

sgowroji commented 2 months ago

Clion https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/4087#01919c53-5810-4aea-8110-dbff1ac35721

IntelliJ https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/4087#01919c53-5c30-4338-8290-14e814beb6e5

IntelliJ Aspect https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/4087#01919c53-5e6c-4590-99cc-cbf932e1bc31

We are seeing the above error in all Platforms.

sgowroji commented 2 months ago
bazel --nosystem_rc --nohome_rc info
FATAL: bazel crashed due to an internal error. Printing stack trace:
java.lang.IllegalStateException: java.lang.RuntimeException: Unrecoverable error while evaluating node 'PlatformMappingValue.Key{path=platform_mappings, wasExplicitlySetByUser=false}' (requested by nodes 'BuildConfigurationKeyValue.Key{buildOptions=10a2664ab920803a5609c68f17a5d3320fbcbd70c7c12a0fdd8ee360e5f677b1}')
    at com.google.devtools.build.lib.skyframe.SkyframeExecutor.evaluateSkyKeys(SkyframeExecutor.java:2026)
    at com.google.devtools.build.lib.skyframe.SkyframeExecutor.evaluateSkyKeys(SkyframeExecutor.java:2002)
    at com.google.devtools.build.lib.skyframe.SkyframeExecutor.createBuildConfigurationKey(SkyframeExecutor.java:1958)
    at com.google.devtools.build.lib.skyframe.SkyframeExecutor.getConfiguration(SkyframeExecutor.java:1882)
    at com.google.devtools.build.lib.runtime.commands.InfoCommand.lambda$exec$0(InfoCommand.java:158)
    at com.google.common.base.Suppliers$NonSerializableMemoizingSupplier.get(Suppliers.java:181)
    at com.google.devtools.build.lib.runtime.commands.InfoCommand.exec(InfoCommand.java:219)
    at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.execExclusively(BlazeCommandDispatcher.java:679)
    at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.exec(BlazeCommandDispatcher.java:252)
    at com.google.devtools.build.lib.server.GrpcServerImpl.executeCommand(GrpcServerImpl.java:607)
    at com.google.devtools.build.lib.server.GrpcServerImpl.lambda$run$1(GrpcServerImpl.java:676)
    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)
Caused by: java.lang.RuntimeException: Unrecoverable error while evaluating node 'PlatformMappingValue.Key{path=platform_mappings, wasExplicitlySetByUser=false}' (requested by nodes 'BuildConfigurationKeyValue.Key{buildOptions=10a2664ab920803a5609c68f17a5d3320fbcbd70c7c12a0fdd8ee360e5f677b1}')
    at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:547)
    at com.google.devtools.build.lib.concurrent.AbstractQueueVisitor$WrappedRunnable.run(AbstractQueueVisitor.java:435)
    at java.base/java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(Unknown Source)
    at java.base/java.util.concurrent.ForkJoinTask.doExec(Unknown Source)
    at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(Unknown Source)
    at java.base/java.util.concurrent.ForkJoinPool.scan(Unknown Source)
    at java.base/java.util.concurrent.ForkJoinPool.runWorker(Unknown Source)
    at java.base/java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source)
Caused by: java.lang.NullPointerException: Null repoMapping
    at com.google.devtools.build.lib.cmdline.AutoValue_Label_RepoContextImpl.<init>(AutoValue_Label_RepoContextImpl.java:20)
    at com.google.devtools.build.lib.cmdline.Label$RepoContext.of(Label.java:122)
    at com.google.devtools.build.lib.skyframe.config.PlatformMappingFunction.compute(PlatformMappingFunction.java:82)
    at com.google.devtools.build.lib.skyframe.config.PlatformMappingFunction.compute(PlatformMappingFunction.java:60)
    at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:467)
    ... 7 more
tpasternak commented 2 months ago

🤔 I'm not sure if we can fix it on our side

sgowroji commented 2 months ago

Hi @tpasternak , Above failures are related to Bazel downstream CI,  And @meteorcloudy is working on it.

tpasternak commented 2 months ago

Thanks!

meteorcloudy commented 2 months ago

This is due to https://github.com/bazelbuild/bazel/issues/23023. After --enable_workspace is flipped to false, users have to explicitly specify it where it's needed, or fully migrate to Bzlmod.

mai93 commented 2 months ago

We have bzlmod enabled in the master branch, example failure where --enable_bzlmod is used. From the build output:

(04:23:33) INFO: Reading rc options for 'build' from /var/lib/buildkite-agent/builds/bk-docker-vspt/bazel-org-repo-root/intellij/.bazelrc:
--
  | Inherited 'common' options: --enable_bzlmod
mai93 commented 1 month ago

I think we still need to add --enable_workspace even though we have --enable_bzlmod because we have some dependencies brought in from WORKSPACE.bzlmod. I moved some http_archive to MODULE.bazel in (https://github.com/bazelbuild/intellij/pull/6724). The remaining in WORKSPACE.bzlmod is rules_scala

agluszak commented 1 month ago

rules_scala, the usual suspect :)