Skip to content

Make AppIntentsMetadataProcessor outputs deterministic#2761

Merged
adincebic merged 5 commits intobazelbuild:mainfrom
thelvis4:make-AppIntentsMetadataProcessor-output-deterministic
Jan 11, 2026
Merged

Make AppIntentsMetadataProcessor outputs deterministic#2761
adincebic merged 5 commits intobazelbuild:mainfrom
thelvis4:make-AppIntentsMetadataProcessor-output-deterministic

Conversation

@thelvis4
Copy link
Copy Markdown
Contributor

@thelvis4 thelvis4 commented Aug 5, 2025

We noticed that xcrun appintentsmetadataprocessor produces non-deterministic Metadata.appintents/extract.actionsdata and Metadata.appintents/version.json JSON outputs (unstable json key order) resulting in different hashes for them when building the same target on different machines.

Tree Digest: root:  {
  files:  {
    name:  "extract.actionsdata"
    digest:  {
      hash:  "1a5948b0129723785ddccd42ec3e6f0315d43dbb77db291c890cf314b0f42b1b"
      size_bytes:  2981
    }
    is_executable:  true
  }
Tree Digest: root:  {
  files:  {
    name:  "extract.actionsdata"
    digest:  {
      hash:  "278dbe486ed21bebe61a5fef6dab2be05ba5fae588d7b330eb0200b8300e23e9"
      size_bytes:  2981
    }
    is_executable:  true
  }

Changes
Sort the keys of Metadata.appintents/extract.actionsdataand Metadata.appintents/extract.actionsdata directory tree output using /usr/bin/python3 -m json.tool to make it deterministic.

Filed Apple Feedback: FB19585633
Fixes #2760

@thelvis4 thelvis4 changed the title Make app intents metadata processor output deterministic Make AppIntentsMetadataProcessor outputs deterministic Aug 5, 2025
@thelvis4 thelvis4 force-pushed the make-AppIntentsMetadataProcessor-output-deterministic branch from 907e3ce to 27a9d2b Compare August 12, 2025 18:17
@thelvis4 thelvis4 requested a review from aaronsky August 12, 2025 18:22
@adincebic adincebic force-pushed the make-AppIntentsMetadataProcessor-output-deterministic branch from ee839a7 to ce3aa36 Compare November 16, 2025 09:02
@adincebic adincebic self-requested a review as a code owner November 16, 2025 09:02
Copy link
Copy Markdown
Contributor

@adincebic adincebic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this.

@adincebic adincebic force-pushed the make-AppIntentsMetadataProcessor-output-deterministic branch from ce3aa36 to cfdae97 Compare January 10, 2026 07:59
@adincebic
Copy link
Copy Markdown
Contributor

@thelvis4 I wrapped the json.tool and wired it up through xplat_toolchain, hope you don't mind. @aaronsky can you re-review?

@adincebic adincebic force-pushed the make-AppIntentsMetadataProcessor-output-deterministic branch from cfdae97 to 5accc64 Compare January 10, 2026 09:02
@adincebic adincebic merged commit df90109 into bazelbuild:main Jan 11, 2026
8 checks passed
@thelvis4 thelvis4 deleted the make-AppIntentsMetadataProcessor-output-deterministic branch January 12, 2026 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AppIntentsMetadataProcessor produces a JSON output that can be non-deterministic

4 participants