Skip to content

Commit

Permalink
fix: update CircleCI config to use the RN version in tarball caching (#…
Browse files Browse the repository at this point in the history
…35471)

Summary:
This PR updates the Cache strategy for the tarballs to include the React Native version we are building. In this way, when we publish a new Release/RC we are sure that we are going to rebuild a nmew
tarball. This should fix caching problems like:

- we have misconfigured the build script for the Hermes tarball, we then fix it, but we distribute the wrong cached artifacts
- the cached artifact has the wrong version

## Changelog

[Internal] - Fixed Hermes Tarball Cache Logic

Pull Request resolved: #35471

Test Plan:
1. CircleCI
The real way to check this is in the next RC cycle or in the next nightly.

Reviewed By: cortinico

Differential Revision: D41530651

Pulled By: cipolleschi

fbshipit-source-id: 45e8fd3b62c8e108d393d9463ff6762dfc6d3ec8
  • Loading branch information
Riccardo Cipolleschi authored and facebook-github-bot committed Nov 25, 2022
1 parent 67d0264 commit 319631f
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ references:
hermes_workspace_debug_cache_key: &hermes_workspace_debug_cache_key v2-hermes-{{ .Environment.CIRCLE_JOB }}-debug-{{ checksum "/tmp/hermes/hermesversion" }}
hermes_workspace_release_cache_key: &hermes_workspace_release_cache_key v2-hermes-{{ .Environment.CIRCLE_JOB }}-release-{{ checksum "/tmp/hermes/hermesversion" }}
hermes_windows_cache_key: &hermes_windows_cache_key v3-hermes-{{ .Environment.CIRCLE_JOB }}-{{ checksum "tmp/hermes/hermesversion" }}
hermes_tarball_debug_cache_key: &hermes_tarball_debug_cache_key v3-hermes-tarball-debug-{{ checksum "/tmp/hermes/hermesversion" }}
hermes_tarball_release_cache_key: &hermes_tarball_release_cache_key v2-hermes-tarball-release-{{ checksum "/tmp/hermes/hermesversion" }}
hermes_tarball_debug_cache_key: &hermes_tarball_debug_cache_key v3-hermes-tarball-debug-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version"}}
hermes_tarball_release_cache_key: &hermes_tarball_release_cache_key v2-hermes-tarball-release-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version"}}
pods_cache_key: &pods_cache_key v8-pods-{{ .Environment.CIRCLE_JOB }}-{{ checksum "packages/rn-tester/Podfile.lock.bak" }}-{{ checksum "packages/rn-tester/Podfile" }}
windows_yarn_cache_key: &windows_yarn_cache_key v1-win-yarn-cache-{{ arch }}-{{ checksum "yarn.lock" }}
yarn_cache_key: &yarn_cache_key v5-yarn-cache-{{ .Environment.CIRCLE_JOB }}
Expand Down Expand Up @@ -272,6 +272,12 @@ commands:
type: string
default: *hermes_tarball_artifacts_dir
steps:
- run:
name: Get React Native version
command: |
VERSION=$( grep '"version"' package.json | cut -d '"' -f 4 | head -1)
# Save the react native version we are building in a file so we can use that file as part of the cache key.
echo "$VERSION" > /tmp/react-native-version
- when:
condition:
equal: [ << parameters.flavor >>, "Debug"]
Expand Down Expand Up @@ -1194,9 +1200,6 @@ jobs:
command: |
cd ./sdks/hermes || exit 1
BUILD_TYPE="<< parameters.flavor >>" ./utils/build-mac-framework.sh
- with_hermesc_span:
flavor: << parameters.flavor >>
steps:
- run:
name: Build the Hermes iOS frameworks
command: |
Expand Down

0 comments on commit 319631f

Please sign in to comment.