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

Static Hermes for React Native #48327

Closed
wants to merge 1 commit into from

Conversation

neildhar
Copy link
Contributor

Summary:
This PR introduces necessary changes to let React Native uses latest version of static Hermes.

Explanation

Part 1

append("/d2UndefIntOverflow-" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)

It seems like this flag doesn’t exist anymore in the MSVC 16 compiler.
CI logs - https://github.com/piaskowyk/react-native/actions/runs/11815096269/job/32915591004

fatal error C1007: unrecognized flag '-UndefIntOverflow-' in 'p2'

Part 2

if("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC")
  # MSVC needs C++20
  set(CMAKE_CXX_STANDARD 20)
else()
  set(CMAKE_CXX_STANDARD 17)
endif()

Some of the new syntax in static Hermes requires the newer C++ standard on MSVC.

Part 3

# Changes in lib/CMakeLists.txt

These updates are necessary to successfully build the Hermes Framework for iOS.

Part 4

namespace hermes {
namespace hbc {
namespace {

class BytecodeSerializer {
-  friend void visitBytecodeSegmentsInOrder<BytecodeSerializer>(
+  friend void hermes::hbc::visitBytecodeSegmentsInOrder<BytecodeSerializer>(

Due to additional additional anonymous namespace, the MSVC wasn't able to recognise proper symbol without explicite definition.

X-link: facebook/hermes#1566

Reviewed By: tmikov, cipolleschi

Differential Revision: D67316013

Pulled By: neildhar

@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 Dec 18, 2024
@facebook-github-bot
Copy link
Contributor

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

Summary:


This PR introduces necessary changes to let React Native uses latest version of static Hermes.

## Explanation

### Part 1
```cmake
append("/d2UndefIntOverflow-" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
```
It seems like this flag doesn’t exist anymore in the MSVC 16 compiler.
CI logs - https://github.com/piaskowyk/react-native/actions/runs/11815096269/job/32915591004
```
fatal error C1007: unrecognized flag '-UndefIntOverflow-' in 'p2'
```

### Part 2
```cmake
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC")
  # MSVC needs C++20
  set(CMAKE_CXX_STANDARD 20)
else()
  set(CMAKE_CXX_STANDARD 17)
endif()
```

Some of the new syntax in static Hermes requires the newer C++ standard on MSVC.

### Part 3
```cmake
# Changes in lib/CMakeLists.txt
```

These updates are necessary to successfully build the Hermes Framework for iOS.

### Part 4
```diff
namespace hermes {
namespace hbc {
namespace {

class BytecodeSerializer {
-  friend void visitBytecodeSegmentsInOrder<BytecodeSerializer>(
+  friend void hermes::hbc::visitBytecodeSegmentsInOrder<BytecodeSerializer>(
```

Due to additional additional anonymous namespace, the MSVC wasn't able to recognise proper symbol without explicite definition.

X-link: facebook/hermes#1566

Test Plan: Build RNTester app from here - https://github.com/piaskowyk/react-native/tree/%40piaskowyk/build-static-hermes

Reviewed By: tmikov, cipolleschi

Differential Revision: D67316013

Pulled By: neildhar
@facebook-github-bot
Copy link
Contributor

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

facebook-github-bot pushed a commit to facebook/hermes that referenced this pull request Dec 20, 2024
Summary:
X-link: facebook/react-native#48327

This PR introduces necessary changes to let React Native uses latest version of static Hermes.

## Explanation

### Part 1
```cmake
append("/d2UndefIntOverflow-" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
```
It seems like this flag doesn’t exist anymore in the MSVC 16 compiler.
CI logs - https://github.com/piaskowyk/react-native/actions/runs/11815096269/job/32915591004
```
fatal error C1007: unrecognized flag '-UndefIntOverflow-' in 'p2'
```

### Part 2
```cmake
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC")
  # MSVC needs C++20
  set(CMAKE_CXX_STANDARD 20)
else()
  set(CMAKE_CXX_STANDARD 17)
endif()
```

Some of the new syntax in static Hermes requires the newer C++ standard on MSVC.

### Part 3
```cmake
# Changes in lib/CMakeLists.txt
```

These updates are necessary to successfully build the Hermes Framework for iOS.

### Part 4
```diff
namespace hermes {
namespace hbc {
namespace {

class BytecodeSerializer {
-  friend void visitBytecodeSegmentsInOrder<BytecodeSerializer>(
+  friend void hermes::hbc::visitBytecodeSegmentsInOrder<BytecodeSerializer>(
```

Due to additional additional anonymous namespace, the MSVC wasn't able to recognise proper symbol without explicite definition.

Pull Request resolved: #1566

Test Plan: Build RNTester app from here - https://github.com/piaskowyk/react-native/tree/%40piaskowyk/build-static-hermes

Reviewed By: tmikov, cipolleschi

Differential Revision: D67316013

Pulled By: neildhar

fbshipit-source-id: cf03850f94a75acd827b68794700a8f143a90e09
facebook-github-bot pushed a commit to facebook/hermes that referenced this pull request Dec 20, 2024
Summary:
X-link: facebook/react-native#48327

This PR introduces necessary changes to let React Native uses latest version of static Hermes.

## Explanation

### Part 1
```cmake
append("/d2UndefIntOverflow-" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
```
It seems like this flag doesn’t exist anymore in the MSVC 16 compiler.
CI logs - https://github.com/piaskowyk/react-native/actions/runs/11815096269/job/32915591004
```
fatal error C1007: unrecognized flag '-UndefIntOverflow-' in 'p2'
```

### Part 2
```cmake
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC")
  # MSVC needs C++20
  set(CMAKE_CXX_STANDARD 20)
else()
  set(CMAKE_CXX_STANDARD 17)
endif()
```

Some of the new syntax in static Hermes requires the newer C++ standard on MSVC.

### Part 3
```cmake
# Changes in lib/CMakeLists.txt
```

These updates are necessary to successfully build the Hermes Framework for iOS.

### Part 4
```diff
namespace hermes {
namespace hbc {
namespace {

class BytecodeSerializer {
-  friend void visitBytecodeSegmentsInOrder<BytecodeSerializer>(
+  friend void hermes::hbc::visitBytecodeSegmentsInOrder<BytecodeSerializer>(
```

Due to additional additional anonymous namespace, the MSVC wasn't able to recognise proper symbol without explicite definition.

Pull Request resolved: #1566

Test Plan: Build RNTester app from here - https://github.com/piaskowyk/react-native/tree/%40piaskowyk/build-static-hermes

Reviewed By: tmikov, cipolleschi

Differential Revision: D67316013

Pulled By: neildhar

fbshipit-source-id: cf03850f94a75acd827b68794700a8f143a90e09
@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Dec 20, 2024
@facebook-github-bot
Copy link
Contributor

@neildhar merged this pull request in 23eb06f.

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @piaskowyk in 23eb06f

When will my fix make it into a release? | How to file a pick request?

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 Merged This PR has been merged. p: Facebook Partner: Facebook Partner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants