Skip to content

Fabric should be excluded from Podspec build #18683

@slycoder

Description

@slycoder
  • I have reviewed the documentation
    I have searched existing issues

Version 0.55 of React Native includes an experimental Fabric library which has some issues building in a Podspec environment. In particular, it is pulled into Core via the source_files wildcard and directly includes headers from folly --- however without folly_compiler_flags being set on the Core subspec, this causes build breakage.

Environment

OS: macOS High Sierra 10.13.3
Node: 9.6.1
Yarn: 1.5.1
npm: 5.6.0
Watchman: 4.9.0
Xcode: Xcode 9.3 Build version 9E145
Android Studio: 3.0 AI-171.4443003

Packages: (wanted => installed)
react: 16.3.1 => 16.3.1
react-native: 0.55.0 => 0.55.0

Steps to Reproduce

Create a Pods based project. Here's an example Podfile snippet:

pod 'yoga', path: '../node_modules/react-native/ReactCommon/yoga'
pod 'DoubleConversion', podspec: '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'glog', podspec: '../node_modules/react-native/third-party-podspecs/glog.podspec'
pod 'Folly', podspec: '../node_modules/react-native/third-party-podspecs/Folly.podspec'
pod 'React', path: '../node_modules/react-native', :subspecs => [
  'Core',
  'CxxBridge',
  'DevSupport',
  'RCTWebSocket',
  'RCTGeolocation',
  'RCTLinkingIOS',
  'RCTSettings',
  'RCTText',
  'RCTVibration',
  'RCTImage',
  'RCTAnimation',
  'RCTActionSheet',
  'RCTCameraRoll',
]

Expected Behavior

The project builds.

Actual Behavior

An error is thrown while building complaining that folly/folly-config.h is not found:

In file included from <redacted>/node_modules/react-native/React/Fabric/RCTFabricUIManagerWrapper.mm:10:
In file included from <redacted>/node_modules/react-native/ReactCommon/fabric/FabricUIManager.h:10:
In file included from <redacted>/ios/Pods/Folly/folly/dynamic.h:77:
In file included from <redacted>/ios/Pods/Folly/folly/Range.h:22:
In file included from <redacted>/ios/Pods/Folly/folly/FBString.h:41:
In file included from <redacted>/ios/Pods/Folly/folly/Portability.h:23:
<redacted>/ios/Pods/Folly/folly/portability/Config.h:20:10: fatal error: 'folly/folly-config.h' file not found
#include <folly/folly-config.h>
         ^~~~~~~~~~~~~~~~~~~~~~
1 error generated.

Inspection of the compile command being executed confirms that -DFOLLY_NO_CONFIG is NOT being set.

Adding

                              "React/Fabric/*"

to the exclude_files section of the Core subspec fixes the issue.

Activity

added a commit that references this issue on Apr 4, 2018
react-native-bot

react-native-bot commented on Apr 4, 2018

@react-native-bot
Collaborator

Thanks for posting this! It looks like your issue may refer to an older version of React Native. Can you reproduce the issue on the latest release, v0.54?

Thank you for your contributions.

slycoder

slycoder commented on Apr 4, 2018

@slycoder
Author

Domo arigato, Mr React-native-bot-o, but isn't v0.55 > v0.54?

hramos

hramos commented on Apr 4, 2018

@hramos
Contributor

0.55.0 has some issues and we are asking people to stay on 0.54.x for now, which is why the latest release (github.com/facebook/react-native/releases) is no longer 0.55.

It's alright to ignore the bot for now.

added a commit that references this issue on Apr 11, 2018
added a commit that references this issue on Apr 13, 2018

7 remaining items

shafy

shafy commented on Apr 17, 2018

@shafy

Oh ok, thanks!

grabbou

grabbou commented on Apr 17, 2018

@grabbou
Contributor
added a commit that references this issue on Apr 27, 2018
YYCoder1963

YYCoder1963 commented on May 24, 2018

@YYCoder1963

add "React/Fabric/*" did not work for me, Are there any other solutions??

khorark

khorark commented on May 24, 2018

@khorark

@lyayun, I have version 0.55.4 and problem solution for me. But 0.55.3 I had problem.

objHua

objHua commented on May 24, 2018

@objHua

the release to 0.55.4, but there were still problems。
image

georgecr0ss

georgecr0ss commented on Jun 17, 2018

@georgecr0ss

@lyayun have you searched for this flag -DFOLLY_NO_CONFIG ? If it's set remove it

added a commit that references this issue on Jun 28, 2018
added a commit that references this issue on Jul 10, 2018
YVvanessa

YVvanessa commented on Feb 22, 2019

@YVvanessa

@shafy, I just edited the node_modules/react-native/React.podspec, and reran pod install. Not pretty but worked.

like this👇👇??
but there were still problems😯😯

s.subspec "Core" do |ss|
ss.dependency "yoga", "#{package["version"]}.React"
ss.source_files = "React//*.{c,h,m,mm,S,cpp}"
ss.exclude_files = "
/tests/",
"IntegrationTests/
",
"React/DevSupport/",
"React/Inspector/
",
"ReactCommon/yoga/",
"React/Cxx
/",
"React/Fabric/**/
",
"React/Fabric/*"

locked as resolved and limited conversation to collaborators on Apr 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @hramos@slycoder@hung-yueh@shafy@grabbou

      Issue actions

        Fabric should be excluded from Podspec build · Issue #18683 · facebook/react-native