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

Test RNTesterPods on CI with use_frameworks! enabled #25818

Closed
wants to merge 2 commits into from

Conversation

jtreanor
Copy link
Contributor

@jtreanor jtreanor commented Jul 25, 2019

Summary

This adds a test_ios_frameworks job to CircleCI to test the RNTesterPods project with use_frameworks! enabled. It will ensure the issue in #25349 is not reintroduced as suggested in #25619 (comment).

Changelog

[iOS] [Internal] - Added CircleCI job for testing RNTesterPods with use_frameworks! enabled.

Test Plan

Tests seem to be failing on master at the moment but you can see that the new job builds successfully here. You can confirm it installs the pods with use_frameworks! by seeing that Installing pods with use_frameworks! is at the start of the log for the Generate RNTesterPods Workspace step.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 25, 2019
@pull-bot
Copy link

pull-bot commented Jul 25, 2019

Messages
📖

📋 Verify Changelog Format - A changelog entry has the following format: [CATEGORY] [TYPE] - Message.

CATEGORY may be:
  • General
  • iOS
  • Android
  • JavaScript
  • Internal (for changes that do not need to be called out in the release notes)

TYPE may be:

  • Added, for new features.
  • Changed, for changes in existing functionality.
  • Deprecated, for soon-to-be removed features.
  • Removed, for now removed features.
  • Fixed, for any bug fixes.
  • Security, in case of vulnerabilities.

MESSAGE may answer "what and why" on a feature level. Use this to briefly tell React Native users about notable changes.

Generated by 🚫 dangerJS against 7910c91

environment:
USE_FRAMEWORKS: '1'

- run: yarn test-ios
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This just adds a second test run with frameworks enabled to the test_ios job. @fkgozali would you prefer this to be a separate parallel job (such as test_ios_frameworks) or is it better here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, I think a separate job probably is better. Let me know if you would like me to change it back.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'll have to defer to @hramos for the actual tradeoff discussion. To me, putting it in one place is easier to maintain (because it's basically testing exactly the same thing, just with framework output).

So for now, let's get this in as is and we can adjust it if needed in the future.

@jtreanor jtreanor force-pushed the cocoapods-frameworks-ci branch from 2e9b308 to dc15cdf Compare July 25, 2019 10:57
@jtreanor jtreanor force-pushed the cocoapods-frameworks-ci branch from dc15cdf to 7910c91 Compare July 25, 2019 11:14
@jtreanor jtreanor marked this pull request as ready for review July 25, 2019 11:33
@jtreanor jtreanor requested a review from hramos as a code owner July 25, 2019 11:33
@jtreanor jtreanor changed the title Add configuration to allow RNTesterPods to be tested on CI with use_frameworks! enabled Test RNTesterPods on CI with use_frameworks! enabled Jul 25, 2019
@jtreanor
Copy link
Contributor Author

Its worth pointing out that fixing #23561 could potentially make this redundant. process-podspecs.sh validates the podspecs with pod lib lint both for frameworks and libraries. When that is working again its arguable that a full test run of RNTesterPods for use_frameworks! would not be needed.

A quick look suggests it shouldn't be too hard to fix process-podspecs.sh. I'll take a look next week.

@fkgozali
Copy link
Contributor

A quick look suggests it shouldn't be too hard to fix process-podspecs.sh.

@hramos: do we still use that script? I think ios CI builds are fully using cocoapods already?

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

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

@jtreanor
Copy link
Contributor Author

I think the suggestion in that issue is to get it working again. Even if the repo uses CocoaPods extensively it could be useful to validate the podspecs.

@jtreanor
Copy link
Contributor Author

@fkgozali Not related. master is currently failing with the same error.

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @jtreanor in bbde55e.

When will my fix make it into a release? | Upcoming Releases

@react-native-bot react-native-bot added the Merged This PR has been merged. label Jul 25, 2019
@fkgozali
Copy link
Contributor

@facebook-github-bot facebook-github-bot closed this in bbde55e 1 hour ago

Not sure why the bot didn't close this PR automatically... Anyway, closing!

@facebook-github-bot
Copy link
Contributor

Something went wrong executing that command, @hramos could you take a look?

TMomemt pushed a commit to TMomemt/react-native that referenced this pull request Aug 5, 2019
Summary:
This adds a `test_ios_frameworks` job to CircleCI to test the `RNTesterPods` project with `use_frameworks!` enabled. It will ensure the issue in facebook#25349 is not reintroduced as suggested in facebook#25619 (comment).

[iOS] [Internal] - Added CircleCI job for testing `RNTesterPods` with `use_frameworks!` enabled.
Pull Request resolved: facebook#25818

Test Plan: Tests seem to be failing on `master` at the moment but you can see that the new job builds successfully [here](https://circleci.com/gh/facebook/react-native/103929?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link). You can confirm it installs the pods with `use_frameworks!` by seeing that `Installing pods with use_frameworks!` is at the start of the log for the `Generate RNTesterPods Workspace` step.

Reviewed By: hramos

Differential Revision: D16495016

Pulled By: fkgozali

fbshipit-source-id: 8ef607cc3a152f599d226f9f45d990fba50a65d4
@grabbou
Copy link
Contributor

grabbou commented Aug 21, 2019

The tests are now failing on 0.61-stable branch (https://circleci.com/gh/facebook/react-native/107763) with the following:

❌ Undefined symbols for architecture x86_64
Symbol: _OBJCCLASS$__RCTTypedModuleConstants
Referenced from: objc-class-ref in RCTPlatform.o

I believe this may be related to the CocoaPods integration - does anyone happen to know where to dig this deeper?

@jtreanor
Copy link
Contributor Author

I can take a look @grabbou. I think this should be relatively straightforward to fix.

@jtreanor
Copy link
Contributor Author

Okay, so I did a git bisect and it seems that the test failure was first introduced by 2956eb2.

It seems these tests have been failing on master for a while 😞 I'm looking into how much effort it will take to fix.

@grabbou
Copy link
Contributor

grabbou commented Aug 21, 2019 via email

@fkgozali
Copy link
Contributor

cc @osdnk

@grabbou / @jtreanor that commit seems likely culprit. To revert it, you'll have to revert 28e18e4 beforehand (they're related change)

@jtreanor
Copy link
Contributor Author

Great, thanks! Make sure to check 0.61-stable too, I've reverted one commit
there to make other lanes work as well.

Yeah, I've confirmed the problem on 0.61-stable.

@grabbou / @jtreanor that commit seems likely culprit. To revert it, you'll have to revert 28e18e4 beforehand (they're related change)

Thanks @fkgozali! I'll try that out. The alternative approach which has worked for me is to add s.static_framework = true to all of the podspecs as we discussed in #25619 (comment).

@jtreanor
Copy link
Contributor Author

Reverting those commits fixed the RCTPlatform build error but uncovered a number of other build errors (see below) that seem to be caused by bf78d79. That didn't revert cleanly.

Undefined symbols for architecture x86_64:
  "_RCTGetImageData", referenced from:
      ___45-[RCTImageStoreManager storeImage:withBlock:]_block_invoke in RCTImageStoreManager.o
      ___47-[RCTImageStoreManager(Deprecated) storeImage:]_block_invoke in RCTImageStoreManager.o
  "_OBJC_CLASS_$_RCTImageCache", referenced from:
      objc-class-ref in RCTImageLoader.o
  "_RCTImageHasAlpha", referenced from:
      ___43-[RCTImageLoader sendRequest:withDelegate:]_block_invoke in RCTImageLoader.o
  "_RCTTransformImage", referenced from:
      ___75-[RCTImageEditingManager cropImage:cropData:successCallback:errorCallback:]_block_invoke in RCTImageEditingManager.o
      RCTResizeImageIfNeeded(UIImage*, CGSize, double, RCTResizeMode) in RCTImageLoader.o
  "_RCTGetImageMetadata", referenced from:
      ___50-[RCTImageLoader getImageSizeForURLRequest:block:]_block_invoke in RCTImageLoader.o
  "_RCTDecodeImageWithData", referenced from:
      ___80-[RCTImageLoader decodeImageData:size:scale:clipped:resizeMode:completionBlock:]_block_invoke_3.264 in RCTImageLoader.o
  "_RCTTransformFromTargetRect", referenced from:
      ___75-[RCTImageEditingManager cropImage:cropData:successCallback:errorCallback:]_block_invoke in RCTImageEditingManager.o
      RCTResizeImageIfNeeded(UIImage*, CGSize, double, RCTResizeMode) in RCTImageLoader.o
  "_RCTTargetRect", referenced from:
      ___75-[RCTImageEditingManager cropImage:cropData:successCallback:errorCallback:]_block_invoke in RCTImageEditingManager.o
      RCTResizeImageIfNeeded(UIImage*, CGSize, double, RCTResizeMode) in RCTImageLoader.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@fkgozali It seems that this problem will continue to occur with CoreModules. What are your thoughts on using s.static_framework = true in the podspecs to resolve it?

@fkgozali
Copy link
Contributor

What are your thoughts on using s.static_framework = true in the podspecs to resolve it?

I think this is fine to do to unblock. I won't have cycle to debug further for the next week or so, so let's do this quick fix.

@grabbou
Copy link
Contributor

grabbou commented Aug 22, 2019

I have reverted #25816 on the 0.61-stable branch. However, from what I understand from the linked PR, the issue may still occur within existing apps that depend on React podspecs and have use_frameworks turned on.

I think it makes sense to note this explicitly in the first release candidate and that we are working on providing a better solution to this problem.

@jtreanor
Copy link
Contributor Author

Thanks @grabbou, you beat me to it.

However, from what I understand from the linked PR, the issue may still occur within existing apps that depend on React podspecs and have use_frameworks turned on.

The issue will likely be for third party libraries which have podspecs. It would now be required to have s.static_framework = true for use_frameworks! to work.

I think it makes sense to note this explicitly in the first release candidate and that we are working on providing a better solution to this problem.

That makes sense.

@jtreanor
Copy link
Contributor Author

Okay, I have found a simple solution that does not require s.static_framework = true. We just needed to update the CoreModules podspec. I've opened a PR in #26151 to target the 0.61-stable branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants