Skip to content

[RN][OSS]Fix edge case where prepare_hermes_workspace and build_hermes_macos where using different hermes commits#34329

Closed
cipolleschi wants to merge 2 commits into
mainfrom
fix/investigate_test_ios
Closed

[RN][OSS]Fix edge case where prepare_hermes_workspace and build_hermes_macos where using different hermes commits#34329
cipolleschi wants to merge 2 commits into
mainfrom
fix/investigate_test_ios

Conversation

@cipolleschi

@cipolleschi cipolleschi commented Aug 2, 2022

Copy link
Copy Markdown
Contributor

Summary

This PR fixes an edge case where prepare_hermes_workspace job was using a commit to build hermes but build_hermes_macos was using a different one. This resulted in cache poisoning where subsequent jobs thoughts to be using a version of Hermes while the restored cache was loading a different one.

Screenshot 2022-08-03 at 06 26 14

This PR simplifies the flow, creating a single .hermesversion file in the prepare_hermes_workspace workspace and using that file as key for all the caches.

This whole investigation started with some failing tests, the PR also adds the xcresult archive as artifact for future failures.

Changelog

[iOS] [Changed] - Simplified the cache code for Hermes and added the test xcresult archive as artifact, if we need to explore the tests in the future.

Test Plan

CircleCI is now green and all the caches are using the same file to create the checksum.

We can verify that by looking at the Save cache/Restore cache commands related to Hermes. (In the workflow, their hash is always B1NEL0P0OKhQYtk8DE150bXSoGrdWUweedHKmqNqnjo)

Also, we removed completely the code that could create a version misalignment.

Verified that the xcresult artifact is uploaded correctly.

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner labels Aug 2, 2022
@react-native-bot react-native-bot added the Platform: iOS iOS applications. label Aug 2, 2022
@cipolleschi cipolleschi force-pushed the fix/investigate_test_ios branch from e3ddd5a to 584a1d1 Compare August 2, 2022 13:35
@analysis-bot

analysis-bot commented Aug 2, 2022

Copy link
Copy Markdown
Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 7,832,556 -783
android hermes armeabi-v7a 7,223,352 -993
android hermes x86 8,144,354 -260
android hermes x86_64 8,123,748 -482
android jsc arm64-v8a 9,711,280 -1,339
android jsc armeabi-v7a 8,464,546 -1,121
android jsc x86 9,660,765 -925
android jsc x86_64 10,260,057 -1,036

Base commit: 463af23
Branch: main

@cipolleschi cipolleschi force-pushed the fix/investigate_test_ios branch 6 times, most recently from f6c2a6c to b0ef9d3 Compare August 2, 2022 19:32
@analysis-bot

analysis-bot commented Aug 2, 2022

Copy link
Copy Markdown
Platform Engine Arch Size (bytes) Diff
ios - universal n/a --

Base commit: 463af23
Branch: main

@cipolleschi cipolleschi force-pushed the fix/investigate_test_ios branch 3 times, most recently from b130f21 to 83327ef Compare August 3, 2022 06:07
@cipolleschi cipolleschi force-pushed the fix/investigate_test_ios branch from 83327ef to 7d5e23f Compare August 3, 2022 06:17
@cipolleschi cipolleschi force-pushed the fix/investigate_test_ios branch from 6e4cd03 to 7c49294 Compare August 3, 2022 07:03
@cipolleschi cipolleschi changed the title fix: investigate ios test failures [RN][OSS]Fix edge case where prepare_hermes_workspace and build_hermes_macos where using different hermes commits Aug 3, 2022
@cipolleschi cipolleschi marked this pull request as ready for review August 3, 2022 09:16
@cipolleschi cipolleschi requested a review from hramos as a code owner August 3, 2022 09:16
@facebook-github-bot

Copy link
Copy Markdown
Contributor

@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@react-native-bot

Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @cipolleschi in 2fa04be.

When will my fix make it into a release? | Upcoming Releases

@react-native-bot react-native-bot added the Merged This PR has been merged. label Aug 3, 2022
@kelset kelset deleted the fix/investigate_test_ios branch August 3, 2022 13:03
@kelset

kelset commented Aug 3, 2022

Copy link
Copy Markdown
Contributor

@cipolleschi do we need to pick this in the 0.70 stable branch?

@cipolleschi

Copy link
Copy Markdown
Contributor Author

@kelset: it could help but it is not necessary. I see that 0.70 CI is green, so the keys used their are not suffering from the poisoning! 👍

roryabraham pushed a commit to Expensify/react-native that referenced this pull request Aug 17, 2022
…here using different hermes commits (react#34329)

Summary:
This PR fixes an edge case where `prepare_hermes_workspace` job was using a commit to build hermes but `build_hermes_macos` was using a different one. This resulted in cache poisoning where subsequent jobs thoughts to be using a version of Hermes while the restored cache was loading a different one.

<img width="1440" alt="Screenshot 2022-08-03 at 06 26 14" src="https://user-images.githubusercontent.com/11162307/182570809-5c6d9323-c3fb-4834-952f-7d07b99c4880.png">

This PR simplifies the flow, creating a single `.hermesversion` file in the `prepare_hermes_workspace` workspace and using that file as key for all the caches.

## Changelog

[iOS] [Changed] - upload test result as artifact

Pull Request resolved: react#34329

Test Plan:
CircleCI is now green and all the caches are using the same file to create the checksum.

We can verify that by looking at the `Save cache`/`Restore cache` commands related to Hermes. (In the workflow, their hash is always `B1NEL0P0OKhQYtk8DE150bXSoGrdWUweedHKmqNqnjo`)

Also, we removed completely the code that could create a version misalignment.

Reviewed By: cortinico

Differential Revision: D38382895

Pulled By: cipolleschi

fbshipit-source-id: 5f5501a7ef313eb56abda336716b24b486a34a1f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. p: Facebook Partner: Facebook Partner Platform: iOS iOS applications.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants