bazel-contrib / rules_go

Go rules for Bazel
Apache License 2.0
1.39k stars 664 forks source link

[Bazel CI] FATAL: Bazel crashed due to an internal error while evaluating node #4078

Open sgowroji opened 2 months ago

sgowroji commented 2 months ago

CI: https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/4093#0191abc3-d4cb-40d4-91ac-5d7e907b960f

Platform: Multiple

Logs:

bazel --nosystem_rc --nohome_rc info
WARNING: Option 'experimental_enable_bzlmod' is deprecated: Use --enable_bzlmod instead
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=1a1e367614cf4c436a40b59b0da811d24bd9acb481ab2d9d559457b7aabecffd}')
    at com.google.devtools.build.lib.skyframe.SkyframeExecutor.evaluateSkyKeys(SkyframeExecutor.java:2030)
    at com.google.devtools.build.lib.skyframe.SkyframeExecutor.evaluateSkyKeys(SkyframeExecutor.java:2006)
    at com.google.devtools.build.lib.skyframe.SkyframeExecutor.createBuildConfigurationKey(SkyframeExecutor.java:1962)
    at com.google.devtools.build.lib.skyframe.SkyframeExecutor.getConfiguration(SkyframeExecutor.java:1886)
    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=1a1e367614cf4c436a40b59b0da811d24bd9acb481ab2d9d559457b7aabecffd}')
    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

Culprit: https://github.com/bazelbuild/bazel/commit/5881c38

Note : This issue 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.

CC Greenteam @fweikert

fmeum commented 2 months ago

@meteorcloudy @sgowroji rules_go isn't compatible with --noenable_workspace yet, but this crash looks more like a Bazel issue.

Wyverald commented 2 months ago

FYI the crash is fixed on HEAD (https://github.com/bazelbuild/bazel/commit/04a16741bac276a346223cb5970c5df7580d6d44).