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

[LOCAL][CI] Require cocoapods to hermes-engine podspec #45134

Merged
merged 2 commits into from
Jun 24, 2024

Conversation

cipolleschi
Copy link
Contributor

@cipolleschi cipolleschi commented Jun 24, 2024

Summary:

Building MacOS slices is failing because the Hermes build script tries to read the version for MacOS by evaluating the hermes-engine.podspec. The Hermes script is actually executing the podspec.

However, the podspec relies on some constants that are defined in Cocoapods, but it is not explicitly depending on it. So, when executed without a cocoapods command, like we are doing in the hermes build scripts, it fails.

To solve this, we are adding cocoapods as an explicit dependency of the podspec

Changelog:

[Internal] - Add explicit dependency to cocoapods in hermes-engine.podspec

Test Plan:

GHA should be green.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 24, 2024
@cipolleschi cipolleschi changed the base branch from main to 0.75-stable June 24, 2024 13:31
@cipolleschi cipolleschi marked this pull request as ready for review June 24, 2024 13:36
@cipolleschi cipolleschi force-pushed the cipolleschi/fix-hermes-scripts-for-GHA branch 6 times, most recently from e37d284 to 6409036 Compare June 24, 2024 14:36
@cipolleschi cipolleschi force-pushed the cipolleschi/fix-hermes-scripts-for-GHA branch 4 times, most recently from 9f16584 to ac54bfe Compare June 24, 2024 14:57
Summary:
This change is the first step in refactoring GHA so that they can be reused more easily across jobs.
Its goal is also to be more reliable w.r.t. caches.

That this change do:
* moves `prepare_hermes_workspace` to a composite action
	* saves the `prepare_hermes_workspace` caches only on main
	* uploads the destination folder as an artifact so that we can use it later in the run
* makes the `test-all`, `nightly` and `publish-release` workflow use the new composite action
* updates the `setup-hermes-workspace` to download and use the artifact uploaded by `prepare_hermes_workspace`

[Internal] - Factor out the prepare_hermes_workspace action

Pull Request resolved: #45071

Test Plan: GHA in CI

Reviewed By: cortinico

Differential Revision: D58808087

Pulled By: cipolleschi

fbshipit-source-id: 42c46bcf75fc73b2edfda9be62b5d0fe8a919a5d
@cipolleschi cipolleschi force-pushed the cipolleschi/fix-hermes-scripts-for-GHA branch from ac54bfe to 88bee2c Compare June 24, 2024 15:11
@@ -84,5 +84,5 @@ runs:
path: |
/tmp/hermes/download/
/tmp/hermes/hermes/
key: v1-hermes-${{ inputs.hermes-version }}-${{ github.run_number }}
key: v1-hermes-${{ inputs.hermes-version }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cherry picked 9c6c637 for stabilize prepare-hermes-workspace

@@ -0,0 +1,104 @@
name: prepare-hermes-workspace
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cherry picked 9c6c637 for stabilize prepare-hermes-workspace

@@ -1,8 +1,13 @@
name: setup_hermes_workspace
description: "Setup hermes workspace"
name: restore-hermes-workspace
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cherry picked 9c6c637 for stabilize prepare-hermes-workspace

Comment on lines +63 to +74
- name: Upload HermesC Artifact
uses: actions/[email protected]
with:
name: hermesc-apple
path: ./packages/react-native/sdks/hermes/build_host_hermesc
- name: Cache hermesc apple
uses: actions/cache/[email protected]
if: ${{ github.ref == 'refs/heads/main' }} # To avoid that the cache explode.
with:
path: ./packages/react-native/sdks/hermes/build_host_hermesc
key: v2-hermesc-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
enableCrossOsArchive: true
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apply the same cache-and-artifacts optimization we have in hermew-workspace to stabilize HermesC

Comment on lines +83 to +85
IOS_DEPLOYMENT_TARGET: "13.4"
XROS_DEPLOYMENT_TARGET: "1.0"
MAC_DEPLOYMENT_TARGET: "10.15"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added this to avoid reading cocoapods. That's in general better, we can find a way to read those from react-native rather than have a duplication.
However, these are fixed for the Release, so they should never change for 0.75

Comment on lines +103 to +109
- name: Restore Hermes workspace
uses: ./.github/actions/restore-hermes-workspace
- name: Restore HermesC Artifact
uses: actions/[email protected]
with:
name: hermesc-apple
path: ./packages/react-native/sdks/hermes/build_host_hermesc
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Restore hermesc artifact from previous job

@@ -169,11 +141,17 @@ jobs:
exit 0
fi

export RELEASE_VERSION=${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Export React Native version so we don't need to read from cocoapods

@cortinico cortinico merged commit 1c0a4e7 into 0.75-stable Jun 24, 2024
85 of 91 checks passed
cipolleschi added a commit that referenced this pull request Jun 24, 2024
* [LOCAL][CI] Require cocoapods to hermes-engine podspec

* Refactor Hermes workspace (#45071)

Summary:
This change is the first step in refactoring GHA so that they can be reused more easily across jobs.
Its goal is also to be more reliable w.r.t. caches.

That this change do:
* moves `prepare_hermes_workspace` to a composite action
	* saves the `prepare_hermes_workspace` caches only on main
	* uploads the destination folder as an artifact so that we can use it later in the run
* makes the `test-all`, `nightly` and `publish-release` workflow use the new composite action
* updates the `setup-hermes-workspace` to download and use the artifact uploaded by `prepare_hermes_workspace`

[Internal] - Factor out the prepare_hermes_workspace action

Pull Request resolved: #45071

Test Plan: GHA in CI

Reviewed By: cortinico

Differential Revision: D58808087

Pulled By: cipolleschi

fbshipit-source-id: 42c46bcf75fc73b2edfda9be62b5d0fe8a919a5d
@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 20,443,771 -34,971
android hermes armeabi-v7a n/a --
android hermes x86 n/a --
android hermes x86_64 n/a --
android jsc arm64-v8a 23,642,481 -34,041
android jsc armeabi-v7a n/a --
android jsc x86 n/a --
android jsc x86_64 n/a --

Base commit: 61b3c95
Branch: main

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. p: Facebook Partner: Facebook Partner Pick Request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants