bazelbuild / bazelbuild/bazel

[9.1.0] Crash on `files` attr in `archive_override`

Closed
#29,437 4 comments 0 reactions 0 assignees View on GitHub
help wanted P2 team-ExternalDeps type: bug
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 20h
Merged PRs (30d)
72

Description

### Description of the bug:

When using the `files` attr in `archive_override` to override the MODULE.bazel, bazel crashes.

```
FATAL: bazel crashed due to an internal error. Printing stack trace:
java.lang.UnsupportedOperationException: unexpected access of cycle details
at com.google.devtools.build.skyframe.CycleInfo$CycleInfoNoDetails.getTopKey(CycleInfo.java:124)
at com.google.devtools.build.lib.bazel.commands.ModCommand.execInternal(ModCommand.java:301)
at com.google.devtools.build.lib.bazel.commands.ModCommand.exec(ModCommand.java:133)
at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.execExclusively(BlazeCommandDispatcher.java:783)
at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.exec(BlazeCommandDispatcher.java:266)
at com.google.devtools.build.lib.server.GrpcServerImpl.executeCommand(GrpcServerImpl.java:608)
at com.google.devtools.build.lib.server.GrpcServerImpl.lambda$run$0(GrpcServerImpl.java:682)
at io.grpc.Context$1.run(Context.java:566)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1583)

```

### Which category does this issue belong to?

_No response_

### What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

```
bazel_dep(name = "example")
archive_override(
module_name = "example",
files = {"MODULE.bazel": "//override.MODULE.bazel"},
)
```

### Which operating system are you running Bazel on?

NixOS / Linux

### What is the output of `bazel info release`?

release 9.1.0- (@non-git)

### If `bazel info release` returns `development version` or `(@non-git)`, tell us how you built Bazel.

I use NixOS to build 9.1.0

### What's the output of `git remote get-url origin; git rev-parse HEAD` ?

```text

```

### If this is a regression, please try to identify the Bazel commit where the bug was introduced with bazelisk --bisect.

I can confirm that this didn't happen in Bazel 8.5.0

### Have you found anything relevant by searching the web?

_No response_

### Any other information, logs, or outputs that you want to share?

_No response_

Contributor guide

Open the contributing guide

Research direction

Reproduce the crash with the minimal MODULE.bazel example and inspect the stack-trace entry points in ModCommand.java and CycleInfo.java. Compare the behavior with Bazel 8.5.0; done means the archive_override files case no longer causes an internal crash in Bazel 9.1.0.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
40/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.