Skip to content

Refactor the prebuild script to use fetch instead of curl #51398

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

cipolleschi
Copy link
Contributor

Summary:
As a followup after the comment of D74565936 (https://www.internalfb.com/diff/D74565936?dst_version_fbid=727294986523938&transaction_fbid=1121452289999956), I refactored the code to use fetch instead of curl.

Changelog:

[Internal] - Refactor the code to use Fetch instead of curl

Differential Revision: D74886699

@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 May 16, 2025
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D74886699

chrfalch and others added 4 commits May 18, 2025 09:00
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
…oad the correct commit data.

Differential Revision: D74569484
Summary:
Our Cocoapods config has a list of defines that are used mostly when setting up pods:

- RCT_FABRIC_ENABLED
- USE_HERMES
- RCT_AGGREGATE_PRIVACY_FILES
- RCT_NEW_ARCH_ENABLED
- APP_PATH
- REACT_NATIVE_PATH
- RCT_SKIP_CODEGEN
- SWIFT_ACTIVE_COMPILATION_CONDITIONS
- USE_FRAMEWORKS
- USE_THIRD_PARTY_JSC
- HERMES_ENABLE_DEBUGGER
- REACT_NATIVE_DEBUGGER_ENABLED
- REACT_NATIVE_DEBUGGER_ENABLED_DEVONLY

Out of these, only the following are used in objective-c/c code:

- USE_HERMES
- HERMES_ENABLE_DEBUGGER
- REACT_NATIVE_DEBUGGER_ENABLED
- REACT_NATIVE_DEBUGGER_ENABLED_DEVONLY

This commit adds the required defines to the correct targets.

## Changelog:

Pick one each for the category and type tags:

[IOS] [FIXED] - fixed defines in package.swift

Pull Request resolved: facebook#51284

Test Plan: No test-plan yet

Differential Revision: D74872272

Reviewed By: cortinico

Pulled By: cortinico
…oad the correct commit data.

Differential Revision: D74882001
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D74886699

cipolleschi added a commit to cipolleschi/react-native that referenced this pull request May 18, 2025
…1398)

Summary:
Pull Request resolved: facebook#51398

As a followup after the comment of D74565936 (https://www.internalfb.com/diff/D74565936?dst_version_fbid=727294986523938&transaction_fbid=1121452289999956), I refactored the code to use `fetch` instead of `curl`.

## Changelog:
[Internal] - Refactor the code to use Fetch instead of curl

Differential Revision: D74886699
…1398)

Summary:
Pull Request resolved: facebook#51398

As a followup after the comment of D74565936 (https://www.internalfb.com/diff/D74565936?dst_version_fbid=727294986523938&transaction_fbid=1121452289999956), I refactored the code to use `fetch` instead of `curl`.

## Changelog:
[Internal] - Refactor the code to use Fetch instead of curl

Differential Revision: D74886699
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D74886699

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

Successfully merging this pull request may close these issues.

3 participants