Repository navigation
Conversation
…th `cache.remote.crossPlatform`
Every remote key starts with a header that names the OS and the
architecture, so an entry that Linux CI stores is never fetched on macOS,
even for a task whose outputs are the same on every platform. A task can
now set `cache: { remote: { crossPlatform: true } }`. Its remote keys then
have an empty OS and architecture, which no platform has. The default
keys and the local cache don't change.
Closes #926
Co-Authored-By: Claude Opus 5.5 <[email protected]>
fspy benchmarklinuxmacoswindows |
…apshots Co-Authored-By: Claude Opus 5.5 <[email protected]>
…gram The key names a program outside the workspace by its file name and a program inside it by its workspace path. Windows resolves `node` to `node.exe` and a `node_modules/.bin` program to its `.cmd` shim, so Windows entries don't match Linux or macOS entries even with `crossPlatform`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
fengmk2
marked this pull request as ready for review
November 21, 2026 08:06
fengmk2
marked this pull request as draft
November 21, 2026 08:08
…orm` Replace `cache.remote.crossPlatform` with `cache.platform`, a list of the parts of the platform (`"os"`, `"arch"`) that a task's outputs depend on. The workspace root's `cache.platform` is the default for every task and cached script that doesn't set its own, so package.json scripts can share entries too. The default is `["os", "arch"]`, so keys don't change unless a task or the workspace opts in. A part that isn't listed is empty in the remote key header. A built-in tool's `platform` adds to the task's, so a tool can't remove a part that the task lists. A task's `cache.remote` goes back to a boolean. Co-Authored-By: Claude Opus 5.5 <[email protected]>
cache.remote.crossPlatformcache.platform
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Every remote key starts with a header that names the OS and the architecture, so an entry that Linux CI stores is never fetched on a developer's Mac. This is true even for a task whose outputs are the same on every platform, such as a code generator that runs on Node.js. Teams whose CI and developers use different platforms get few remote hits. Today the only workaround is a server that rewrites each key's header, which depends on the key's private encoding and applies to every task at once (#926).
Which parts of the platform a task's result depends on is a statement about the task's cache identity, like
envandinput. Comparable tools also model it as a declared input, not as a remote cache flag: Turborepo and Nx hash a platform file or aruntimeinput, and Rush has[os]and[arch]tokens in its cache entry names.Changes
Config.
cache.platformlists the parts of the platform that a task's outputs depend on:"os","arch", both, or neither ([]). The workspace root'scache.platformis the default for every task and cached package.json script that doesn't set its own. With neither set, it's["os", "arch"], so today's keys don't change.Like the rest of remote caching, the field is parsed but left out of the public types.
Keys. A part that isn't listed is an empty string in the header of both remote keys (
keyandsecondary_key). No platform has an empty OS or architecture, so such a key never equals a key that names that part. The cache schema version and the remote value format stay in the header. A fallback's key is decoded with the same header, so its miss reason still works.Unchanged. The local cache doesn't depend on
platform. A fetched entry is still checked against the fetching machine's inputs, and the rest of the key (the program, its arguments, its working directory, its envs, and its input and output globs) must still match. Changing a task'splatformchanges its remote keys once.Built-in tools. A built-in tool's
platformadds to the platform of the task that runs it, the same way itsenvdoes. A tool that sets nothing keeps the task's, and a tool can't remove a part that the task lists. It uses the remote cache only if both allow it.Planning. The workspace default is applied at plan time in
effective_cache_config, wherecache.scriptsandcache.tasksare already applied.CacheMetadatagetsplatformbesideinput_configandoutput_config.Vite+ builds
EnabledCacheConfigliterals for its built-in tools, so it needsplatform: Noneadded to them when it updates.Limits on what can share:
nodetonode.exeand anode_modules/.binprogram to its.cmdshim, so Windows entries don't match Linux or macOS entries. Linux and macOS, on any architecture, can share. A portable program identity for Windows is left for later.args, so built-in-tool verdicts cannot cross machines #717), so their keys can still differ between machines.Closes #926
🤖 Generated with Claude Code