Skip to content

[build-tools] Fix runtime version mismatch from premature fingerprint in eas build:internal#3893

Open
AbbanMustafa wants to merge 2 commits into
mainfrom
mus/fngprint-internal-err
Open

[build-tools] Fix runtime version mismatch from premature fingerprint in eas build:internal#3893
AbbanMustafa wants to merge 2 commits into
mainfrom
mus/fngprint-internal-err

Conversation

@AbbanMustafa

@AbbanMustafa AbbanMustafa commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Why

Workflow builds were failing with a false-positive "Runtime version mismatch" error for jobs using calculate expo updates.

Root cause: workflow builds have an extra internal phase build:internal that runs on the worker to resolve job config. The problem is the order of operations:

  1. eas build:internal runs → computes fingerprint before PREBUILD → stores hash A in ctx.metadata.runtimeVersion
  2. PREBUILD runs → createsios/ or android/ directory, native code is generated
  3. CALCULATE_EXPO_UPDATES_RUNTIME_VERSION runs → computes fingerprint after PREBUILD → gets hash B
  4. CONFIGURE_EXPO_UPDATES compares A vs B → mismatch → throws error

For some projects the fingerprint legitimately differs pre vs post prebuild because the react-native autolinking config changes once native directories exist. The fingerprint should reflect the post-prebuild state eas build:internal is just computing it too early.

How

Two changes:

  1. Skip fingerprint computation in eas build:internal (build.ts). In INTERNAL mode, return {} instead of computing the fingerprint. This means ctx.metadata.runtimeVersion is never set from a stale pre-prebuild
    fingerprint, so the mismatch check in CONFIGURE_EXPO_UPDATES short-circuits and no error is thrown.
  2. Write the correct post-prebuild fingerprint to the DB (expoUpdates.ts, android.ts, ios.ts). Since part 1 stops writing runtimeVersion to the DB from eas build:internal, we now write it from the CALCULATE_EXPO_UPDATES_RUNTIME_VERSION phase instead — after PREBUILD has run and native directories exist. This is gated on BuildTrigger.GIT_BASED_INTEGRATION since non-workflow builds still go through the normal build.ts path.

Test Plan

Trigger a workflow build on a project using runtimeVersion: { policy: 'fingerprint' } with a managed workflow (no pre-existing ios/ or android/ directories). Before this fix the build would fail in CONFIGURE_EXPO_UPDATES with "Runtime version calculated on local machine not equal to runtime version calculated during build."

Screenshot 2026-06-24 at 12 29 25 AM

@github-actions

Copy link
Copy Markdown

Subscribed to pull request

File Patterns Mentions
**/* @douglowder
packages/eas-cli/src/build/** @sjchmiela

Generated by CodeMention

@AbbanMustafa AbbanMustafa added the no changelog PR that doesn't require a changelog entry label Jun 24, 2026
@github-actions

Copy link
Copy Markdown

⏩ The changelog entry check has been skipped since the "no changelog" label is present.

@codecov

codecov Bot commented Jun 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 29.41176% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.00%. Comparing base (4071f48) to head (67ef5bb).

Files with missing lines Patch % Lines
packages/build-tools/src/utils/expoUpdates.ts 20.00% 8 Missing ⚠️
packages/eas-cli/src/build/build.ts 0.00% 3 Missing ⚠️
packages/build-tools/src/builders/android.ts 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3893      +/-   ##
==========================================
- Coverage   59.01%   59.00%   -0.01%     
==========================================
  Files         935      935              
  Lines       40933    40947      +14     
  Branches     8624     8630       +6     
==========================================
+ Hits        24153    24156       +3     
- Misses      16684    16695      +11     
  Partials       96       96              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no changelog PR that doesn't require a changelog entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant