Граф коммитов

15 Коммитов

Автор SHA1 Сообщение Дата
Lorenzo Sciandra 46a9edc854 Hermes pod: change logic to use the hermes tag to set the pod source correctly (#34221)
Summary:
This fix is necessarly to ensure that when working on the codebase in the `0.XX-stable` branches (ex. when you are working on a release) the Hermes podfile is correctly set against the right commit for that branch, and not latest commit from main branch of Hermes repo.

I didn't add a check to verify that the file `.hermesversion` exists because I think it's safe to assume that the file and the tag correctly exists when this step (doing a pod install on the `0.XX-stable` branch).

Once this is merged, we need to cherry pick it on both the 0.69 and 0.70 branches

## Changelog

[iOS] [Fixed] - Hermes pod: change logic to use the hermes tag to set the pod source correctly

Pull Request resolved: https://github.com/facebook/react-native/pull/34221

Test Plan:
* git clone the repo
* checkout 0.69-stable branch
* follow https://reactnative.dev/contributing/release-testing
* without this commit, when testing RNTester + iOS + Hermes the app will insta-crash on opening
* with it, the app gets build successfully

Reviewed By: cortinico

Differential Revision: D37957660

Pulled By: cipolleschi

fbshipit-source-id: 4e50099ed712b1ad8e6439822e3f530142982c1b
2022-07-19 07:34:18 -07:00
Neil Dhar 3fa3aeba93 Enable Intl on iOS (#34083)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34083

X-link: https://github.com/facebook/hermes/pull/764

Changelog:
[iOS][Added] - Enabled Hermes Intl

Reviewed By: cortinico

Differential Revision: D37457813

fbshipit-source-id: 717adad317d8620d77f73d1856d25dd4e9d8511c
2022-06-28 16:07:39 -07:00
Héctor Ramos 340612a200 Hermes: Use shared JSI from React Native on iOS (#33885)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33885

When building Hermes for React Native, point to the React Native JSI location to ensure both React Native and Hermes use the exact same version of JSI.

Changelog:
[iOS] [Changed] - When Hermes is enabled, it will use the same copy of JSI as React Native

Reviewed By: cortinico, cipolleschi

Differential Revision: D36567471

fbshipit-source-id: 97d954ef34007bd31f008fab451512194060d670
2022-06-09 13:11:46 -07:00
Héctor Ramos 6154cb7512 Hermes: Use arbitrary path to hermes-runtime-darwin if ENV set
Summary:
Allow an arbitrary path to hermes-runtime-darwin-vX.Y.Z.tgz to be specified. This can be used in CI or in local e2e tests to test with Hermes enabled without having a matching GitHub release.

Usage:

```
HERMES_ENGINE_TARBALL_PATH=~/Downloads/hermes- runtime-darwin-v0.69.0.tar.gz \
  USE_HERMES=1 \
  pod install
```

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D36985477

fbshipit-source-id: 853829c89e6f0ac3f63781c7f290cf3994b8e0cd
2022-06-09 11:18:30 -07:00
Nicola Corti bffad4351c Backports fixes on the 0.69 release branch to main (#33938)
Summary:
This PR includes a set of changes that landed only on the 0.69-stable release branch and need to be backported to main:

- a72d1960ff
- 659b693fcd
- 2a6832a7e3
- 0ca6e41059
- f50936bef2

Most of the fixes are working around the assumption that
`version != 1000.0.0 => Build Hermes From Source`.

That is not true in the release branch as the version is named (e.g. 0.69.0-rc4) and we need to build Hermes there.

## Changelog

[Internal] - Backports fixes on the 0.69 release branch to main

Pull Request resolved: https://github.com/facebook/react-native/pull/33938

Test Plan: Tested that those commits are working fine on the release branch.

Reviewed By: hramos

Differential Revision: D36776291

Pulled By: cortinico

fbshipit-source-id: 66e28232d80054fab4a2a97c8d2de12e3c1cf392
2022-05-31 10:37:12 -07:00
LeoTM f56d701e56 Bump iOS from 11.0 to 12.4 in Hermes eng podspec (#33939)
Summary:
Deprecate iOS/tvOS SDK 11.0 support now that 12.4+ is required

Context: https://github.com/facebook/react-native/pull/33935#issuecomment-1142253352

## Changelog

[iOS] [Fixed] - Deprecate iOS/tvOS SDK 11.0 support now that 12.4+ is required

Pull Request resolved: https://github.com/facebook/react-native/pull/33939

Reviewed By: hramos

Differential Revision: D36780553

Pulled By: cortinico

fbshipit-source-id: 64dd12742d1f9f949a89306dd3353ea24a31983d
2022-05-31 10:29:08 -07:00
fortmarek 91452fc1ed Fix downloading prebuilt hermes from the Github release (#33935)
Summary:
This:
```ruby
source[:http] = `https://github.com/facebook/react-native/releases/download/v#{version}/hermes-runtime-darwin-v#{version}.tar.gz`
```
currently fails with the following error:
```
[!] Failed to load 'hermes-engine' podspec:
[!] Invalid `hermes-engine.podspec` file: No such file or directory - https://github.com/facebook/react-native/releases/download/v0.69.0-rc.4/hermes-runtime-darwin-v0.69.0-rc.4.tar.gz.
```

For some reasons, the string with backticks is treated differently than with double quotes since this works:
```ruby
source[:http] = "https://github.com/facebook/react-native/releases/download/v#{version}/hermes-runtime-darwin-v#{version}.tar.gz"
```

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[Internal] - Fix downloading prebuilt hermes from the Github release

Pull Request resolved: https://github.com/facebook/react-native/pull/33935

Test Plan:
- `npx react-native init RN069RC4 --version 0.69.0-rc.4`
- in the created project, run `pod install` with hermes enabled
- run `git init && git add . && git commit -m "Initial commit" && git remote add origin https://github.com/fortmarek/some-fake-repository` (this is necessary due to an unrelated bug in the RC4)
- observe error
- update `node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec` with the change from this commit
- run `pod install`
- 🎉

Reviewed By: dmitryrykun

Differential Revision: D36775047

Pulled By: cortinico

fbshipit-source-id: 3772adca32fe9898cde33c187d19b7b181af3677
2022-05-31 04:43:00 -07:00
Héctor Ramos 38b70653b2 Hermes: Use pre-built artifacts in hermes-engine
Summary:
Update `hermes-engine.podspec` to use pre-built Hermes artifacts from the corresponding React Native GitHub Release when targeting a specific React Native release.
Otherwise, fallback to building Hermes from source.

Changelog: [Internal]

Reviewed By: cortinico, cipolleschi

Differential Revision: D36609257

fbshipit-source-id: 6179c9e255558c7eaf1417ff46a2e7db120295f0
2022-05-25 03:30:57 -07:00
Héctor Ramos c6fb89a0e8 Hermes: Use pre-built hermes-engine if hermes-artifact-url is set
Summary:
Introduces option to use pre-built Hermes binaries.

Requires a `hermes-engine` pod release to have been published in the following manner:

```
env hermes-artifact-url='https://github.com/facebook/react-native/releases/download/vX.Y.Z/hermes-runtime-darwin-vX.Y.Z.tar.gz' pod trunk push hermes-engine.podspec
```
...where "vX.Y.Z" corresponds to a published React Native release on GitHub where the `hermes-runtime-darwin-vX.Y.Z.tar.gz` binary was generated and/or uploaded as part of the release process.

Changelog: [Internal]

Reviewed By: cortinico, cipolleschi

Differential Revision: D36532561

fbshipit-source-id: 73bc107158387ff2db359e1b6a973db6ee85995c
2022-05-23 12:14:29 -07:00
Héctor Ramos 644fe430fd iOS: Use pre-built hermesc if available (#33827)
Summary:
Use pre-built hermesc if available by generating a ImportHermesc.cmake file that points to the hermesc binary. Recent `react-native` releases should have hermesc available in sdks/hermesc.

Hermes build scripts have been updated to support a `HERMES_OVERRIDE_HERMESC_PATH` envvar which can point to this generated ImportHermesc.cmake file.

Pull Request resolved: https://github.com/facebook/react-native/pull/33827

Changelog:
[iOS] [Changed] - Use pre-built HermesC if available in current React Native release

Reviewed By: cortinico

Differential Revision: D36024615

fbshipit-source-id: 476569f73309f9bd142f28cb02d1f7d57b6cbc6a
2022-05-13 14:43:14 -07:00
Héctor Ramos d7921f0504 Hermes: Use prepare-hermes-for-build in Circle CI (#33811)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33811

Use `scripts/hermes/prepare-hermes-for-build.js` in Circle CI, eliminating redundant steps in the `prepare_hermes_workspace` Circle CI job.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D36335122

fbshipit-source-id: b7e8c7aeb2aac5afaf37677cd3ac949ac3f96de1
2022-05-13 00:08:04 -07:00
Héctor Ramos ce06214e3d Fix shellcheck warnings in Hermes build scripts
Summary:
Fixes some shellcheck warnings that arose in D36295406 (ae28880fbc) when the Hermes build scripts were copied over.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D36321074

fbshipit-source-id: 0eae36a4f793daa0e12786ba7989d4eac6b2e256
2022-05-12 16:31:48 -07:00
Héctor Ramos e49e7c7ac5 Remove Pod::UI undefined symbol warning during Hermes build
Summary:
The `utils/build-apple-framework.sh` script uses the ruby runtime to load `hermes-engine.podspec`, and in the process it will load the Core CocoaPods gem to parse the podspec file.

Since the podspec file uses Pod::UI to print logs, and the CoreUI gem is not loaded when `build-apple-framework.sh` accesses `hermes-engine.podspec`, we would get a warning due to Pod::UI not being defined.

This change will only use Pod::UI when it is defined, therefore limiting it to only executing when `hermes-engine.podspec` is loaded as part of the normal `pod install` build process.

Changelog: [Internal]

Reviewed By: cortinico, neildhar

Differential Revision: D36297856

fbshipit-source-id: ac1ab021f74f9dcaa7be2a2358482c73b827b756
2022-05-11 15:49:48 -07:00
Héctor Ramos 83f474147c Hermes: Always use Unix Makefiles for Apple build, and use all available cores
Summary:
Hermes' build scripts use the Ninja build utility if available, otherwise they default to Unix Makefiles. When Unix Makefiles were used, builds would take far too long due to the use of a single core.

To reduce the surface area of issues that may arise as we switch to building Hermes from source, we will now focus on a single build system using Unix Makefiles. We will also ensure all available cores are used when building on macOS.

Changelog: [Internal]

Reviewed By: cortinico, neildhar

Differential Revision: D36296838

fbshipit-source-id: 4be23739fb022e3ae8e974ad3c2c70e7011abb5a
2022-05-11 15:49:48 -07:00
Héctor Ramos ae28880fbc Hermes: Copy build scripts to RN
Summary:
Copy Hermes build scripts to React Native repository for greater control over the build pipeline when used in RN.

Changelog: [Internal]

Reviewed By: neildhar

Differential Revision: D36295406

fbshipit-source-id: 54bf4173b6c75db35de828378e6f5782a248ed2e
2022-05-11 15:49:48 -07:00