react-native/packages
Kræn Hansen c3091ccfed Fix podspec_source_build_from_local_source_dir to ensure the artifacts_dir exists before downloading into it (#47698)
Summary:
In its current for the `podspec_source_build_from_local_source_dir` makes an assumption in the existence of the `artifacts_dir` ("Pods/hermes-engine-artifacts"). This is okay in the case where the `pod install` command is first ran without sitting the `REACT_NATIVE_OVERRIDE_HERMES_DIR` because of

1948076b81/packages/react-native/sdks/hermes-engine/hermes-utils.rb (L227)

In a clean checkout however, this results in an error when archiving the Hermes directory due to the missing parent directory of the archive's destination.
This PR suggests adding a check for and optional creation of the existence of the archive directory before usage.

An alternative that I considered was ensuring the existence inside of the `artifacts_dir` function:

1948076b81/packages/react-native/sdks/hermes-engine/hermes-utils.rb (L198-L200)

But there's only one other call site, which already does the `mkdir -p`.

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[IOS] [FIXED] - Ensure artifacts directory exists when building Hermes from local source

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

Test Plan:
I verified the fix by:

- Doing a local git clone of the `hermes` repository.
- Ensure no `Pods` directory exists.
- `export REACT_NATIVE_OVERRIDE_HERMES_DIR=/your/local/path/to/hermes` pointing to the local `hermes` repository.
- Run `pod install`

Reviewed By: cipolleschi

Differential Revision: D66162175

Pulled By: dmytrorykun

fbshipit-source-id: 322633e217063e7ca199b9a9602e279df5fbdb70
2024-11-19 03:44:42 -08:00
..
assets replace '$TEMPORARY$string<>' with 'string' (#46876) 2024-10-07 19:18:14 -07:00
babel-plugin-codegen RN: Fix lint/sort-imports Errors (#47109) 2024-10-18 04:07:02 -07:00
community-cli-plugin fix/cli start (#47450) 2024-11-06 07:26:30 -08:00
core-cli-utils Bump main to 0.77 2024-09-12 09:23:23 -07:00
debugger-frontend Update debugger-frontend from ff343d8...b61aae3 (#47593) 2024-11-13 11:27:38 -08:00
dev-middleware Remove URL.canParse, fix older Node compatibility 2024-11-19 01:50:49 -08:00
eslint-config-react-native Revert to @babel/eslint-parser in eslint-config (#47333) 2024-11-01 05:31:37 -07:00
eslint-plugin-react-native Update hermes-parser and related packages in fbsource to 0.24.0 (#46802) 2024-10-03 08:20:16 -07:00
eslint-plugin-specs Update hermes-parser and related packages in fbsource to 0.24.0 (#46802) 2024-10-03 08:20:16 -07:00
gradle-plugin RNGP - Do not attempt to substring to 1024 while logging. (#47509) 2024-11-08 04:57:15 -08:00
helloworld Pass the RCTAppDependencyProvider to the RCTAppDelegate (#47651) 2024-11-18 08:06:13 -08:00
hermes-inspector-msggen Bump main to 0.77 2024-09-12 09:23:23 -07:00
metro-config metro-config: Revert setting hermesParser: true in default Metro config (#47670) 2024-11-19 02:43:03 -08:00
normalize-color Bump main to 0.77 2024-09-12 09:23:23 -07:00
polyfills Implement always available js error handling (#47466) 2024-11-07 11:22:57 -08:00
react-native Fix podspec_source_build_from_local_source_dir to ensure the artifacts_dir exists before downloading into it (#47698) 2024-11-19 03:44:42 -08:00
react-native-babel-preset Update hermes-parser and related packages in fbsource to 0.24.0 (#46802) 2024-10-03 08:20:16 -07:00
react-native-babel-transformer Update hermes-parser and related packages in fbsource to 0.24.0 (#46802) 2024-10-03 08:20:16 -07:00
react-native-bots fix: mitigate DangerJS transpilation bug (#47192) 2024-10-24 20:07:20 -07:00
react-native-codegen feat: handle negative values in enums (#47452) 2024-11-13 12:20:16 -08:00
react-native-codegen-typescript-test Bump main to 0.77 2024-09-12 09:23:23 -07:00
react-native-info Bump main to 0.77 2024-09-12 09:23:23 -07:00
react-native-popup-menu-android Breaking: Remove BaseViewManagerInterface (#46809) 2024-10-09 14:49:01 -07:00
react-native-test-library Let lib maintainer be explicit with componentProvider mapping (#47520) 2024-11-12 07:38:03 -08:00
react-native-test-renderer Refactor Performance and PerformanceObserver internals (#46693) 2024-10-02 03:13:24 -07:00
rn-tester Pass the RCTAppDependencyProvider to the RCTAppDelegate (#47651) 2024-11-18 08:06:13 -08:00
typescript-config Bump main to 0.77 2024-09-12 09:23:23 -07:00
virtualized-lists RN: Feature Flag to Disable InteractionManager in Batchinator (#47690) 2024-11-18 23:12:15 -08:00