bazelbuild / bazelbuild/bazel

host flag_alias crash @ HEAD

Open
#29,384 5 comments 0 reactions 2 assignees Claimed by @aranguyen View on GitHub
P1 team-Configurability type: bug
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 20h
Merged PRs (30d)
72

Description

### Description of the bug:

You get this crash:

```
FATAL: bazel crashed due to an internal error. Printing stack trace:
java.lang.NullPointerException: Cannot invoke "com.google.devtools.build.lib.analysis.starlark.StarlarkBuildSettingsDetailsValue.customExecScopeValues()" because "details" is null
at com.google.devtools.build.lib.analysis.config.StarlarkTransitionCache.getDefaultStarlarkOptionsForCustomExec(StarlarkTransitionCache.java:132)
at com.google.devtools.build.lib.skyframe.SkyframeExecutor.adjustForExec(SkyframeExecutor.java:1627)
at com.google.devtools.build.lib.skyframe.SkyframeExecutor.adjustForExec(SkyframeExecutor.java:1575)
at com.google.devtools.build.lib.skyframe.SkyframeExecutor.setBaselineConfiguration(SkyframeExecutor.java:1560)
at com.google.devtools.build.lib.runtime.commands.InfoCommand.lambda$exec$0(InfoCommand.java:190)
at com.google.common.base.Suppliers$NonSerializableMemoizingSupplier.get(Suppliers.java:201)
at com.google.devtools.build.lib.runtime.commands.InfoCommand.exec(InfoCommand.java:253)
at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.execExclusively(BlazeCommandDispatcher.java:754)
at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.exec(BlazeCommandDispatcher.java:267)
at com.google.devtools.build.lib.server.CommandServer.run(CommandServer.java:506)
at com.google.devtools.build.lib.server.GrpcCommandServerImpl.lambda$run$0(GrpcCommandServerImpl.java:237)
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 you run `bazel info --flag_alias=host_foo=@foo//:test` with a simple `string_flag`:

```bzl
load("@bazel_skylib//rules:common_settings.bzl", "string_flag")

string_flag(
name = "test",
build_setting_default = "value",
)
```

`bazel build` doesn't repro the crash. It also doesn't repro without the `host_` prefix

### 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.

Run `USE_BAZEL_VERSION=b4c70250363f96ea6c008255fa14393fe5763bd2 bazel info` in this project [repro.zip](https://github.com/user-attachments/files/27020399/repro.zip)

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

_No response_

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

b4c70250363f96ea6c008255fa14393fe5763bd2

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

Bisected to https://github.com/bazelbuild/bazel/commit/b4c70250363f96ea6c008255fa14393fe5763bd2

### 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.

_No response_

### 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

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.