[rush] Add experiment to omit macOS AppleDouble files from build cache#5625
Merged
iclanton merged 4 commits intomicrosoft:mainfrom Feb 16, 2026
Merged
Conversation
…adata files from build cache macOS creates AppleDouble (._*) files to store extended attributes on filesystems that don't support them. These files can end up in shared build cache archives, polluting them with platform-specific metadata. This adds a new experiment that, when enabled on macOS, omits ._X files from cache archives when a companion file X exists in the same directory. Co-Authored-By: Claude <noreply@anthropic.com>
…he-plugin Co-Authored-By: Claude <noreply@anthropic.com>
…cOS metadata files from build cache
…cOS metadata files from build cache
octogonz
approved these changes
Feb 16, 2026
There was a problem hiding this comment.
Pull request overview
Adds a new Rush experiment to prevent macOS AppleDouble metadata files (._*) from being included in build cache archives, reducing cache pollution for cross-platform consumers.
Changes:
- Introduces
omitAppleDoubleFilesFromBuildCacheexperiment (schema + typed config surface). - Plumbs an internal
filterAppleDoubleFilesoption through cache-related plugins intoOperationBuildCache. - Implements and unit-tests AppleDouble filtering logic during cache archive file collection (macOS-only, companion-file guarded).
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| rush-plugins/rush-bridge-cache-plugin/src/BridgeCachePlugin.ts | Passes the experiment-driven AppleDouble filter flag into cache operations performed by the bridge cache plugin. |
| libraries/rush-lib/src/schemas/experiments.schema.json | Adds the new experiment to the JSON schema. |
| libraries/rush-lib/src/logic/operations/CacheableOperationPlugin.ts | Threads the new filter flag through build cache creation paths. |
| libraries/rush-lib/src/logic/buildCache/test/OperationBuildCache.test.ts | Adds unit tests covering AppleDouble filtering behavior and edge cases. |
| libraries/rush-lib/src/logic/buildCache/OperationBuildCache.ts | Implements AppleDouble filtering during output path collection for cache archives (macOS-only, companion-file check). |
| libraries/rush-lib/src/cli/scriptActions/PhasedScriptAction.ts | Reads the experiment and passes it into the cacheable operation plugin options. |
| libraries/rush-lib/src/api/ExperimentsConfiguration.ts | Extends IExperimentsJson with the new experiment flag (typed surface). |
| libraries/rush-lib/assets/rush-init/common/config/rush/experiments.json | Adds the experiment to the rush-init template file. |
| common/reviews/api/rush-lib.api.md | Updates API review file for the new experiment flag and internal option surface. |
| common/changes/@microsoft/rush/omit-apple-doubles-from-cache_2026-02-16-05-38.json | Adds the Rush change file describing the experiment. |
12 tasks
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.
Summary
When Rush builds run on macOS, AppleDouble metadata files (
._*) can end up in build output folders and get uploaded to the shared build cache. These platform-specific files serve no purpose for build consumers and pollute the cache. This PR adds a newomitAppleDoubleFilesFromBuildCacheexperiment that filters these files out during cache archive creation.Details
AppleDouble files (e.g.
._foo.jsalongsidefoo.js) are automatically created by macOS to store extended attributes on filesystems that don't support them. They can appear in build output folders, particularly when output directories are on network shares or external volumes.The filtering logic:
process.platform === 'darwin'._Xfiles when a companion fileXexists in the same directory, to avoid filtering files that legitimately start with._Set<string>of sibling names per directory for efficient companion lookupThe
process.platformcheck is evaluated once in theOperationBuildCacheconstructor rather than per-file. Since this is a behavior change, it is gated behind an experiment flag.No backwards compatibility concerns -- old cache entries with
._files still restore fine, and the experiment must be explicitly opted into.How it was tested
Added 6 unit tests covering:
._(length 2) are not filteredBuild and all existing tests pass.
Impacted documentation
https://rushjs.io/pages/configs/experiments_json/#docusaurus_skipToContent_fallback