Skip to content

[8.8.0] Get the local and remote repo contents cache to work together#29085

Merged
iancha1992 merged 1 commit into
bazelbuild:release-8.8.0from
fmeum:rrcc-8.7.0-19
Jun 24, 2026
Merged

[8.8.0] Get the local and remote repo contents cache to work together#29085
iancha1992 merged 1 commit into
bazelbuild:release-8.8.0from
fmeum:rrcc-8.7.0-19

Conversation

@fmeum

@fmeum fmeum commented Mar 24, 2026

Copy link
Copy Markdown
Collaborator
  • Also upload to the remote cache when the local cache is in use. The fix is simple but subtle: the logic for the two caches in RepositoryFetchFunction has to be flipped since the Skyframe restart after adding an entry to the local cache meant that the same code path would not be taken again.
  • Fix a crash when using both by ensuring that the local repo contents cache uses the file system backing the output base, not the workspace directory:
FATAL: bazel crashed due to an internal error. Printing stack trace:
java.lang.RuntimeException: Unrecoverable error while evaluating node 'REPOSITORY_DIRECTORY:@@rules_python+' (requested by nodes 'REPO_FILE:@@rules_python+')
	at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:552)
Caused by: java.lang.IllegalArgumentException: Files are on different filesystems: .../external/@rules_python+.marker (on RemoteExternalOverlayFileSystem), .../.cache/bazel-repo/contents/_trash/... (on WindowsFileSystem)
	at com.google.devtools.build.lib.vfs.Path.checkSameFileSystem(Path.java:964)
	at com.google.devtools.build.lib.vfs.Path.renameTo(Path.java:630)
	at com.google.devtools.build.lib.vfs.FileSystemUtils.moveFile(FileSystemUtils.java:456)
	at com.google.devtools.build.lib.bazel.repository.cache.LocalRepoContentsCache.moveToCache(LocalRepoContentsCache.java:172)

Closes #28002.

PiperOrigin-RevId: 855211557
Change-Id: I2f3c40a6aef594682fba989853f7ee982f30c294
(cherry picked from commit b143070)

@iancha1992 iancha1992 added this to the 8.7.0 release blockers milestone Mar 27, 2026
@iancha1992 iancha1992 added the soft-release-blocker Soft release blockers that are nice to have, but shouldn't block the release if it's the last one. label Apr 24, 2026
@iancha1992 iancha1992 changed the title [8.7.0] 19/23: Get the local and remote repo contents cache to work together [8.8.0] 19/23: Get the local and remote repo contents cache to work together May 7, 2026
@iancha1992 iancha1992 changed the base branch from release-8.7.0 to release-8.8.0 May 7, 2026 18:07
@github-actions

github-actions Bot commented Jun 7, 2026

Copy link
Copy Markdown

Thank you for contributing to the Bazel repository! This pull request has been marked as stale since it has not had any activity in the last 30 days. It will be closed in the next 30 days unless any other activity occurs. If you think this PR is still relevant and should stay open, please post any comment here and the PR will no longer be marked as stale.

@github-actions github-actions Bot added the stale Issues or PRs that are stale (no activity for 30 days) label Jun 7, 2026
@fmeum fmeum changed the title [8.8.0] 19/23: Get the local and remote repo contents cache to work together [8.8.0] Get the local and remote repo contents cache to work together Jun 23, 2026
@github-actions github-actions Bot removed the stale Issues or PRs that are stale (no activity for 30 days) label Jun 24, 2026
* Also upload to the remote cache when the local cache is in use. The fix is simple but subtle: the logic for the two caches in `RepositoryFetchFunction` has to be flipped since the Skyframe restart after adding an entry to the local cache meant that the same code path would not be taken again.
* Fix a crash when using both by ensuring that the local repo contents cache uses the file system backing the output base, not the workspace directory:
```
FATAL: bazel crashed due to an internal error. Printing stack trace:
java.lang.RuntimeException: Unrecoverable error while evaluating node 'REPOSITORY_DIRECTORY:@@rules_python+' (requested by nodes 'REPO_FILE:@@rules_python+')
	at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:552)
	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.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source)
Caused by: java.lang.IllegalArgumentException: Files are on different filesystems: C:/users/runneradmin/_bazel_runneradmin/ebfu7cpi/external/@rules_python+.marker (on com.google.devtools.build.lib.remote.RemoteExternalOverlayFileSystem@79583b9), C:/Users/runneradmin/.cache/bazel-repo/contents/_trash/26a5feef-bf8c-4326-bf3d-500997c7362e (on com.google.devtools.build.lib.windows.WindowsFileSystem@24180f0f)
	at com.google.devtools.build.lib.vfs.Path.checkSameFileSystem(Path.java:964)
	at com.google.devtools.build.lib.vfs.Path.renameTo(Path.java:630)
	at com.google.devtools.build.lib.vfs.FileSystemUtils.moveFile(FileSystemUtils.java:456)
	at com.google.devtools.build.lib.bazel.repository.cache.LocalRepoContentsCache.moveToCache(LocalRepoContentsCache.java:172)
	at com.google.devtools.build.lib.bazel.repository.RepositoryFetchFunction.compute(RepositoryFetchFunction.java:297)
	at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:471)
```

Closes bazelbuild#28002.

PiperOrigin-RevId: 855211557
Change-Id: I2f3c40a6aef594682fba989853f7ee982f30c294
(cherry picked from commit b143070)
@fmeum fmeum marked this pull request as ready for review June 24, 2026 07:39
@fmeum fmeum requested a review from a team as a code owner June 24, 2026 07:40
@github-actions github-actions Bot added team-Configurability platforms, toolchains, cquery, select(), config transitions team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. awaiting-review PR is awaiting review from an assigned reviewer labels Jun 24, 2026
@iancha1992 iancha1992 enabled auto-merge June 24, 2026 08:53
@iancha1992 iancha1992 requested review from Wyverald and tjgq June 24, 2026 08:53
@iancha1992 iancha1992 added this pull request to the merge queue Jun 24, 2026
Merged via the queue into bazelbuild:release-8.8.0 with commit 03525eb Jun 24, 2026
47 checks passed
@github-actions github-actions Bot removed the awaiting-review PR is awaiting review from an assigned reviewer label Jun 24, 2026
@fmeum fmeum deleted the rrcc-8.7.0-19 branch June 24, 2026 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

soft-release-blocker Soft release blockers that are nice to have, but shouldn't block the release if it's the last one. team-Configurability platforms, toolchains, cquery, select(), config transitions team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants