Skip to content

[9.0.1] Fix NPE caused by --repo_env with no value set (https://github.com/bazelbuild/bazel/pull/28606)#28640

Merged
iancha1992 merged 1 commit intobazelbuild:release-9.0.1from
bazel-io:cp28606-9.0.1
Feb 14, 2026
Merged

[9.0.1] Fix NPE caused by --repo_env with no value set (https://github.com/bazelbuild/bazel/pull/28606)#28640
iancha1992 merged 1 commit intobazelbuild:release-9.0.1from
bazel-io:cp28606-9.0.1

Conversation

@bazel-io
Copy link
Copy Markdown
Member

This is to address #28605. bazel crashes with NullPointerException in case --repo_env=NON_EXISTENT is used with no value set in user's local environment. It worked in 8.5.1 but doesn't in 9.0.0 so it seems like a regression.

Closes #28606.

PiperOrigin-RevId: 868871905
Change-Id: I0ecd9a4b76b7795e1f00583050aaf343fe930832

Commit b55b69d

This is to address bazelbuild#28605. bazel crashes with `NullPointerException` in case `--repo_env=NON_EXISTENT` is used with no value set in user's local environment. It worked in `8.5.1` but doesn't in `9.0.0` so it seems like a regression.

Closes bazelbuild#28606.

PiperOrigin-RevId: 868871905
Change-Id: I0ecd9a4b76b7795e1f00583050aaf343fe930832
@bazel-io bazel-io added the awaiting-review PR is awaiting review from an assigned reviewer label Feb 11, 2026
@bazel-io bazel-io requested a review from a team as a code owner February 11, 2026 23:33
@bazel-io bazel-io requested review from Wyverald, fmeum and katre February 11, 2026 23:33
@bazel-io bazel-io added the awaiting-review PR is awaiting review from an assigned reviewer label Feb 11, 2026
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request addresses a NullPointerException that occurs when --repo_env is used with an environment variable that is not set. The fix correctly prevents the crash by adding a null check before adding the inherited environment variable to the repository environment map. A new regression test is also included to verify the fix. The changes are correct and well-targeted.

@iancha1992 iancha1992 requested review from katre and removed request for katre February 12, 2026 06:49
@iancha1992 iancha1992 added the team-Configurability platforms, toolchains, cquery, select(), config transitions label Feb 12, 2026
@iancha1992 iancha1992 added this pull request to the merge queue Feb 14, 2026
Merged via the queue into bazelbuild:release-9.0.1 with commit 8be4750 Feb 14, 2026
46 checks passed
@github-actions github-actions bot removed the awaiting-review PR is awaiting review from an assigned reviewer label Feb 14, 2026
gh-worker-dd-mergequeue-cf854d bot pushed a commit to DataDog/datadog-agent that referenced this pull request Mar 24, 2026
### What does this PR do?
Upgrade `bazel` from 8.6.0 to 9.0.1.

### Motivation
Bazel 9.0.1 ships upstream fixes that directly benefit our build & developer experience:
- bazelbuild/bazel#26842: `BUILD` files and `build` directories were incorrectly treated as the same entry on case-insensitive filesystems (e.g., Linux container running on a macOS host), causing spurious build failures (esp. for `rloader` we had to `gazelle`-exclude because of that),
- bazelbuild/bazel#27695: a contribution of ours (also available in 8.6.0 as bazelbuild/bazel#28367) - nice to have when sharing a folder between a Linux host and a Windows VM through `virtiofs`,
- bazelbuild/bazel#28640: another contribution of ours (@JSGette) - critical because it what preventing us from switching to Bazel 9 (ADMS config).

### Describe how you validated your changes
`bazel test //...` passes.

### Additional Notes
Groundwork landed in advance:
- #47716
- #47745
- #47982
- #48016
- #48071
- #48082
- #48183
- #48186
- #48200 (>= Bazel 9 min)
- #48201 (>= Bazel 9 min)
- #48228 (>= Bazel 9 min)

Co-authored-by: regis.desgroppes <regis.desgroppes@datadoghq.com>
aya-shimizu24 pushed a commit to DataDog/datadog-agent that referenced this pull request Mar 24, 2026
### What does this PR do?
Upgrade `bazel` from 8.6.0 to 9.0.1.

### Motivation
Bazel 9.0.1 ships upstream fixes that directly benefit our build & developer experience:
- bazelbuild/bazel#26842: `BUILD` files and `build` directories were incorrectly treated as the same entry on case-insensitive filesystems (e.g., Linux container running on a macOS host), causing spurious build failures (esp. for `rloader` we had to `gazelle`-exclude because of that),
- bazelbuild/bazel#27695: a contribution of ours (also available in 8.6.0 as bazelbuild/bazel#28367) - nice to have when sharing a folder between a Linux host and a Windows VM through `virtiofs`,
- bazelbuild/bazel#28640: another contribution of ours (@JSGette) - critical because it what preventing us from switching to Bazel 9 (ADMS config).

### Describe how you validated your changes
`bazel test //...` passes.

### Additional Notes
Groundwork landed in advance:
- #47716
- #47745
- #47982
- #48016
- #48071
- #48082
- #48183
- #48186
- #48200 (>= Bazel 9 min)
- #48201 (>= Bazel 9 min)
- #48228 (>= Bazel 9 min)

Co-authored-by: regis.desgroppes <regis.desgroppes@datadoghq.com>
StephenWakely pushed a commit to DataDog/datadog-agent that referenced this pull request Mar 27, 2026
### What does this PR do?
Upgrade `bazel` from 8.6.0 to 9.0.1.

### Motivation
Bazel 9.0.1 ships upstream fixes that directly benefit our build & developer experience:
- bazelbuild/bazel#26842: `BUILD` files and `build` directories were incorrectly treated as the same entry on case-insensitive filesystems (e.g., Linux container running on a macOS host), causing spurious build failures (esp. for `rloader` we had to `gazelle`-exclude because of that),
- bazelbuild/bazel#27695: a contribution of ours (also available in 8.6.0 as bazelbuild/bazel#28367) - nice to have when sharing a folder between a Linux host and a Windows VM through `virtiofs`,
- bazelbuild/bazel#28640: another contribution of ours (@JSGette) - critical because it what preventing us from switching to Bazel 9 (ADMS config).

### Describe how you validated your changes
`bazel test //...` passes.

### Additional Notes
Groundwork landed in advance:
- #47716
- #47745
- #47982
- #48016
- #48071
- #48082
- #48183
- #48186
- #48200 (>= Bazel 9 min)
- #48201 (>= Bazel 9 min)
- #48228 (>= Bazel 9 min)

Co-authored-by: regis.desgroppes <regis.desgroppes@datadoghq.com>
StephenWakely pushed a commit to DataDog/datadog-agent that referenced this pull request Mar 27, 2026
### What does this PR do?
Upgrade `bazel` from 8.6.0 to 9.0.1.

### Motivation
Bazel 9.0.1 ships upstream fixes that directly benefit our build & developer experience:
- bazelbuild/bazel#26842: `BUILD` files and `build` directories were incorrectly treated as the same entry on case-insensitive filesystems (e.g., Linux container running on a macOS host), causing spurious build failures (esp. for `rloader` we had to `gazelle`-exclude because of that),
- bazelbuild/bazel#27695: a contribution of ours (also available in 8.6.0 as bazelbuild/bazel#28367) - nice to have when sharing a folder between a Linux host and a Windows VM through `virtiofs`,
- bazelbuild/bazel#28640: another contribution of ours (@JSGette) - critical because it what preventing us from switching to Bazel 9 (ADMS config).

### Describe how you validated your changes
`bazel test //...` passes.

### Additional Notes
Groundwork landed in advance:
- #47716
- #47745
- #47982
- #48016
- #48071
- #48082
- #48183
- #48186
- #48200 (>= Bazel 9 min)
- #48201 (>= Bazel 9 min)
- #48228 (>= Bazel 9 min)

Co-authored-by: regis.desgroppes <regis.desgroppes@datadoghq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team-Configurability platforms, toolchains, cquery, select(), config transitions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants