Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[expo-updates] Add ability to override build-time fingerprint #27597

Merged
merged 1 commit into from
Mar 15, 2024

Conversation

wschurman
Copy link
Member

@wschurman wschurman commented Mar 12, 2024

Why

Generic projects (including those that do continuous native generation, CNG) are having some issues with fingerprint when built on EAS build. This is because EAS build does mutations of the native files just before build, thus generating a different logical runtime from the fingerprint perspective. (https://github.com/expo/eas-build/blob/main/packages/build-tools/src/android/expoUpdates.ts#L55 for example). #27576 was one possible solution, but this PR (in combination with a eas-build PR: expo/eas-build#361) is the better solution.

How

The way to fix this is to calculate the fingerprint ahead of native file mutation in EAS build, and then force the build step to use that fingerprint.

This PR adds this fingerprint override mechanism so that the caller who has previously calculated a fingerprint may force the build step to use their calculated one instead of calculating it at build time. This should be used cautiously since if it is used incorrectly it may end up causing runtime incompatibility.

Test Plan

  1. Create project
  2. Make changes to eas-build locally to set this environment variable during a build step before project modification.
  3. Run build locally using eas-build local instructions. (note: need to yarn link this package in a post-install script)
  4. See the following log: [RUN_GRADLEW] Using fingerprint from EXPO_UPDATES_FINGERPRINT_OVERRIDE: a8715b7f12f5736af20ed1f66daa693d37c43585, indicating the the override is respected and used
  5. Check built aab for overridden fingerprint

Checklist

@wschurman wschurman force-pushed the @wschurman/build-time-fingerprint-override branch from 4912000 to c16e70a Compare March 15, 2024 19:29
@expo-bot expo-bot added bot: passed checks ExpoBot has nothing to complain about and removed bot: suggestions ExpoBot has some suggestions labels Mar 15, 2024
@wschurman wschurman merged commit cb0bf27 into main Mar 15, 2024
21 of 22 checks passed
@wschurman wschurman deleted the @wschurman/build-time-fingerprint-override branch March 15, 2024 19:31
@brentvatne brentvatne added the published Changes from the PR have been published to npm label Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: fingerprint compatible bot: passed checks ExpoBot has nothing to complain about published Changes from the PR have been published to npm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants