-
Notifications
You must be signed in to change notification settings - Fork 25k
[ios][prebuild] add download/extract hermes prebuilts #51216
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
[ios][prebuild] add download/extract hermes prebuilts #51216
Conversation
When running the prebuild script: `node scripts/ios-prebuild.js` The script will now try to resolve and download a prebuilt version of hermes: 1. Hermes artifacts will be extracted to the `./build/artifacts/hermes` folder to ensure that Package.swift can find a version to link against. 2. The script checks the environment variable `HERMES_ENGINE_TARBALL_PATH` and tries do expand the tarball into the artifacts folder from 1 3. If not found, the script reads the hermes version from either the hidden environment-variable `HERMES_VERSION` and tries to download a release-tarball or a nightly tarball for this version. If the version does not exist, the script will fail. Added some extra logging features to the script.
cipolleschi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job here, this will be helpful for building in CI and building from source in a app setup.
There are a bunch of minor things that we should update before merging.
| if (fs.existsSync(artifactsPath)) { | ||
| // Check hermes version file | ||
| const versionFilePath = path.join(artifactsPath, 'version.txt'); | ||
| if (fs.existsSync(versionFilePath)) { | ||
| const versionFileContent = fs.readFileSync(versionFilePath, 'utf8'); | ||
| if (versionFileContent.trim() === resolved_version) { | ||
| hermes_log( | ||
| `Hermes artifacts already downloaded and up to date: ${artifactsPath}`, | ||
| ); | ||
| return artifactsPath; | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps we can extract this in a separate function?
Co-authored-by: Riccardo Cipolleschi <riccardo.cipolleschi@gmail.com>
cipolleschi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this!
|
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Summary: When running the prebuild script: `node scripts/ios-prebuild.js` The script will now try to resolve and download a prebuilt version of hermes: 1. Hermes artifacts will be extracted to the `./build/artifacts/hermes` folder to ensure that Package.swift can find a version to link against. 2. The script checks the environment variable `HERMES_ENGINE_TARBALL_PATH` and tries do expand the tarball into the artifacts folder from 1 3. If not found, the script reads the hermes version from either the hidden environment-variable `HERMES_VERSION` and tries to download a release-tarball or a nightly tarball for this version. If the version does not exist, the script will fail. Also added some extra logging features to the script. bypass-github-export-checks ## Changelog: [IOS] [ADDED] - Added downloading of hermes artifacts when pre-building for iOS. Pull Request resolved: facebook#51216 Test Plan: 1. Delete the `packages/react-native/.build` folder 2. Run the build script (provide a valid HERMES_ENGINE_TARBALL_PATH or a valid Hermes version (or nightly version) 3. Verify that the script successfully exits 4. Build the Package.swift in Xcode and verify that it finds and links the relevant Hermes files, verifying is done by the build succeeding. Differential Revision: D74565936
Summary: When running the prebuild script: `node scripts/ios-prebuild.js` The script will now try to resolve and download a prebuilt version of hermes: 1. Hermes artifacts will be extracted to the `./build/artifacts/hermes` folder to ensure that Package.swift can find a version to link against. 2. The script checks the environment variable `HERMES_ENGINE_TARBALL_PATH` and tries do expand the tarball into the artifacts folder from 1 3. If not found, the script reads the hermes version from either the hidden environment-variable `HERMES_VERSION` and tries to download a release-tarball or a nightly tarball for this version. If the version does not exist, the script will fail. Also added some extra logging features to the script. bypass-github-export-checks ## Changelog: [IOS] [ADDED] - Added downloading of hermes artifacts when pre-building for iOS. Pull Request resolved: facebook#51216 Test Plan: 1. Delete the `packages/react-native/.build` folder 2. Run the build script (provide a valid HERMES_ENGINE_TARBALL_PATH or a valid Hermes version (or nightly version) 3. Verify that the script successfully exits 4. Build the Package.swift in Xcode and verify that it finds and links the relevant Hermes files, verifying is done by the build succeeding. Differential Revision: D74565936
Summary: When running the prebuild script: `node scripts/ios-prebuild.js` The script will now try to resolve and download a prebuilt version of hermes: 1. Hermes artifacts will be extracted to the `./build/artifacts/hermes` folder to ensure that Package.swift can find a version to link against. 2. The script checks the environment variable `HERMES_ENGINE_TARBALL_PATH` and tries do expand the tarball into the artifacts folder from 1 3. If not found, the script reads the hermes version from either the hidden environment-variable `HERMES_VERSION` and tries to download a release-tarball or a nightly tarball for this version. If the version does not exist, the script will fail. Also added some extra logging features to the script. bypass-github-export-checks ## Changelog: [IOS] [ADDED] - Added downloading of hermes artifacts when pre-building for iOS. Pull Request resolved: facebook#51216 Test Plan: 1. Delete the `packages/react-native/.build` folder 2. Run the build script (provide a valid HERMES_ENGINE_TARBALL_PATH or a valid Hermes version (or nightly version) 3. Verify that the script successfully exits 4. Build the Package.swift in Xcode and verify that it finds and links the relevant Hermes files, verifying is done by the build succeeding. Differential Revision: D74565936
Summary: When running the prebuild script: `node scripts/ios-prebuild.js` The script will now try to resolve and download a prebuilt version of hermes: 1. Hermes artifacts will be extracted to the `./build/artifacts/hermes` folder to ensure that Package.swift can find a version to link against. 2. The script checks the environment variable `HERMES_ENGINE_TARBALL_PATH` and tries do expand the tarball into the artifacts folder from 1 3. If not found, the script reads the hermes version from either the hidden environment-variable `HERMES_VERSION` and tries to download a release-tarball or a nightly tarball for this version. If the version does not exist, the script will fail. Also added some extra logging features to the script. bypass-github-export-checks ## Changelog: [IOS] [ADDED] - Added downloading of hermes artifacts when pre-building for iOS. Pull Request resolved: facebook#51216 Test Plan: 1. Delete the `packages/react-native/.build` folder 2. Run the build script (provide a valid HERMES_ENGINE_TARBALL_PATH or a valid Hermes version (or nightly version) 3. Verify that the script successfully exits 4. Build the Package.swift in Xcode and verify that it finds and links the relevant Hermes files, verifying is done by the build succeeding. Differential Revision: D74565936
Summary: When running the prebuild script: `node scripts/ios-prebuild.js` The script will now try to resolve and download a prebuilt version of hermes: 1. Hermes artifacts will be extracted to the `./build/artifacts/hermes` folder to ensure that Package.swift can find a version to link against. 2. The script checks the environment variable `HERMES_ENGINE_TARBALL_PATH` and tries do expand the tarball into the artifacts folder from 1 3. If not found, the script reads the hermes version from either the hidden environment-variable `HERMES_VERSION` and tries to download a release-tarball or a nightly tarball for this version. If the version does not exist, the script will fail. Also added some extra logging features to the script. bypass-github-export-checks ## Changelog: [IOS] [ADDED] - Added downloading of hermes artifacts when pre-building for iOS. Pull Request resolved: facebook#51216 Test Plan: 1. Delete the `packages/react-native/.build` folder 2. Run the build script (provide a valid HERMES_ENGINE_TARBALL_PATH or a valid Hermes version (or nightly version) 3. Verify that the script successfully exits 4. Build the Package.swift in Xcode and verify that it finds and links the relevant Hermes files, verifying is done by the build succeeding. Differential Revision: D74565936
|
This pull request was successfully merged by @chrfalch in 41d2b5d When will my fix make it into a release? | How to file a pick request? |
|
@cipolleschi merged this pull request in 41d2b5d. |
Summary:
When running the prebuild script:
node scripts/ios-prebuild.jsThe script will now try to resolve and download a prebuilt version of hermes:
./build/artifacts/hermesfolder to ensure that Package.swift can find a version to link against.HERMES_ENGINE_TARBALL_PATHand tries do expand the tarball into the artifacts folder from 1HERMES_VERSIONand tries to download a release-tarball or a nightly tarball for this version. If the version does not exist, the script will fail.Also added some extra logging features to the script.
Changelog:
[IOS] [ADDED] - Added downloading of hermes artifacts when pre-building for iOS.
Test Plan:
packages/react-native/.buildfolder