From 309a7651250dcec9945e9ba4e182da211d6e1af0 Mon Sep 17 00:00:00 2001 From: Eric Prestemon Date: Tue, 17 Feb 2026 17:02:30 -0800 Subject: [PATCH 1/2] [rush] Fix(#5552): sort additionalFilesForOperation for hashing Fixes #5552: sort additionalFilesForOperation to produce a stable hash for caching --- .../rush/eric.prestemon-fix-5552_2026-02-18-01-11.json | 10 ++++++++++ .../rush-lib/src/logic/incremental/InputsSnapshot.ts | 4 +++- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 common/changes/@microsoft/rush/eric.prestemon-fix-5552_2026-02-18-01-11.json diff --git a/common/changes/@microsoft/rush/eric.prestemon-fix-5552_2026-02-18-01-11.json b/common/changes/@microsoft/rush/eric.prestemon-fix-5552_2026-02-18-01-11.json new file mode 100644 index 00000000000..823aeb8ab61 --- /dev/null +++ b/common/changes/@microsoft/rush/eric.prestemon-fix-5552_2026-02-18-01-11.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@microsoft/rush", + "comment": "sort additionalFilesForOperation to produce a stable hash for caching", + "type": "none" + } + ], + "packageName": "@microsoft/rush" +} \ No newline at end of file diff --git a/libraries/rush-lib/src/logic/incremental/InputsSnapshot.ts b/libraries/rush-lib/src/logic/incremental/InputsSnapshot.ts index 8eeaa5ed224..0568558d014 100644 --- a/libraries/rush-lib/src/logic/incremental/InputsSnapshot.ts +++ b/libraries/rush-lib/src/logic/incremental/InputsSnapshot.ts @@ -318,7 +318,9 @@ export class InputsSnapshot implements IInputsSnapshot { const additionalFilesForOperation: ReadonlySet | undefined = record.additionalFilesByOperationName?.get(operationName); if (additionalFilesForOperation) { - for (const [filePath, hash] of this._resolveHashes(additionalFilesForOperation)) { + // Sort the additional files to ensure deterministic hash computation + const sortedAdditionalFiles: string[] = Array.from(additionalFilesForOperation).sort(); + for (const [filePath, hash] of this._resolveHashes(sortedAdditionalFiles)) { hashes.set(filePath, hash); } } From c582b379210b31f9173a37d54027ec75faba0489 Mon Sep 17 00:00:00 2001 From: Eric Prestemon Date: Wed, 18 Feb 2026 10:50:31 -0800 Subject: [PATCH 2/2] Update common/changes/@microsoft/rush/eric.prestemon-fix-5552_2026-02-18-01-11.json Co-authored-by: Ian Clanton-Thuon --- .../rush/eric.prestemon-fix-5552_2026-02-18-01-11.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/changes/@microsoft/rush/eric.prestemon-fix-5552_2026-02-18-01-11.json b/common/changes/@microsoft/rush/eric.prestemon-fix-5552_2026-02-18-01-11.json index 823aeb8ab61..213e3ec34ef 100644 --- a/common/changes/@microsoft/rush/eric.prestemon-fix-5552_2026-02-18-01-11.json +++ b/common/changes/@microsoft/rush/eric.prestemon-fix-5552_2026-02-18-01-11.json @@ -2,7 +2,7 @@ "changes": [ { "packageName": "@microsoft/rush", - "comment": "sort additionalFilesForOperation to produce a stable hash for caching", + "comment": "Sort the `additionalFilesForOperation` property in operation settings entries in projects' `config/rush-project.json` files before computing operation hashes to produce a stable hash for caching.", "type": "none" } ],