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

Bump OpenSSL-Universal pod dependency to 1.0.2.20 #1171

Closed
wants to merge 1 commit into from

Conversation

mikehardy
Copy link

Per comment in #485 (comment) it appears that OpenSSL will have bitcode information in it now which should solve problems like those experienced in #485 and it's connected issues

Summary

Fixes #485 for real?

Flipper depends on OpenSSL library which does not have bitcode enabled, which means that it fails on real devices as noted in #485

Changelog

Upgrade OpenSSL dependency to one that enables bitcode

Test Plan

This is perhaps more of a speculative PR, it's a build system thing and fundamental enough I am assuming (read as: possibly wrong) that CI + basic tests will show that there are no regressions. After which point the results of this can be issued as a @next or similar for people to see if they can remove the bitcode-disabling workarounds they've had to put in to work around #485

Per comment in facebook#485 (comment) it appears that OpenSSL will have bitcode information in it now which should solve problems like those experienced in facebook#485 and it's connected issues
@cekkaewnumchai
Copy link
Contributor

I don't have context on iOS side. Will let @priteshrnandgaonkar look at it.

@priteshrnandgaonkar
Copy link
Contributor

I will try this locally and check it tomorrow.

@priteshrnandgaonkar
Copy link
Contributor

I tried using the latest openssl dependency with bitcode set to enabled.I got the following error

Undefined symbols for architecture x86_64:
  "___darwin_check_fd_set_overflow", referenced from:
      _RAND_poll in libcrypto.a(rand_unix.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Copy link
Contributor

@priteshrnandgaonkar priteshrnandgaonkar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change will break the sample app

@mikehardy
Copy link
Author

That's a shame - thank you for checking @priteshrnandgaonkar ! I'm not sure what time I'll have available for this, so if anyone else has time please try things - I'd love to see a fix for this but probably am not the best person to submit it

@passy passy added the Needs Author Feedback The author should reply label Jun 23, 2020
@mikehardy
Copy link
Author

I had just enough time to scan the diff from the version currently used (1.0.2.19) to current and the only chunk not related to a transitive OpenSSL dependency upgrade was this:

krzyzanowskim/OpenSSL@1.0.219...master#diff-0b83f9dedf40d7356e5ca147a077acb4

Where they enable bitcode. There was nothing in there that would alter the build, that I see. How can 1.0.2.19 work but 1.0.2.20 not? Very strange.

@github-actions github-actions bot added Needs Attention A project member needs to reply here and removed Needs Author Feedback The author should reply labels Jun 25, 2020
@RoderickJDunn
Copy link

@mikehardy I was able to get my RN project to build with bitcode enabled using this branch. I'm on X-Code 11.5.

Here are the changes to react_native_pods.rb file:

pod 'Flipper', :git => 'https://github.com/mikehardy/flipper', :branch => 'patch-1', :configuration => 'Debug'
pod 'Flipper-Folly', :podspec => 'https://raw.githubusercontent.com/mikehardy/flipper/patch-1/iOS/Podspecs/Flipper-Folly.podspec', :configuration => 'Debug'

Whole file below for reference.

def use_react_native! (options={})
  # The prefix to the react-native
  prefix = options[:path] ||= "../node_modules/react-native"

  # Include Fabric dependencies
  fabric_enabled = options[:fabric_enabled] ||= false

  # Include DevSupport dependency
  production = options[:production] ||= false

  # The Pods which should be included in all projects
  pod 'FBLazyVector', :path => "#{prefix}/Libraries/FBLazyVector"
  pod 'FBReactNativeSpec', :path => "#{prefix}/Libraries/FBReactNativeSpec"
  pod 'RCTRequired', :path => "#{prefix}/Libraries/RCTRequired"
  pod 'RCTTypeSafety', :path => "#{prefix}/Libraries/TypeSafety"
  pod 'React', :path => "#{prefix}/"
  pod 'React-Core', :path => "#{prefix}/"
  pod 'React-CoreModules', :path => "#{prefix}/React/CoreModules"
  pod 'React-RCTActionSheet', :path => "#{prefix}/Libraries/ActionSheetIOS"
  pod 'React-RCTAnimation', :path => "#{prefix}/Libraries/NativeAnimation"
  pod 'React-RCTBlob', :path => "#{prefix}/Libraries/Blob"
  pod 'React-RCTImage', :path => "#{prefix}/Libraries/Image"
  pod 'React-RCTLinking', :path => "#{prefix}/Libraries/LinkingIOS"
  pod 'React-RCTNetwork', :path => "#{prefix}/Libraries/Network"
  pod 'React-RCTSettings', :path => "#{prefix}/Libraries/Settings"
  pod 'React-RCTText', :path => "#{prefix}/Libraries/Text"
  pod 'React-RCTVibration', :path => "#{prefix}/Libraries/Vibration"
  pod 'React-Core/RCTWebSocket', :path => "#{prefix}/"

  unless production
    pod 'React-Core/DevSupport', :path => "#{prefix}/"
  end

  pod 'React-cxxreact', :path => "#{prefix}/ReactCommon/cxxreact"
  pod 'React-jsi', :path => "#{prefix}/ReactCommon/jsi"
  pod 'React-jsiexecutor', :path => "#{prefix}/ReactCommon/jsiexecutor"
  pod 'React-jsinspector', :path => "#{prefix}/ReactCommon/jsinspector"
  pod 'React-callinvoker', :path => "#{prefix}/ReactCommon/callinvoker"
  pod 'ReactCommon/turbomodule/core', :path => "#{prefix}/ReactCommon"
  pod 'Yoga', :path => "#{prefix}/ReactCommon/yoga", :modular_headers => true

  pod 'DoubleConversion', :podspec => "#{prefix}/third-party-podspecs/DoubleConversion.podspec"
  pod 'glog', :podspec => "#{prefix}/third-party-podspecs/glog.podspec"
  pod 'Folly', :podspec => "#{prefix}/third-party-podspecs/Folly.podspec"

  if fabric_enabled
    pod 'React-Fabric', :path => "#{prefix}/ReactCommon"
    pod 'React-graphics', :path => "#{prefix}/ReactCommon/fabric/graphics"
    pod 'React-jsi/Fabric', :path => "#{prefix}/ReactCommon/jsi"
    pod 'React-RCTFabric', :path => "#{prefix}/React"
    pod 'Folly/Fabric', :podspec => "#{prefix}/third-party-podspecs/Folly.podspec"
  end
end

def use_flipper!(versions = {})
  versions['Flipper'] ||= '~> 0.42'
  versions['Flipper-DoubleConversion'] ||= '1.1.7'
  versions['Flipper-Folly'] ||= '~> 2.2'
  versions['Flipper-Glog'] ||= '0.3.6'
  versions['Flipper-PeerTalk'] ||= '~> 0.0.4'
  versions['Flipper-RSocket'] ||= '~> 1.1'
  pod 'FlipperKit', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/FlipperKitLayoutPlugin', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/SKIOSNetworkPlugin', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/FlipperKitUserDefaultsPlugin', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/FlipperKitReactPlugin', versions['Flipper'], :configuration => 'Debug'
  # List all transitive dependencies for FlipperKit pods
  # to avoid them being linked in Release builds
  pod 'Flipper', :git => 'https://github.com/mikehardy/flipper', :branch => 'patch-1', :configuration => 'Debug'
  pod 'Flipper-DoubleConversion', versions['Flipper-DoubleConversion'], :configuration => 'Debug'
  pod 'Flipper-Folly', :podspec => 'https://raw.githubusercontent.com/mikehardy/flipper/patch-1/iOS/Podspecs/Flipper-Folly.podspec', :configuration => 'Debug'
  pod 'Flipper-Glog', versions['Flipper-Glog'], :configuration => 'Debug'
  pod 'Flipper-PeerTalk', versions['Flipper-PeerTalk'], :configuration => 'Debug'
  pod 'Flipper-RSocket', versions['Flipper-RSocket'], :configuration => 'Debug'
  pod 'FlipperKit/Core', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/CppBridge', :configuration => 'Debug'
  pod 'FlipperKit/FBCxxFollyDynamicConvert', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/FBDefines', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/FKPortForwarding', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/FlipperKitHighlightOverlay', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/FlipperKitLayoutTextSearchable', versions['Flipper'], :configuration => 'Debug'
  pod 'FlipperKit/FlipperKitNetworkPlugin', versions['Flipper'], :configuration => 'Debug'
end

# Post Install processing for Flipper
def flipper_post_install(installer)
  installer.pods_project.targets.each do |target|
    if target.name == 'YogaKit'
      target.build_configurations.each do |config|
        config.build_settings['SWIFT_VERSION'] = '4.1'
      end
    end
  end
end

@mikehardy
Copy link
Author

What is the build/test difference between @priteshrnandgaonkar and you @RoderickJDunn ? I see an x86_64 symbol referenced from the failure above, @RoderickJDunn can you confirm you tested on simulator and real device? I assume release mode is not that important as flipper is a debug tool so probably just debug both, but it makes me think a simulator build in debug might fail and I'm not sure what exactly was tested

@RoderickJDunn
Copy link

@mikehardy Yes, the app builds/runs on both a real device and simulator. The 'Valid Architectures' listed under target build settings are: arm64 arm64e armv7 armv7s.
So x86_64 / i386 don't seem to be required for my particular setup.

Re: debug/release modes... correct I've only tried building in debug mode.

@mikehardy
Copy link
Author

@priteshrnandgaonkar can you point me to any documentation, or list the exact steps used to demonstrate the failure you saw? I'd like to try to reproduce and resolve this if possible, it strikes me that not having access to current (and possible future) updates of a cryptography library is not a good long-term plan, and this should be close to working if we can get it done

@chrisbobbe
Copy link

Really briefly (I'm wary that this will be irrelevant, and I don't have evidence; I'm still working through the RN v0.62 upgrade): Could that failure be addressed by correctly following the manual Xcode steps linked from the RN v0.62 upgrade guide?

@mikehardy
Copy link
Author

@chrisbobbe without knowing the exact steps to reproduce the failure, I couldn't speculate. We have one reported success and one reported failure, so I think the burden is on the failure case to demonstrate the failure reproducibly, then I/we dig in and fix that thing :-)

@chrisbobbe
Copy link

chrisbobbe commented Aug 27, 2020

Makes sense. Also, a question for @priteshrnandgaonkar: Was that error definitely not observed with the older version (1.0.2.19) in the same environment? Or is the error also observed there, or else was there perhaps a change in the environment (even an Xcode version, etc.)?

chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this pull request Sep 1, 2020
We'll actually enable it in the main RN v0.61 -> v0.62 upgrade
commit, if only because running Flipper pre-RN v0.62 isn't
advertised as something you can do. Enabling it means calling the
initialize function, like in facebook/react-native@05f5cb534, but in
the form it took in facebook/react-native@b4d1fcfb2 (and the
conditional that appears there).

This encompasses several RN commits, as follows, several of which
broke builds (which poses a problem even without Flipper enabled).
We lump these in with their fixes, so that we don't knowingly
introduce errors at any commit in our project.

Mostly, these problems can be traced to upgrading the FlipperKit pod
and not handling breaking changes at the same time. Generally,
though, the RN commits aren't very clear or coherent, so I feel
safer flattening all of these even if something could plausibly
stand alone in our project.

----- facebook/react-native@70274f4e9 -----

This commit is unstable. One reason is that `pod install` fails
until `:modular_headers` is added to the `Yoga` pod declaration in
facebook/react-native@898b1db6d. The failure message:

```
[!] The following Swift pods cannot yet be integrated as static
libraries:

The Swift pod `YogaKit` depends upon `Yoga`, which does not define
modules. To opt into those targets generating module maps (which is
necessary to import them from Swift when building as static
libraries), you may set `use_modular_headers!` globally in your
Podfile, or specify `:modular_headers => true` for particular
dependencies.
```

----- facebook/react-native@e8541e03f -----

The claim is that this commit adds running React Dev Tools to the
template. I had thought this was something totally separate from
Flipper (and so this would naturally stand in its own commit), but
no; the added code comes from the `FlipperKitReactPlugin` subspec of
the `FlipperKit` pod, and it'll be invoked in the Flipper
initialization function.

This commit also advances the FlipperKit pod version to v0.23.6; I'm
not aware of any new issues that were specifically introduced in
this version.

Still, seems safest to apply these changes in this giant commit.

----- facebook/react-native@898b1db6d -----

A small handful of changes in `AppDelegate.m`, the Podfile, and
`project.pbxproj` are made here.

The motivation for the `AppDelegate.m` changes isn't clear to me,
unless it's "The integration of Flipper on iOS was crashing the
template"--not super descriptive or helpful in finding the origin of
the issue.

In the Podfile, the addition of `:modular_headers => true` to the
`Yoga` pod declaration fixes a `pod install` failure introduced in
facebook/react-native@70274f4e9, described above.

Also in the Podfile, the change of FlipperKit's version to v0.30.0
introduces a build failure associated with
facebook/flipper@ab121f9d9, with Flipper release tag v0.26.0; see
facebook/react-native#27565 (comment).
That issue was non-optimally resolved in
facebook/react-native@b4d1fcfb2, which we'll take for now in this
commit (see below); a more principled solution is open as
facebook/flipper#1171.

The `project.pbxproj` changes here aren't fully explained, but
here's what I think happened, and what I did about it:

- An empty Swift file was added, to rouse Xcode into being prepared
  to handle Swift files, which is needed for the "YogaKit" dep; see
  facebook/react-native#27426 (comment).
  This step is included in the upgrade guide [1]. The empty Swift
  file was later backed out in facebook/react-native@e3218a0d9 (see
  below), which is why it doesn't appear here.

- The addition of the empty Swift file activated a wizard that
  walked the user through setting up an Objective-C "bridging
  header" file and set some plausibly desired settings in the
  `project.pbxproj` file. RN deleted the bridging header file, but
  the settings remained.

  We had actually already set up a bridging header file a long time
  ago, in d38129b, and this setup wizard didn't activate when I
  created the empty Swift file. I tried to *get* it to activate (to
  better reproduce the settings changes) by deleting our bridging
  header file and re-adding the Swift file, but it didn't work.
  However, the settings that got added in d38129b seem to match
  these settings pretty closely; one notable difference is that a
  SWIFT_VERSION build setting is 4.2 instead of 5.0.

  In any case, the upgrade guide on the Xcode changes [1] only says
  the bridging-header wizard will "most likely" appear, and if it
  doesn't, just keep going.

- They added "English" under `knownRegions` in the project info. We
  have this already, and, in fact, it gets *removed* if I follow an
  automatic deprecation fix that Xcode suggests in the buildtime
  warnings (an instance of zulip#4112). So, ignore this.

----- facebook/react-native@e3218a0d9 -----

This Facebook commit looks fairly coherent, but it's a partial
reversion of facebook/react-native@898b1db6d (just above) with a
tweak on top of it. So, might as well put it into the same commit.

The `project.pbxproj` changes are as follows, as best as I can tell:

- The empty Swift file described just above is removed. This is not
  reflected in the upgrade guide on the Xcode changes [1], which
  still says you need to create the file.

- A `LIBRARY_SEARCH_PATHS` setting is added. This *is* reflected in
  the upgrade guide on the Xcode changes [1]; following those
  instructions does indeed generate a portion of the diff.

- An `LD_RUNPATH_SEARCH_PATHS` setting is added; this is *not*
  reflected in the upgrade guide. It's reportedly crucial; see
  facebook/react-native#27922 (comment).
  I copied the code.

- A `DEAD_CODE_STRIPPING` setting is removed; this is *not*
  reflected in the upgrade guide. Reportedly (and in my experience,
  as best as I can remember and conclude), it's crucial; see
  facebook/react-native#27922 (comment).
  I copied the code.

----- facebook/react-native@8f954b365 -----

Just simple prose adjustments to a comment, but it's substantially
reworked in facebook/react-native@b4d1fcfb2 (which follows).

----- facebook/react-native@b4d1fcfb2 -----

This looks like a partial reversion of
facebook/react-native@898b1db6d (above), with a tweak; the
`FB_SONARKIT_ENABLED` conditional is removed from `AppDelegate.m`,
but that identifier now appears in the `project.pbxproj`.

It also continues the advancement of the FlipperKit pod's version,
this time to v0.30.2, and adjusts some comments.

----- facebook/react-native@f6a8452e7 -----

After an upgrade to FlipperKit v0.32.0 in
facebook/react-native@ada73a354, quickly reverted in
facebook/react-native@4bb17944f, this commit brings us to v0.33.1.

----- facebook/react-native@8858d879e -----

This is the last commit that affects Flipper on iOS before the v0.62
release was made. It doesn't continue the advancement of the
FlipperKit version (and a good thing, too, maybe!). It lists several
transitive dependencies of FlipperKit pods to the Podfile and gives
them each a `:configuration => 'Debug'` setting, and that's it.

It appears to be accounting for a CocoaPods quirk that means that,
before this change is made, all those dependencies would get
included in release builds, increasing the binary size. Might as
well avoid having any commits with that increased size; so, conclude
this giant commit with these changes.

All that's left is to actually enable Flipper, which we'll do in the
main upgrade commit.

[1] react-native-community/upgrade-support#13
chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this pull request Sep 2, 2020
We'll actually enable it in the main RN v0.61 -> v0.62 upgrade
commit, if only because running Flipper pre-RN v0.62 isn't
advertised as something you can do. Enabling it means calling the
initialize function, like in facebook/react-native@05f5cb534, but in
the form it took in facebook/react-native@b4d1fcfb2 (and the
conditional that appears there).

This encompasses several RN commits, as follows, some of which broke
builds (which poses a problem even without Flipper enabled). We lump
these in with their fixes, so that we don't knowingly introduce
errors at any commit in our project. Some of these problems can be
traced to upgrading the FlipperKit pod and not handling breaking
changes at the same time. Perhaps it wouldn't have been easy for RN
to catch these before merging.

Generally, though, the RN commits aren't very clear or coherent (at
least by our standards), so I feel safer flattening all of these
even if something could plausibly stand alone in our project.

----- facebook/react-native@70274f4e9 -----

This commit is unstable. One reason is that `pod install` fails
until `:modular_headers` is added to the `Yoga` pod declaration in
facebook/react-native@898b1db6d. The failure message:

```
[!] The following Swift pods cannot yet be integrated as static
libraries:

The Swift pod `YogaKit` depends upon `Yoga`, which does not define
modules. To opt into those targets generating module maps (which is
necessary to import them from Swift when building as static
libraries), you may set `use_modular_headers!` globally in your
Podfile, or specify `:modular_headers => true` for particular
dependencies.
```

----- facebook/react-native@e8541e03f -----

The claim is that this commit adds running React Dev Tools to the
template. I had thought this was something totally separate from
Flipper (and so this would naturally stand in its own commit), but
no; the added code comes from the `FlipperKitReactPlugin` subspec of
the `FlipperKit` pod, and it'll be invoked in the Flipper
initialization function.

This commit also advances the FlipperKit pod version to v0.23.6; I'm
not aware of any new issues that were specifically introduced in
this version.

Still, seems safest to apply these changes in this giant commit.

----- facebook/react-native@898b1db6d -----

A small handful of changes in `AppDelegate.m`, the Podfile, and
`project.pbxproj` are made here.

The motivation for the `AppDelegate.m` changes isn't clear to me,
unless it's "The integration of Flipper on iOS was crashing the
template"--not super descriptive or helpful in finding the origin of
the issue.

In the Podfile, the addition of `:modular_headers => true` to the
`Yoga` pod declaration fixes a `pod install` failure introduced in
facebook/react-native@70274f4e9, described above.

Also in the Podfile, the change of FlipperKit's version to v0.30.0
introduces a build failure associated with
facebook/flipper@ab121f9d9 (Flipper release tag v0.26.0); see
facebook/react-native#27565 (comment).
That issue was non-optimally resolved in
facebook/react-native@b4d1fcfb2, which we'll take for now in this
commit (see below); a more principled solution is open as
facebook/flipper#1171.

The `project.pbxproj` changes here aren't fully explained, but
here's what I think happened, and what I did about it:

- An empty Swift file was added, to rouse Xcode into being prepared
  to handle Swift files, which is needed for the "YogaKit" dep; see
  facebook/react-native#27426 (comment).
  This step is included in the upgrade guide [1]. The empty Swift
  file was later backed out in facebook/react-native@e3218a0d9 (see
  below), which is why it doesn't appear here.

- The addition of the empty Swift file activated a wizard that
  walked the user through setting up an Objective-C "bridging
  header" file and set some plausibly desired settings in the
  `project.pbxproj` file. RN deleted the bridging header file, but
  the settings remained.

  We had actually already set up a bridging header file a long time
  ago, in d38129b, and this setup wizard didn't activate when I
  created the empty Swift file. I tried to *get* it to activate (to
  better reproduce the settings changes) by deleting our bridging
  header file and re-adding the Swift file, but it didn't work.
  However, the settings that got added in d38129b seem to match
  these settings pretty closely; one notable difference is that a
  SWIFT_VERSION build setting is 4.2 instead of 5.0.

  In any case, the upgrade guide on the Xcode changes [1] only says
  the bridging-header wizard will "most likely" appear, and if it
  doesn't, just keep going.

- They added "English" under `knownRegions` in the project info. We
  have this already, and, in fact, it gets *removed* if I follow an
  automatic deprecation fix that Xcode suggests in the buildtime
  warnings (an instance of zulip#4112). So, ignore this.

----- facebook/react-native@e3218a0d9 -----

This Facebook commit looks fairly coherent, but it's a partial
reversion of facebook/react-native@898b1db6d (just above) with a
tweak on top of it. So, might as well put it into the same commit.

The `project.pbxproj` changes are as follows, as best as I can tell:

- The empty Swift file described just above is removed. This is not
  reflected in the upgrade guide on the Xcode changes [1], which
  still says you need to create the file.

- A `LIBRARY_SEARCH_PATHS` setting is added. This *is* reflected in
  the upgrade guide on the Xcode changes [1]; following those
  instructions does indeed generate a portion of the diff.

- An `LD_RUNPATH_SEARCH_PATHS` setting is added; this is *not*
  reflected in the upgrade guide. It's reportedly crucial; see
  facebook/react-native#27922 (comment).
  I copied the code.

- A `DEAD_CODE_STRIPPING` setting is removed; this is *not*
  reflected in the upgrade guide. Reportedly (and in my experience,
  as best as I can remember and conclude), it's crucial; see
  facebook/react-native#27922 (comment).
  I copied the code.

----- facebook/react-native@8f954b365 -----

Just simple prose adjustments to a comment, but it's substantially
reworked in facebook/react-native@b4d1fcfb2 (which follows).

----- facebook/react-native@b4d1fcfb2 -----

This looks like a partial reversion of
facebook/react-native@898b1db6d (above), with a tweak; the
`FB_SONARKIT_ENABLED` conditional is removed from `AppDelegate.m`,
but that identifier now appears in the `project.pbxproj`.

`ENABLE_BITCODE = NO;` is added to the `project.pbxproj` to fix an
issue introduced in facebook/react-native@898b1db6d (see above); see
facebook/react-native#27565 (comment).
The issue would be better resolved with something like
facebook/flipper#1171. In particular, I'm inclined to agree with
that PR's author when he says "it strikes me that not having access
to current (and possible future) updates of a cryptography library
is not a good long-term plan".

This commit also continues the advancement of the FlipperKit pod's
version, this time to v0.30.2, and adjusts some comments.

----- facebook/react-native@f6a8452e7 -----

After an upgrade to FlipperKit v0.32.0 in
facebook/react-native@ada73a354, quickly reverted in
facebook/react-native@4bb17944f, this commit brings us to v0.33.1.

----- facebook/react-native@8858d879e -----

This is the last commit that affects Flipper on iOS before the v0.62
release was made. It doesn't continue the advancement of the
FlipperKit version (and a good thing, too, maybe!). It lists several
transitive dependencies of FlipperKit pods to the Podfile and gives
them each a `:configuration => 'Debug'` setting, and that's it.

It appears to be accounting for a CocoaPods quirk that means that,
before this change is made, all those dependencies would get
included in release builds, increasing the binary size. Might as
well avoid having any commits with that increased size; so, conclude
this giant commit with these changes.

All that's left is to actually enable Flipper, which we'll do in the
main upgrade commit.

[1] react-native-community/upgrade-support#13
chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this pull request Sep 2, 2020
We'll actually enable it in the main RN v0.61 -> v0.62 upgrade
commit, if only because running Flipper pre-RN v0.62 isn't
advertised as something you can do. Enabling it means calling the
initialize function, like in facebook/react-native@05f5cb534, but in
the form it took in facebook/react-native@b4d1fcfb2 (and the
conditional that appears there).

This encompasses several RN commits, as follows, some of which broke
builds (which poses a problem even without Flipper enabled). We lump
these in with their fixes, so that we don't knowingly introduce
errors at any commit in our project. Some of these problems can be
traced to upgrading the FlipperKit pod and not handling breaking
changes at the same time. Perhaps it wouldn't have been easy for RN
to catch these before merging.

Generally, though, the RN commits aren't very clear or coherent (at
least by our standards), so I feel safer flattening all of these
even if something could plausibly stand alone in our project.

----- facebook/react-native@70274f4e9 -----

This commit is unstable. One reason is that `pod install` fails
until `:modular_headers` is added to the `Yoga` pod declaration in
facebook/react-native@898b1db6d. The failure message:

```
[!] The following Swift pods cannot yet be integrated as static
libraries:

The Swift pod `YogaKit` depends upon `Yoga`, which does not define
modules. To opt into those targets generating module maps (which is
necessary to import them from Swift when building as static
libraries), you may set `use_modular_headers!` globally in your
Podfile, or specify `:modular_headers => true` for particular
dependencies.
```

----- facebook/react-native@e8541e03f -----

The claim is that this commit adds running React Dev Tools to the
template. I had thought this was something totally separate from
Flipper (and so this would naturally stand in its own commit), but
no; the added code comes from the `FlipperKitReactPlugin` subspec of
the `FlipperKit` pod, and it'll be invoked in the Flipper
initialization function.

This commit also advances the FlipperKit pod version to v0.23.6; I'm
not aware of any new issues that were specifically introduced in
this version.

Still, seems safest to apply these changes in this giant commit.

----- facebook/react-native@898b1db6d -----

A small handful of changes in `AppDelegate.m`, the Podfile, and
`project.pbxproj` are made here.

The motivation for the `AppDelegate.m` changes isn't clear to me,
unless it's "The integration of Flipper on iOS was crashing the
template"--not super descriptive or helpful in finding the origin of
the issue.

In the Podfile, the addition of `:modular_headers => true` to the
`Yoga` pod declaration fixes a `pod install` failure introduced in
facebook/react-native@70274f4e9, described above.

Also in the Podfile, the change of FlipperKit's version to v0.30.0
introduces a build failure associated with
facebook/flipper@ab121f9d9 (Flipper release tag v0.26.0); see
facebook/react-native#27565 (comment).
That issue was non-optimally resolved in
facebook/react-native@b4d1fcfb2, which we'll take for now in this
commit (see below); a more principled solution is open as
facebook/flipper#1171.

The `project.pbxproj` changes here aren't fully explained, but
here's what I think happened, and what I did about it:

- An empty Swift file was added, to rouse Xcode into being prepared
  to handle Swift files, which is needed for the "YogaKit" dep; see
  facebook/react-native#27426 (comment).
  This step is included in the upgrade guide [1]. The empty Swift
  file was later backed out in facebook/react-native@e3218a0d9 (see
  below), which is why it doesn't appear here.

- The addition of the empty Swift file activated a wizard that
  walked the user through setting up an Objective-C "bridging
  header" file and set some plausibly desired settings in the
  `project.pbxproj` file. RN deleted the bridging header file, but
  the settings remained.

  We had actually already set up a bridging header file a long time
  ago, in d38129b, and this setup wizard didn't activate when I
  created the empty Swift file. I tried to *get* it to activate (to
  better reproduce the settings changes) by deleting our bridging
  header file and re-adding the Swift file, but it didn't work.
  However, the settings that got added in d38129b seem to match
  these settings pretty closely; one notable difference is that a
  SWIFT_VERSION build setting is 4.2 instead of 5.0.

  In any case, the upgrade guide on the Xcode changes [1] only says
  the bridging-header wizard will "most likely" appear, and if it
  doesn't, just keep going.

- They added "English" under `knownRegions` in the project info. We
  have this already, and, in fact, it gets *removed* if I follow an
  automatic deprecation fix that Xcode suggests in the buildtime
  warnings (an instance of zulip#4112). So, ignore this.

----- facebook/react-native@e3218a0d9 -----

This Facebook commit looks fairly coherent, but it's a partial
reversion of facebook/react-native@898b1db6d (just above) with a
tweak on top of it. So, might as well put it into the same commit.

The `project.pbxproj` changes are as follows, as best as I can tell:

- The empty Swift file described just above is removed. This is not
  reflected in the upgrade guide on the Xcode changes [1], which
  still says you need to create the file.

- A `LIBRARY_SEARCH_PATHS` setting is added. This *is* reflected in
  the upgrade guide on the Xcode changes [1]; following those
  instructions does indeed generate a portion of the diff.

- An `LD_RUNPATH_SEARCH_PATHS` setting is added; this is *not*
  reflected in the upgrade guide. It's reportedly crucial; see
  facebook/react-native#27922 (comment).
  I copied the code.

- A `DEAD_CODE_STRIPPING` setting is removed; this is *not*
  reflected in the upgrade guide. Reportedly (and in my experience,
  as best as I can remember and conclude), it's crucial; see
  facebook/react-native#27922 (comment).
  I copied the code.

----- facebook/react-native@8f954b365 -----

Just simple prose adjustments to a comment, but it's substantially
reworked in facebook/react-native@b4d1fcfb2 (which follows).

----- facebook/react-native@b4d1fcfb2 -----

This looks like a partial reversion of
facebook/react-native@898b1db6d (above), with a tweak; the
`FB_SONARKIT_ENABLED` conditional is removed from `AppDelegate.m`,
but that identifier now appears in the `project.pbxproj`.

`ENABLE_BITCODE = NO;` is added to the `project.pbxproj` to fix an
issue introduced in facebook/react-native@898b1db6d (see above); see
facebook/react-native#27565 (comment).
The issue would be better resolved with something like
facebook/flipper#1171. In particular, I'm inclined to agree with
that PR's author when he says "it strikes me that not having access
to current (and possible future) updates of a cryptography library
is not a good long-term plan".

This commit also continues the advancement of the FlipperKit pod's
version, this time to v0.30.2, and adjusts some comments.

----- facebook/react-native@f6a8452e7 -----

After an upgrade to FlipperKit v0.32.0 in
facebook/react-native@ada73a354, quickly reverted in
facebook/react-native@4bb17944f, this commit brings us to v0.33.1.

----- facebook/react-native@8858d879e -----

This is the last commit that affects Flipper on iOS before the v0.62
release was made. It doesn't continue the advancement of the
FlipperKit version (and a good thing, too, maybe!). It lists several
transitive dependencies of FlipperKit pods to the Podfile and gives
them each a `:configuration => 'Debug'` setting, and that's it.

It appears to be accounting for a CocoaPods quirk that means that,
before this change is made, all those dependencies would get
included in release builds, increasing the binary size. Might as
well avoid having any commits with that increased size; so, conclude
this giant commit with these changes.

All that's left is to actually enable Flipper, which we'll do in the
main upgrade commit.

[1] react-native-community/upgrade-support#13
chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this pull request Sep 2, 2020
We'll actually enable it in the main RN v0.61 -> v0.62 upgrade
commit, if only because running Flipper pre-RN v0.62 isn't
advertised as something you can do. Enabling it means calling the
initialize function, like in facebook/react-native@05f5cb534, but in
the form it took in facebook/react-native@b4d1fcfb2 (and the
conditional that appears there).

This encompasses several RN commits, as follows, some of which broke
builds (which poses a problem even without Flipper enabled). We lump
these in with their fixes, so that we don't knowingly introduce
errors at any commit in our project. Some of these problems can be
traced to upgrading the FlipperKit pod and not handling breaking
changes at the same time. Perhaps it wouldn't have been easy for RN
to catch these before merging.

Generally, though, the RN commits aren't very clear or coherent (at
least by our standards), so I feel safer flattening all of these
even if something could plausibly stand alone in our project.

----- facebook/react-native@70274f4e9 -----

This commit is unstable. One reason is that `pod install` fails
until `:modular_headers` is added to the `Yoga` pod declaration in
facebook/react-native@898b1db6d. The failure message:

```
[!] The following Swift pods cannot yet be integrated as static
libraries:

The Swift pod `YogaKit` depends upon `Yoga`, which does not define
modules. To opt into those targets generating module maps (which is
necessary to import them from Swift when building as static
libraries), you may set `use_modular_headers!` globally in your
Podfile, or specify `:modular_headers => true` for particular
dependencies.
```

----- facebook/react-native@e8541e03f -----

The claim is that this commit adds running React Dev Tools to the
template. I had thought this was something totally separate from
Flipper (and so this would naturally stand in its own commit), but
no; the added code comes from the `FlipperKitReactPlugin` subspec of
the `FlipperKit` pod, and it'll be invoked in the Flipper
initialization function.

This commit also advances the FlipperKit pod version to v0.23.6; I'm
not aware of any new issues that were specifically introduced in
this version.

Still, seems safest to apply these changes in this giant commit.

----- facebook/react-native@898b1db6d -----

A small handful of changes in `AppDelegate.m`, the Podfile, and
`project.pbxproj` are made here.

The motivation for the `AppDelegate.m` changes isn't clear to me,
unless it's "The integration of Flipper on iOS was crashing the
template"--not super descriptive or helpful in finding the origin of
the issue.

In the Podfile, the addition of `:modular_headers => true` to the
`Yoga` pod declaration fixes a `pod install` failure introduced in
facebook/react-native@70274f4e9, described above.

Also in the Podfile, the change of FlipperKit's version to v0.30.0
introduces a build failure associated with
facebook/flipper@ab121f9d9 (Flipper release tag v0.26.0); see
facebook/react-native#27565 (comment).
That issue was non-optimally resolved in
facebook/react-native@b4d1fcfb2, which we'll take for now in this
commit (see below); a more principled solution is open as
facebook/flipper#1171.

The `project.pbxproj` changes here aren't fully explained, but
here's what I think happened, and what I did about it:

- An empty Swift file was added, to rouse Xcode into being prepared
  to handle Swift files, which is needed for the "YogaKit" dep; see
  facebook/react-native#27426 (comment).
  This step is included in the upgrade guide [1]. The empty Swift
  file was later backed out in facebook/react-native@e3218a0d9 (see
  below), which is why it doesn't appear here.

- The addition of the empty Swift file activated a wizard that
  walked the user through setting up an Objective-C "bridging
  header" file and set some plausibly desired settings in the
  `project.pbxproj` file. RN deleted the bridging header file, but
  the settings remained.

  We had actually already set up a bridging header file a long time
  ago, in d38129b, and this setup wizard didn't activate when I
  created the empty Swift file. I tried to *get* it to activate (to
  better reproduce the settings changes) by deleting our bridging
  header file and re-adding the Swift file, but it didn't work.
  However, the settings that got added in d38129b seem to match
  these settings pretty closely; one notable difference is that a
  SWIFT_VERSION build setting is 4.2 instead of 5.0.

  In any case, the upgrade guide on the Xcode changes [1] only says
  the bridging-header wizard will "most likely" appear, and if it
  doesn't, just keep going.

- They added "English" under `knownRegions` in the project info. We
  have this already, and, in fact, it gets *removed* if I follow an
  automatic deprecation fix that Xcode suggests in the buildtime
  warnings (an instance of zulip#4112). So, ignore this.

----- facebook/react-native@e3218a0d9 -----

This Facebook commit looks fairly coherent, but it's a partial
reversion of facebook/react-native@898b1db6d (just above) with a
tweak on top of it. So, might as well put it into the same commit.

The `project.pbxproj` changes are as follows, as best as I can tell:

- The empty Swift file described just above is removed. This is not
  reflected in the upgrade guide on the Xcode changes [1], which
  still says you need to create the file.

- A `LIBRARY_SEARCH_PATHS` setting is added. This *is* reflected in
  the upgrade guide on the Xcode changes [1]; following those
  instructions does indeed generate a portion of the diff.

- An `LD_RUNPATH_SEARCH_PATHS` setting is added; this is *not*
  reflected in the upgrade guide. It's reportedly crucial; see
  facebook/react-native#27922 (comment).
  I copied the code.

- A `DEAD_CODE_STRIPPING` setting is removed; this is *not*
  reflected in the upgrade guide. Reportedly (and in my experience,
  as best as I can remember and conclude), it's crucial; see
  facebook/react-native#27922 (comment).
  I copied the code.

----- facebook/react-native@8f954b365 -----

Just simple prose adjustments to a comment, but it's substantially
reworked in facebook/react-native@b4d1fcfb2 (which follows).

----- facebook/react-native@b4d1fcfb2 -----

This looks like a partial reversion of
facebook/react-native@898b1db6d (above), with a tweak; the
`FB_SONARKIT_ENABLED` conditional is removed from `AppDelegate.m`,
but that identifier now appears in the `project.pbxproj`.

`ENABLE_BITCODE = NO;` is added to the `project.pbxproj` to fix an
issue introduced in facebook/react-native@898b1db6d (see above); see
facebook/react-native#27565 (comment).
The issue would be better resolved with something like
facebook/flipper#1171. In particular, I'm inclined to agree with
that PR's author when he says "it strikes me that not having access
to current (and possible future) updates of a cryptography library
is not a good long-term plan".

This commit also continues the advancement of the FlipperKit pod's
version, this time to v0.30.2, and adjusts some comments.

----- facebook/react-native@f6a8452e7 -----

After an upgrade to FlipperKit v0.32.0 in
facebook/react-native@ada73a354, quickly reverted in
facebook/react-native@4bb17944f, this commit brings us to v0.33.1.

----- facebook/react-native@8858d879e -----

This is the last commit that affects Flipper on iOS before the v0.62
release was made. It doesn't continue the advancement of the
FlipperKit version (and a good thing, too, maybe!). It lists several
transitive dependencies of FlipperKit pods to the Podfile and gives
them each a `:configuration => 'Debug'` setting, and that's it.

It appears to be accounting for a CocoaPods quirk that means that,
before this change is made, all those dependencies would get
included in release builds, increasing the binary size. Might as
well avoid having any commits with that increased size; so, conclude
this giant commit with these changes.

All that's left is to actually enable Flipper, which we'll do in the
main upgrade commit.

[1] react-native-community/upgrade-support#13
chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this pull request Sep 4, 2020
We'll actually enable it after the main RN v0.61 -> v0.62 upgrade
commit, if only because running Flipper pre-RN v0.62 isn't
advertised as something you can do. Enabling it means calling the
initialize function, like in facebook/react-native@05f5cb534, but in
the form it took in facebook/react-native@b4d1fcfb2 (and in the
conditional that appears there).

This encompasses several RN commits, as follows, some of which broke
builds (which poses a problem even without Flipper enabled). We lump
these in with their fixes, so that we don't knowingly introduce
errors at any commit in our project. Some of these problems can be
traced to upgrading the FlipperKit pod and not handling breaking
changes at the same time. Perhaps it wouldn't have been easy for RN
to catch these before merging.

Generally, though, the RN commits aren't very clear or coherent (at
least by our standards), so I feel safer flattening all of these
even if something could plausibly stand alone in our project.

----- facebook/react-native@70274f4e9 -----

This commit is unstable. One reason is that `pod install` fails
until `:modular_headers` is added to the `Yoga` pod declaration in
facebook/react-native@898b1db6d. The failure message:

```
[!] The following Swift pods cannot yet be integrated as static
libraries:

The Swift pod `YogaKit` depends upon `Yoga`, which does not define
modules. To opt into those targets generating module maps (which is
necessary to import them from Swift when building as static
libraries), you may set `use_modular_headers!` globally in your
Podfile, or specify `:modular_headers => true` for particular
dependencies.
```

----- facebook/react-native@e8541e03f -----

The claim is that this commit adds running React Dev Tools to the
template. I had thought this was something totally separate from
Flipper (and so this would naturally stand in its own commit), but
no; the added code comes from the `FlipperKitReactPlugin` subspec of
the `FlipperKit` pod, and it'll be invoked in the Flipper
initialization function.

This commit also advances the FlipperKit pod version to v0.23.6; I'm
not aware of any new issues that were specifically introduced in
this version.

Still, seems safest to apply these changes in this giant commit.

----- facebook/react-native@898b1db6d -----

A small handful of changes in `AppDelegate.m`, the Podfile, and
`project.pbxproj` are made here.

The motivation for the `AppDelegate.m` changes isn't clear to me,
unless it's "The integration of Flipper on iOS was crashing the
template"--not super descriptive or helpful in finding the origin of
the issue.

In the Podfile, the addition of `:modular_headers => true` to the
`Yoga` pod declaration fixes a `pod install` failure introduced in
facebook/react-native@70274f4e9, described above.

Also in the Podfile, the change of FlipperKit's version to v0.30.0
introduces a build failure associated with
facebook/flipper@ab121f9d9 (Flipper release tag v0.26.0); see
facebook/react-native#27565 (comment).
That issue was non-optimally resolved in
facebook/react-native@b4d1fcfb2, which we take for now in this
commit (see below); a more principled solution is open as
facebook/flipper#1171.

The `project.pbxproj` changes here aren't fully explained, but
here's what I think happened, and what I did about it:

- An empty Swift file was added, to rouse Xcode into being prepared
  to handle Swift files, which is needed for the "YogaKit" dep; see
  facebook/react-native#27426 (comment).
  This step is included in the upgrade guide [1]. The empty Swift
  file was later backed out in facebook/react-native@e3218a0d9 (see
  below), which is why it doesn't appear here.

- The addition of the empty Swift file activated a wizard that
  walked the user through setting up an Objective-C "bridging
  header" file and set some plausibly desired settings in the
  `project.pbxproj` file. RN deleted the bridging header file, but
  the settings remained.

  We had actually already set up a bridging header file a long time
  ago, in d38129b, and this setup wizard didn't activate when I
  created the empty Swift file. I tried to *get* it to activate (to
  better reproduce the settings changes) by deleting our bridging
  header file and re-adding the Swift file, but the wizard didn't
  activate. However, the settings that got added in d38129b seem
  to match these settings pretty closely; one notable difference is
  that a SWIFT_VERSION build setting is 4.2 instead of 5.0.

  In any case, the upgrade guide on the Xcode changes [1] only says
  the bridging-header wizard will "most likely" appear, and if it
  doesn't, just keep going.

- They added "English" under `knownRegions` in the project info. It
  appears Xcode doesn't like this change; it gets reverted later as
  part of facebook/react-native@ebb629d05 (which we take elsewhere
  in this series, before the upgrade, as an instance of zulip#4112), when
  they follow an Xcode automatic deprecation fix. So, ignore this.

----- facebook/react-native@e3218a0d9 -----

This Facebook commit looks fairly coherent, but it's a partial
reversion of facebook/react-native@898b1db6d (just above) with a
tweak on top of it. So, might as well put it into the same commit.

The `project.pbxproj` changes are as follows, as best as I can tell:

- The empty Swift file described just above is removed. The commit
  message makes it sound like it's no longer necessary for projects
  to make the Swift file in the first place; on the other hand, the
  upgrade guide on the Xcode changes [1] indicate that it should be
  created and then removed.

- A `LIBRARY_SEARCH_PATHS` setting is added. This *is* reflected in
  the upgrade guide on the Xcode changes [1]; following those
  instructions does indeed generate a portion of the diff.

- An `LD_RUNPATH_SEARCH_PATHS` setting is added; this is *not*
  reflected in the upgrade guide. It's reportedly crucial; see
  facebook/react-native#27922 (comment).
  I copied the code.

- A `DEAD_CODE_STRIPPING` setting is removed; this is *not*
  reflected in the upgrade guide. Reportedly (and in my experience,
  as best as I can remember and conclude), it's crucial; see
  facebook/react-native#27922 (comment).
  I copied the code.

----- facebook/react-native@8f954b365 -----

Just simple prose adjustments to a comment, but it's substantially
reworked in facebook/react-native@b4d1fcfb2 (which follows).

----- facebook/react-native@b4d1fcfb2 -----

This looks like a partial reversion of
facebook/react-native@898b1db6d (above), with a tweak; the
`FB_SONARKIT_ENABLED` conditional is removed from `AppDelegate.m`,
but that identifier now appears in the `project.pbxproj`.

`ENABLE_BITCODE = NO;` is added to the `project.pbxproj` to fix an
issue introduced in facebook/react-native@898b1db6d (see above); see
facebook/react-native#27565 (comment).
The issue would be better resolved with something like
facebook/flipper#1171. In particular, I'm inclined to agree with
that PR's author, who says "it strikes me that not having access to
current (and possible future) updates of a cryptography library is
not a good long-term plan".

This commit also continues the advancement of the FlipperKit pod's
version, this time to v0.30.2, and adjusts some comments.

----- facebook/react-native@f6a8452e7 -----

After an upgrade to FlipperKit v0.32.0 in
facebook/react-native@ada73a354, quickly reverted in
facebook/react-native@4bb17944f, this commit brings us to v0.33.1.

----- facebook/react-native@8858d879e -----

This is the last commit that affects Flipper on iOS before the v0.62
release was made. It doesn't continue the advancement of the
FlipperKit version (and a good thing, too, maybe!). It lists several
transitive dependencies of FlipperKit pods to the Podfile and gives
them each a `:configuration => 'Debug'` setting, and that's it.

It appears to be accounting for a CocoaPods quirk that means that,
before this change is made, all those dependencies would get
included in release builds, increasing the binary size. Might as
well avoid having any commits with that increased size; so, conclude
this giant commit with these changes.

All that's left is to actually enable Flipper, which we'll do after
the main upgrade commit; see
zulip#4244 (comment).

[1] react-native-community/upgrade-support#13
@tastafur
Copy link

tastafur commented Sep 8, 2020

The version 1.0.2.19 not work bitcode in 0.63 version

@mikehardy
Copy link
Author

@tastafur that's the entire reason this PR exists. Workarounds are available in the linked issue #485 (comment) - do you have the time to test this PR and help move it forward? We're still waiting on some one that can reproduce the steps taken by @priteshrnandgaonkar where this PR apparently did not work. That's where we are blocked now.

chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this pull request Sep 9, 2020
We'll actually enable it after the main RN v0.61 -> v0.62 upgrade
commit, if only because running Flipper pre-RN v0.62 isn't
advertised as something you can do. Enabling it means calling the
initialize function, like in facebook/react-native@05f5cb534, but in
the form it took in facebook/react-native@b4d1fcfb2 (and in the
conditional that appears there).

This encompasses several RN commits, as follows, some of which broke
builds (which poses a problem even without Flipper enabled). We lump
these in with their fixes, so that we don't knowingly introduce
errors at any commit in our project. Some of these problems can be
traced to upgrading the FlipperKit pod and not handling breaking
changes at the same time. Perhaps it wouldn't have been easy for RN
to catch these before merging.

Generally, though, the RN commits aren't very clear or coherent (at
least by our standards), so I feel safer flattening all of these
even if something could plausibly stand alone in our project.

----- facebook/react-native@70274f4e9 -----

This commit is unstable. One reason is that `pod install` fails
until `:modular_headers` is added to the `Yoga` pod declaration in
facebook/react-native@898b1db6d. The failure message:

```
[!] The following Swift pods cannot yet be integrated as static
libraries:

The Swift pod `YogaKit` depends upon `Yoga`, which does not define
modules. To opt into those targets generating module maps (which is
necessary to import them from Swift when building as static
libraries), you may set `use_modular_headers!` globally in your
Podfile, or specify `:modular_headers => true` for particular
dependencies.
```

----- facebook/react-native@e8541e03f -----

The claim is that this commit adds running React Dev Tools to the
template. I had thought this was something totally separate from
Flipper (and so this would naturally stand in its own commit), but
no; the added code comes from the `FlipperKitReactPlugin` subspec of
the `FlipperKit` pod, and it'll be invoked in the Flipper
initialization function.

This commit also advances the FlipperKit pod version to v0.23.6; I'm
not aware of any new issues that were specifically introduced in
this version.

Still, seems safest to apply these changes in this giant commit.

----- facebook/react-native@898b1db6d -----

A small handful of changes in `AppDelegate.m`, the Podfile, and
`project.pbxproj` are made here.

The motivation for the `AppDelegate.m` changes isn't clear to me,
unless it's "The integration of Flipper on iOS was crashing the
template"--not super descriptive or helpful in finding the origin of
the issue.

In the Podfile, the addition of `:modular_headers => true` to the
`Yoga` pod declaration fixes a `pod install` failure introduced in
facebook/react-native@70274f4e9, described above.

Also in the Podfile, the change of FlipperKit's version to v0.30.0
introduces a build failure associated with
facebook/flipper@ab121f9d9 (Flipper release tag v0.26.0); see
facebook/react-native#27565 (comment).
That issue was non-optimally resolved in
facebook/react-native@b4d1fcfb2, which we take for now in this
commit (see below); a more principled solution is open as
facebook/flipper#1171.

The `project.pbxproj` changes here aren't fully explained, but
here's what I think happened, and what I did about it:

- An empty Swift file was added, to rouse Xcode into being prepared
  to handle Swift files, which is needed for the "YogaKit" dep; see
  facebook/react-native#27426 (comment).
  This step is included in the upgrade guide [1]. The empty Swift
  file was later backed out in facebook/react-native@e3218a0d9 (see
  below), which is why it doesn't appear here.

- The addition of the empty Swift file activated a wizard that
  walked the user through setting up an Objective-C "bridging
  header" file and set some plausibly desired settings in the
  `project.pbxproj` file. RN deleted the bridging header file, but
  the settings remained.

  We had actually already set up a bridging header file a long time
  ago, in d38129b, and this setup wizard didn't activate when I
  created the empty Swift file. I tried to *get* it to activate (to
  better reproduce the settings changes) by deleting our bridging
  header file and re-adding the Swift file, but the wizard didn't
  activate. However, the settings that got added in d38129b seem
  to match these settings pretty closely; one notable difference is
  that a SWIFT_VERSION build setting is 4.2 instead of 5.0.

  In any case, the upgrade guide on the Xcode changes [1] only says
  the bridging-header wizard will "most likely" appear, and if it
  doesn't, just keep going.

- They added "English" under `knownRegions` in the project info. It
  appears Xcode doesn't like this change; it gets reverted later as
  part of facebook/react-native@ebb629d05 (which we take elsewhere
  in this series, before the upgrade, as an instance of zulip#4112), when
  they follow an Xcode automatic deprecation fix. So, ignore this.

----- facebook/react-native@e3218a0d9 -----

This Facebook commit looks fairly coherent, but it's a partial
reversion of facebook/react-native@898b1db6d (just above) with a
tweak on top of it. So, might as well put it into the same commit.

The `project.pbxproj` changes are as follows, as best as I can tell:

- The empty Swift file described just above is removed. The commit
  message makes it sound like it's no longer necessary for projects
  to make the Swift file in the first place; on the other hand, the
  upgrade guide on the Xcode changes [1] indicate that it should be
  created and then removed.

- A `LIBRARY_SEARCH_PATHS` setting is added. This *is* reflected in
  the upgrade guide on the Xcode changes [1]; following those
  instructions does indeed generate a portion of the diff.

- An `LD_RUNPATH_SEARCH_PATHS` setting is added; this is *not*
  reflected in the upgrade guide. It's reportedly crucial; see
  facebook/react-native#27922 (comment).
  I copied the code.

- A `DEAD_CODE_STRIPPING` setting is removed; this is *not*
  reflected in the upgrade guide. Reportedly (and in my experience,
  as best as I can remember and conclude), it's crucial; see
  facebook/react-native#27922 (comment).
  I copied the code.

----- facebook/react-native@8f954b365 -----

Just simple prose adjustments to a comment, but it's substantially
reworked in facebook/react-native@b4d1fcfb2 (which follows).

----- facebook/react-native@b4d1fcfb2 -----

This looks like a partial reversion of
facebook/react-native@898b1db6d (above), with a tweak; the
`FB_SONARKIT_ENABLED` conditional is removed from `AppDelegate.m`,
but that identifier now appears in the `project.pbxproj`.

`ENABLE_BITCODE = NO;` is added to the `project.pbxproj` to fix an
issue introduced in facebook/react-native@898b1db6d (see above); see
facebook/react-native#27565 (comment).
The issue would be better resolved with something like
facebook/flipper#1171. In particular, I'm inclined to agree with
that PR's author, who says "it strikes me that not having access to
current (and possible future) updates of a cryptography library is
not a good long-term plan".

This commit also continues the advancement of the FlipperKit pod's
version, this time to v0.30.2, and adjusts some comments.

----- facebook/react-native@f6a8452e7 -----

After an upgrade to FlipperKit v0.32.0 in
facebook/react-native@ada73a354, quickly reverted in
facebook/react-native@4bb17944f, this commit brings us to v0.33.1.

----- facebook/react-native@8858d879e -----

This is the last commit that affects Flipper on iOS before the v0.62
release was made. It doesn't continue the advancement of the
FlipperKit version (and a good thing, too, maybe!). It lists several
transitive dependencies of FlipperKit pods to the Podfile and gives
them each a `:configuration => 'Debug'` setting, and that's it.

It appears to be accounting for a CocoaPods quirk that means that,
before this change is made, all those dependencies would get
included in release builds, increasing the binary size. Might as
well avoid having any commits with that increased size; so, conclude
this giant commit with these changes.

All that's left is to actually enable Flipper, which we'll do after
the main upgrade commit; see
zulip#4244 (comment).

[1] react-native-community/upgrade-support#13
gnprice pushed a commit to chrisbobbe/zulip-mobile that referenced this pull request Sep 11, 2020
We'll actually enable it after the main RN v0.61 -> v0.62 upgrade
commit, if only because running Flipper pre-RN v0.62 isn't
advertised as something you can do. Enabling it means calling the
initialize function, like in facebook/react-native@05f5cb534, but in
the form it took in facebook/react-native@b4d1fcfb2 (and in the
conditional that appears there).

This encompasses several RN commits, as follows, some of which broke
builds (which poses a problem even without Flipper enabled). We lump
these in with their fixes, so that we don't knowingly introduce
errors at any commit in our project. Some of these problems can be
traced to upgrading the FlipperKit pod and not handling breaking
changes at the same time. Perhaps it wouldn't have been easy for RN
to catch these before merging.

Generally, though, the RN commits aren't very clear or coherent (at
least by our standards), so I feel safer flattening all of these
even if something could plausibly stand alone in our project.

----- facebook/react-native@70274f4e9 -----

This commit is unstable. One reason is that `pod install` fails
until `:modular_headers` is added to the `Yoga` pod declaration in
facebook/react-native@898b1db6d. The failure message:

```
[!] The following Swift pods cannot yet be integrated as static
libraries:

The Swift pod `YogaKit` depends upon `Yoga`, which does not define
modules. To opt into those targets generating module maps (which is
necessary to import them from Swift when building as static
libraries), you may set `use_modular_headers!` globally in your
Podfile, or specify `:modular_headers => true` for particular
dependencies.
```

----- facebook/react-native@e8541e03f -----

The claim is that this commit adds running React Dev Tools to the
template. I had thought this was something totally separate from
Flipper (and so this would naturally stand in its own commit), but
no; the added code comes from the `FlipperKitReactPlugin` subspec of
the `FlipperKit` pod, and it'll be invoked in the Flipper
initialization function.

This commit also advances the FlipperKit pod version to v0.23.6; I'm
not aware of any new issues that were specifically introduced in
this version.

Still, seems safest to apply these changes in this giant commit.

----- facebook/react-native@898b1db6d -----

A small handful of changes in `AppDelegate.m`, the Podfile, and
`project.pbxproj` are made here.

The motivation for the `AppDelegate.m` changes isn't clear to me,
unless it's "The integration of Flipper on iOS was crashing the
template"--not super descriptive or helpful in finding the origin of
the issue.

In the Podfile, the addition of `:modular_headers => true` to the
`Yoga` pod declaration fixes a `pod install` failure introduced in
facebook/react-native@70274f4e9, described above.

Also in the Podfile, the change of FlipperKit's version to v0.30.0
introduces a build failure associated with
facebook/flipper@ab121f9d9 (Flipper release tag v0.26.0); see
facebook/react-native#27565 (comment).
That issue was non-optimally resolved in
facebook/react-native@b4d1fcfb2, which we take for now in this
commit (see below); a more principled solution is open as
facebook/flipper#1171.

The `project.pbxproj` changes here aren't fully explained, but
here's what I think happened, and what I did about it:

- An empty Swift file was added, to rouse Xcode into being prepared
  to handle Swift files, which is needed for the "YogaKit" dep; see
  facebook/react-native#27426 (comment).
  This step is included in the upgrade guide [1]. The empty Swift
  file was later backed out in facebook/react-native@e3218a0d9 (see
  below), which is why it doesn't appear here.

- The addition of the empty Swift file activated a wizard that
  walked the user through setting up an Objective-C "bridging
  header" file and set some plausibly desired settings in the
  `project.pbxproj` file. RN deleted the bridging header file, but
  the settings remained.

  We had actually already set up a bridging header file a long time
  ago, in d38129b, and this setup wizard didn't activate when I
  created the empty Swift file. I tried to *get* it to activate (to
  better reproduce the settings changes) by deleting our bridging
  header file and re-adding the Swift file, but the wizard didn't
  activate. However, the settings that got added in d38129b seem
  to match these settings pretty closely; one notable difference is
  that a SWIFT_VERSION build setting is 4.2 instead of 5.0.

  In any case, the upgrade guide on the Xcode changes [1] only says
  the bridging-header wizard will "most likely" appear, and if it
  doesn't, just keep going.

- They added "English" under `knownRegions` in the project info. It
  appears Xcode doesn't like this change; it gets reverted later as
  part of facebook/react-native@ebb629d05 (which we take elsewhere
  in this series, before the upgrade, as an instance of zulip#4112), when
  they follow an Xcode automatic deprecation fix. So, ignore this.

----- facebook/react-native@e3218a0d9 -----

This Facebook commit looks fairly coherent, but it's a partial
reversion of facebook/react-native@898b1db6d (just above) with a
tweak on top of it. So, might as well put it into the same commit.

The `project.pbxproj` changes are as follows, as best as I can tell:

- The empty Swift file described just above is removed. The commit
  message makes it sound like it's no longer necessary for projects
  to make the Swift file in the first place; on the other hand, the
  upgrade guide on the Xcode changes [1] indicate that it should be
  created and then removed.

- A `LIBRARY_SEARCH_PATHS` setting is added. This *is* reflected in
  the upgrade guide on the Xcode changes [1]; following those
  instructions does indeed generate a portion of the diff.

- An `LD_RUNPATH_SEARCH_PATHS` setting is added; this is *not*
  reflected in the upgrade guide. It's reportedly crucial; see
  facebook/react-native#27922 (comment).
  I copied the code.

- A `DEAD_CODE_STRIPPING` setting is removed; this is *not*
  reflected in the upgrade guide. Reportedly (and in my experience,
  as best as I can remember and conclude), it's crucial; see
  facebook/react-native#27922 (comment).
  I copied the code.

----- facebook/react-native@8f954b365 -----

Just simple prose adjustments to a comment, but it's substantially
reworked in facebook/react-native@b4d1fcfb2 (which follows).

----- facebook/react-native@b4d1fcfb2 -----

This looks like a partial reversion of
facebook/react-native@898b1db6d (above), with a tweak; the
`FB_SONARKIT_ENABLED` conditional is removed from `AppDelegate.m`,
but that identifier now appears in the `project.pbxproj`.

`ENABLE_BITCODE = NO;` is added to the `project.pbxproj` to fix an
issue introduced in facebook/react-native@898b1db6d (see above); see
facebook/react-native#27565 (comment).
The issue would be better resolved with something like
facebook/flipper#1171. In particular, I'm inclined to agree with
that PR's author, who says "it strikes me that not having access to
current (and possible future) updates of a cryptography library is
not a good long-term plan".

This commit also continues the advancement of the FlipperKit pod's
version, this time to v0.30.2, and adjusts some comments.

----- facebook/react-native@f6a8452e7 -----

After an upgrade to FlipperKit v0.32.0 in
facebook/react-native@ada73a354, quickly reverted in
facebook/react-native@4bb17944f, this commit brings us to v0.33.1.

----- facebook/react-native@8858d879e -----

This is the last commit that affects Flipper on iOS before the v0.62
release was made. It doesn't continue the advancement of the
FlipperKit version (and a good thing, too, maybe!). It lists several
transitive dependencies of FlipperKit pods to the Podfile and gives
them each a `:configuration => 'Debug'` setting, and that's it.

It appears to be accounting for a CocoaPods quirk that means that,
before this change is made, all those dependencies would get
included in release builds, increasing the binary size. Might as
well avoid having any commits with that increased size; so, conclude
this giant commit with these changes.

All that's left is to actually enable Flipper, which we'll do after
the main upgrade commit; see
zulip#4244 (comment).

[1] react-native-community/upgrade-support#13
chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this pull request Sep 11, 2020
We'll actually enable it after the main RN v0.61 -> v0.62 upgrade
commit, if only because running Flipper pre-RN v0.62 isn't
advertised as something you can do. Enabling it means calling the
initialize function, like in facebook/react-native@05f5cb534, but in
the form it took in facebook/react-native@b4d1fcfb2 (and in the
conditional that appears there).

This encompasses several RN commits, as follows, some of which broke
builds (which poses a problem even without Flipper enabled). We lump
these in with their fixes, so that we don't knowingly introduce
errors at any commit in our project. Some of these problems can be
traced to upgrading the FlipperKit pod and not handling breaking
changes at the same time. Perhaps it wouldn't have been easy for RN
to catch these before merging.

Generally, though, the RN commits aren't very clear or coherent (at
least by our standards), so I feel safer flattening all of these
even if something could plausibly stand alone in our project.

----- facebook/react-native@70274f4e9 -----

This commit is unstable. One reason is that `pod install` fails
until `:modular_headers` is added to the `Yoga` pod declaration in
facebook/react-native@898b1db6d. The failure message:

```
[!] The following Swift pods cannot yet be integrated as static
libraries:

The Swift pod `YogaKit` depends upon `Yoga`, which does not define
modules. To opt into those targets generating module maps (which is
necessary to import them from Swift when building as static
libraries), you may set `use_modular_headers!` globally in your
Podfile, or specify `:modular_headers => true` for particular
dependencies.
```

----- facebook/react-native@e8541e03f -----

The claim is that this commit adds running React Dev Tools to the
template. I had thought this was something totally separate from
Flipper (and so this would naturally stand in its own commit), but
no; the added code comes from the `FlipperKitReactPlugin` subspec of
the `FlipperKit` pod, and it'll be invoked in the Flipper
initialization function.

This commit also advances the FlipperKit pod version to v0.23.6; I'm
not aware of any new issues that were specifically introduced in
this version.

Still, seems safest to apply these changes in this giant commit.

----- facebook/react-native@898b1db6d -----

A small handful of changes in `AppDelegate.m`, the Podfile, and
`project.pbxproj` are made here.

The motivation for the `AppDelegate.m` changes isn't clear to me,
unless it's "The integration of Flipper on iOS was crashing the
template"--not super descriptive or helpful in finding the origin of
the issue.

In the Podfile, the addition of `:modular_headers => true` to the
`Yoga` pod declaration fixes a `pod install` failure introduced in
facebook/react-native@70274f4e9, described above.

Also in the Podfile, the change of FlipperKit's version to v0.30.0
introduces a build failure associated with
facebook/flipper@ab121f9d9 (Flipper release tag v0.26.0); see
facebook/react-native#27565 (comment).
That issue was non-optimally resolved in
facebook/react-native@b4d1fcfb2, which we take for now in this
commit (see below); a more principled solution is open as
facebook/flipper#1171.

The `project.pbxproj` changes here aren't fully explained, but
here's what I think happened, and what I did about it:

- An empty Swift file was added, to rouse Xcode into being prepared
  to handle Swift files, which is needed for the "YogaKit" dep; see
  facebook/react-native#27426 (comment).
  This step is included in the upgrade guide [1]. The empty Swift
  file was later backed out in facebook/react-native@e3218a0d9 (see
  below), which is why it doesn't appear here.

- The addition of the empty Swift file activated a wizard that
  walked the user through setting up an Objective-C "bridging
  header" file and set some plausibly desired settings in the
  `project.pbxproj` file. RN deleted the bridging header file, but
  the settings remained.

  We had actually already set up a bridging header file a long time
  ago, in d38129b, and this setup wizard didn't activate when I
  created the empty Swift file. I tried to *get* it to activate (to
  better reproduce the settings changes) by deleting our bridging
  header file and re-adding the Swift file, but the wizard didn't
  activate. However, the settings that got added in d38129b seem
  to match these settings pretty closely; one notable difference is
  that a SWIFT_VERSION build setting is 4.2 instead of 5.0.

  In any case, the upgrade guide on the Xcode changes [1] only says
  the bridging-header wizard will "most likely" appear, and if it
  doesn't, just keep going.

- They added "English" under `knownRegions` in the project info. It
  appears Xcode doesn't like this change; it gets reverted later as
  part of facebook/react-native@ebb629d05 (which we take elsewhere
  in this series, before the upgrade, as an instance of zulip#4112), when
  they follow an Xcode automatic deprecation fix. So, ignore this.

----- facebook/react-native@e3218a0d9 -----

This Facebook commit looks fairly coherent, but it's a partial
reversion of facebook/react-native@898b1db6d (just above) with a
tweak on top of it. So, might as well put it into the same commit.

The `project.pbxproj` changes are as follows, as best as I can tell:

- The empty Swift file described just above is removed. The commit
  message makes it sound like it's no longer necessary for projects
  to make the Swift file in the first place; on the other hand, the
  upgrade guide on the Xcode changes [1] indicate that it should be
  created and then removed.

- A `LIBRARY_SEARCH_PATHS` setting is added. This *is* reflected in
  the upgrade guide on the Xcode changes [1]; following those
  instructions does indeed generate a portion of the diff.

- An `LD_RUNPATH_SEARCH_PATHS` setting is added; this is *not*
  reflected in the upgrade guide. It's reportedly crucial; see
  facebook/react-native#27922 (comment).
  I copied the code.

- A `DEAD_CODE_STRIPPING` setting is removed; this is *not*
  reflected in the upgrade guide. Reportedly (and in my experience,
  as best as I can remember and conclude), it's crucial; see
  facebook/react-native#27922 (comment).
  I copied the code.

----- facebook/react-native@8f954b365 -----

Just simple prose adjustments to a comment, but it's substantially
reworked in facebook/react-native@b4d1fcfb2 (which follows).

----- facebook/react-native@b4d1fcfb2 -----

This looks like a partial reversion of
facebook/react-native@898b1db6d (above), with a tweak; the
`FB_SONARKIT_ENABLED` conditional is removed from `AppDelegate.m`,
but that identifier now appears in the `project.pbxproj`.

`ENABLE_BITCODE = NO;` is added to the `project.pbxproj` to fix an
issue introduced in facebook/react-native@898b1db6d (see above); see
facebook/react-native#27565 (comment).
The issue would be better resolved with something like
facebook/flipper#1171. In particular, I'm inclined to agree with
that PR's author, who says "it strikes me that not having access to
current (and possible future) updates of a cryptography library is
not a good long-term plan".

This commit also continues the advancement of the FlipperKit pod's
version, this time to v0.30.2, and adjusts some comments.

----- facebook/react-native@f6a8452e7 -----

After an upgrade to FlipperKit v0.32.0 in
facebook/react-native@ada73a354, quickly reverted in
facebook/react-native@4bb17944f, this commit brings us to v0.33.1.

----- facebook/react-native@8858d879e -----

This is the last commit that affects Flipper on iOS before the v0.62
release was made. It doesn't continue the advancement of the
FlipperKit version (and a good thing, too, maybe!). It lists several
transitive dependencies of FlipperKit pods to the Podfile and gives
them each a `:configuration => 'Debug'` setting, and that's it.

It appears to be accounting for a CocoaPods quirk that means that,
before this change is made, all those dependencies would get
included in release builds, increasing the binary size. Might as
well avoid having any commits with that increased size; so, conclude
this giant commit with these changes.

All that's left is to actually enable Flipper, which we'll do after
the main upgrade commit; see
zulip#4244 (comment).

[1] react-native-community/upgrade-support#13
@cosmith
Copy link

cosmith commented Sep 28, 2020

I hit the same issue and can confirm that this change fixed the build for me. So now we're 2 to 1 ;)

@mikehardy
Copy link
Author

@cosmith glad to hear it works! But quality is not a vote of course 😆 I believe we are still here:

We're still waiting on some one that can reproduce the steps taken by @priteshrnandgaonkar where this PR apparently did not work. That's where we are blocked now.

If the maintainers say there is a case the patch doesn't work, I can't vote for my own patch! I just don't know what test was run and exactly how it was run to reproduce the problem so that I/we can fix it and move forward

@priteshrnandgaonkar
Copy link
Contributor

I verified that it works on the current SampleSwift and Sample apps. I will update the Flipper-Folly and make a release

@mikehardy
Copy link
Author

Fantastic! :-) thanks @priteshrnandgaonkar

@mikehardy mikehardy closed this Oct 15, 2020
@mikehardy
Copy link
Author

upstream has a merged fix now external to this PR, this is resolved

@mikehardy mikehardy deleted the patch-1 branch October 15, 2020 20:46
mkcode added a commit to MLH-Fellowship/react-native that referenced this pull request Nov 13, 2020
This is needed to update to a compatible version of OpenSSL which is a
dependency of Flipper.

See: facebook/flipper#1171
mkcode added a commit to MLH-Fellowship/react-native that referenced this pull request Nov 13, 2020
This is needed to update to a compatible version of OpenSSL which is a
dependency of Flipper.

See: facebook/flipper#1171
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Do not delete this pull request or issue due to inactivity. Needs Attention A project member needs to reply here
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Discussion: Folly use of an OpenSSL pod that is built with bitcode turned on
9 participants