Skip to content

In-project --output_user_root triggers the repo contents cache error, even though the target directory is excluded with .bazelignore #26384

Open
@yuyawk

Description

@yuyawk

Description of the bug:

After upgrading bazel from 8.2.1 to 8.3.0, I started to see an error like

ERROR: The repo contents cache [/home/runner/work/rules_build_error/rules_build_error/.cache/bazel/cache/repos/v1/contents] is inside the workspace [/home/runner/work/rules_build_error/rules_build_error]. This can cause spurious failures. Disable the repo contents cache with `--repo_contents_cache=`, or specify `--repo_contents_cache=<path outside the workspace>`.

when setting --output_user_root to the directory inside the project. (I guess this was brought by this commit)

However, this error happens even when that cache directory is listed in .bazelignore, though the directory is ignored and therefore won't cause any spurious failures.

Which category does this issue belong to?

External Dependency

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

When using bazel 8.3.0,

(1) add a line

startup --output_user_root=.cache/bazel

to .bazelrc

(2) add a line

.cache

to .bazelignore

(3) execute a bazel command

(If I comment out the line in .bazelrc the error disappears)

Which operating system are you running Bazel on?

ubuntu 22.04, 24.04

What is the output of bazel info release?

release 8.3.0

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

No response

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

N/A (using the released version)

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

ad74aa5

Have you found anything relevant by searching the web?

N/A

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

Here I put some CI logs indicating the issue:

Metadata

Metadata

Assignees

Labels

P3We're not considering working on this, but happy to review a PR. (No assignee)team-ExternalDepsExternal dependency handling, remote repositiories, WORKSPACE file.type: bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions