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

Make all headers public and add #ifdef __cplusplus #1150

Closed
wants to merge 1 commit into from

Conversation

janicduplessis
Copy link
Contributor

This change is mostly needed to support the new react-native architecture with Swift. Some private yoga headers end up being included in the swift build and result in compilation failure since swift cannot compile c++ modules. See facebook/react-native#33381.

The most reliable fix is to include all headers as public headers, and add #ifdef __cplusplus to those that include c++. This is already what we do for other headers, this applies this to all headers.

Tested in the YogaKitSample, and also in a react-native app.

@facebook-github-bot
Copy link
Contributor

@cortinico has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@dmytrorykun
Copy link

Hi @janicduplessis, can we revert facebook/react-native#33381 as the next step?

@Kudo
Copy link

Kudo commented Jun 7, 2022

Yes, please. But I think the change to react_native_pods.rb don’t need to be reverted. I can create a pr for this later today if it works.

facebook-github-bot pushed a commit to facebook/litho that referenced this pull request Jun 7, 2022
Summary:
This change is mostly needed to support the new react-native architecture with Swift. Some private yoga headers end up being included in the swift build and result in compilation failure since swift cannot compile c++ modules. See facebook/react-native#33381.

The most reliable fix is to include all headers as public headers, and add `#ifdef __cplusplus` to those that include c++. This is already what we do for other headers, this applies this to all headers.

Tested in the YogaKitSample, and also in a react-native app.

Changelog:
[iOS] [Changed] - Make all Yoga headers public and add #ifdef __cplusplus

X-link: facebook/yoga#1150

Reviewed By: dmitryrykun

Differential Revision: D36966687

Pulled By: cortinico

fbshipit-source-id: a34a54d56df43ab4934715070bab8e790b9abd39
facebook-github-bot pushed a commit to facebook/react-native that referenced this pull request Jun 7, 2022
Summary:
This change is mostly needed to support the new react-native architecture with Swift. Some private yoga headers end up being included in the swift build and result in compilation failure since swift cannot compile c++ modules. See #33381.

The most reliable fix is to include all headers as public headers, and add `#ifdef __cplusplus` to those that include c++. This is already what we do for other headers, this applies this to all headers.

Tested in the YogaKitSample, and also in a react-native app.

Changelog:
[iOS] [Changed] - Make all Yoga headers public and add #ifdef __cplusplus

X-link: facebook/yoga#1150

Reviewed By: dmitryrykun

Differential Revision: D36966687

Pulled By: cortinico

fbshipit-source-id: a34a54d56df43ab4934715070bab8e790b9abd39
@janicduplessis
Copy link
Contributor Author

Yea we don't want to revert the whole thing. Sounds good @Kudo you can do the follow up PR in react-native.

@janicduplessis janicduplessis deleted the cppheaders branch June 7, 2022 14:54
@kelset
Copy link

kelset commented Jun 7, 2022

What's the process now to get this version of Yoga with the fix to be consumed by RN? (yoga is actually missing from https://reactnative.dev/contributing/release-dependencies 😅)

@cortinico
Copy link
Contributor

What's the process now to get this version of Yoga with the fix to be consumed by RN?

Yoga is dir-synced inside ReactCommon/yoga/yoga so we don't need any version bump at all at this stage 👍

@kelset
Copy link

kelset commented Jun 7, 2022

ok so we just need to have (basically) a sync commit land on master, and that one could potentially be even cherry-picked?

@cortinico
Copy link
Contributor

@kelset Correct. This landed on main facebook/react-native@43f831b and can be cherry-picked wherever its needed.

@kelset
Copy link

kelset commented Jun 7, 2022

@Kudo @brentvatne you were saying that you wanted to fix in 0.69 right for Expo next SDK version, right?

@Kudo
Copy link

Kudo commented Jun 7, 2022

the revert pr is in facebook/react-native#33973. we want to have both facebook/react-native@43f831b and facebook/react-native#33973 in 0.69. thanks for making it happens.

@kelset
Copy link

kelset commented Jun 8, 2022

@Kudo , sounds good - can you add those requests here? reactwg/react-native-releases#21

since they are about Yoga I feel we'd need a new RC to ensure everything goes smoothly 😅

@Kudo
Copy link

Kudo commented Jun 8, 2022

thanks @kelset! i'll add the commits after facebook/react-native#33973 landed.

facebook-github-bot pushed a commit to facebook/react-native that referenced this pull request Jun 10, 2022
Summary:
facebook/yoga#1150 is better than the tricky #33381 and fix the build error on react-native 0.69 with swift clang module. as facebook/yoga#1150 is landed as 43f831b, i'm reverting the previous change, only leaving the necessary react_native_pods.rb change.

## Changelog

[iOS] [Changed] - Better fix for yoga + swift clang module build error

Pull Request resolved: #33973

Test Plan: ci passed

Reviewed By: cortinico, cipolleschi

Differential Revision: D36998007

Pulled By: dmitryrykun

fbshipit-source-id: fa11bd950e2a1be6396f286086f4e7941ad2ff5b
Kudo pushed a commit to expo/react-native that referenced this pull request Jun 23, 2022
Summary:
This change is mostly needed to support the new react-native architecture with Swift. Some private yoga headers end up being included in the swift build and result in compilation failure since swift cannot compile c++ modules. See facebook#33381.

The most reliable fix is to include all headers as public headers, and add `#ifdef __cplusplus` to those that include c++. This is already what we do for other headers, this applies this to all headers.

Tested in the YogaKitSample, and also in a react-native app.

Changelog:
[iOS] [Changed] - Make all Yoga headers public and add #ifdef __cplusplus

X-link: facebook/yoga#1150

Reviewed By: dmitryrykun

Differential Revision: D36966687

Pulled By: cortinico

fbshipit-source-id: a34a54d56df43ab4934715070bab8e790b9abd39
(cherry picked from commit 43f831b)
Kudo added a commit to expo/react-native that referenced this pull request Jun 23, 2022
Summary:
facebook/yoga#1150 is better than the tricky facebook#33381 and fix the build error on react-native 0.69 with swift clang module. as facebook/yoga#1150 is landed as facebook@43f831b, i'm reverting the previous change, only leaving the necessary react_native_pods.rb change.

## Changelog

[iOS] [Changed] - Better fix for yoga + swift clang module build error

Pull Request resolved: facebook#33973

Test Plan: ci passed

Reviewed By: cortinico, cipolleschi

Differential Revision: D36998007

Pulled By: dmitryrykun

fbshipit-source-id: fa11bd950e2a1be6396f286086f4e7941ad2ff5b
(cherry picked from commit c2088e1)
fortmarek pushed a commit to facebook/react-native that referenced this pull request Jun 29, 2022
Summary:
This change is mostly needed to support the new react-native architecture with Swift. Some private yoga headers end up being included in the swift build and result in compilation failure since swift cannot compile c++ modules. See #33381.

The most reliable fix is to include all headers as public headers, and add `#ifdef __cplusplus` to those that include c++. This is already what we do for other headers, this applies this to all headers.

Tested in the YogaKitSample, and also in a react-native app.

Changelog:
[iOS] [Changed] - Make all Yoga headers public and add #ifdef __cplusplus

X-link: facebook/yoga#1150

Reviewed By: dmitryrykun

Differential Revision: D36966687

Pulled By: cortinico

fbshipit-source-id: a34a54d56df43ab4934715070bab8e790b9abd39
fortmarek pushed a commit to facebook/react-native that referenced this pull request Jun 29, 2022
Summary:
facebook/yoga#1150 is better than the tricky #33381 and fix the build error on react-native 0.69 with swift clang module. as facebook/yoga#1150 is landed as 43f831b, i'm reverting the previous change, only leaving the necessary react_native_pods.rb change.

## Changelog

[iOS] [Changed] - Better fix for yoga + swift clang module build error

Pull Request resolved: #33973

Test Plan: ci passed

Reviewed By: cortinico, cipolleschi

Differential Revision: D36998007

Pulled By: dmitryrykun

fbshipit-source-id: fa11bd950e2a1be6396f286086f4e7941ad2ff5b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants