chore: reproducible iOS builds + native artifact caching & verification#11301
Merged
Conversation
|
View your CI Pipeline Execution ↗ for commit 2a0bcaa
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗ ☁️ Nx Cloud last updated this comment at |
NathanWalker
approved these changes
Jul 2, 2026
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.
PR Checklist
What is the current behavior?
Two problems with the native artifacts shipped in
packages/core/platforms:iOS builds are non-deterministic. Rebuilding
TNSWidgets.xcframeworkproduces a different result depending on who/where it was built:Relocations/*.ymlfiles embed the absolute, machine-specific build path;Info.plistreorders itsAvailableLibrariesbetween builds.No reliable link between the committed artifacts and their sources. The expensive native builds (Xcode xcframework, Gradle aar) aren't rebuilt in CI, and Nx's cache is environment-sensitive, so native source can be changed and committed without rebuilding the artifacts — and nothing catches the drift.
What is the new behavior?
Reproducible iOS build (
packages/ui-mobile-base/ios/build.sh):ZERO_AR_DATE=1and-ffile-prefix-map=$(PWD)=.so archive timestamps and the absolute build path are stripped from the binaries/DWARF;Relocations/*.ymlfiles;Info.plistby sortingAvailableLibrariesbyLibraryIdentifier, via a smallnormalize-xcframework-plist.mjsscript (uses theplistpackage plus a whitespace-only postprocess to reproduce Apple's exact formatting byte-for-byte).Native artifact caching & verification:
native-build-state.jsonthat records, per platform, a hash of the native source inputs plus a hash of the produced artifact — an environment-independent link between sources and committed artifacts;tools/native-state.mjsprovideswrite/check/is-current;buildtarget (and the build scripts) always build; a new opt-inensure-nativetarget (SKIP_NATIVE_IF_UNCHANGED=1) reuses committed artifacts only when the sources are unchanged;native_artifacts_checkCI workflow verifies on PRs that the committed artifacts are still in sync with their sources — pure content hashing, no Xcode/Android toolchain required.Also adds
plist ^5.0.0as a root devDependency (used by the Info.plist normalizer) and refreshes the committed native artifacts via a full rebuild offmain.