-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
Remove the need for s.static_framework = true by adding missing dependencies to React-CoreModules.podspec #26151
Conversation
|
I'm not sure why the tests have failed, it looks like it might be a timeout. It is working locally for me. |
Looks like this is for 0.61 RC branch, if this works, let's just merge it directly there. cc @grabbou |
I've restarted the job. I had this failure myself as well a couple of times. |
Hmm, looks like its still hanging. The previous error is definitely fixed (that was a compile error). I'll take a look. |
Oh, I am seeing the failure locally now:
Looks like we will need more podspec changes. I'll get to digging. |
Okay, so here's the problem. The best way to solve this would be to move CoreModules into |
Update: There should still be no problem with |
Do you know what the failure is?
I'm not sure we can do that, because CoreModules have bunch of iOS-only stuffs, while ReactCommon is mostly C++. |
The failure is the one I posted above ( I've done some more digging and I'm still not totally clear why this is happening. I put a breakpoint in So for some reason, the classes in the CoreModules framework are not yet loaded when the module registry expects them to be. I guess making everything static works because everything is loaded at once. It may be relevant that Maybe there is something we can do in
Yeah, that could be a problem. Maybe there is another solution here. |
Btw, did you have turbomodule enabled or disabled? Just to double check re: class loading issue. If you add this bridge delegate method:
and disable turbomodule, did the method get called with the missing module name? |
Oh, good catch! They were enabled. I just tried with turbomodules disabled and the tests pass and everything seems to work.
With turbomodules disabled, Interestingly, without So for some clarity:
We seem to be zeroing in on the cause here. Somehow turbomodules aren't playing nicely with |
OK, good to know. RNTester has it enabled, so at least we now know that it's TM setup specific.
The delegate method will be called because the legacy system doesn't find the module. So that's normal. The question now is, what's different for use_frameworks! vs without. I wonder if this C function gets called correctly and whether it returns the right class for you: https://github.com/facebook/react-native/blob/master/React/CoreModules/CoreModulesPlugins.mm#L27 |
Yes, that function is getting called and appears to be working correctly. However, placing a breakpoint here in |
|
Actually, on closer inspection, it looks like If I'm right, this seems to be a race condition between TM being setup and the JS being executed. I don't have very much knowledge about how this works internally so my investigations here are a little slow. Any pointers would be much appreciated! |
The binding is installed before js bundle is evaluated, so it should be available all the time, unless something changed or something threw a silent error somewhere. Do you know if this works on master? I'll try to debug further on the master build. |
Also, this is in RNTester right? |
Yes.
It's actually more broken on master, because it fails to build too, which is what 7f3a0e8 in this PR fixes. However, after cherry-picking that commit on master to fix the build error, I can reproduce the problem. Here are the steps I'm using to reproduce:
|
OK. I started some debugging yesterday and was hitting Xcode/simulator issue, likely unrelated to RNTester itself. I'll keep digging. |
Thanks @fkgozali! Its EOD here but I'll try check back later if there is anything I can clarify. I'll be able to spend more time investigating or fixing tomorrow if required. |
I got the build working on master with use_frameworks!, with just the following 2 lines of change to
I didn't hit the redbox that you observed previously, so I wonder if we had different setup or something? Note: I'll land the change on master regardless, so perhaps it can help you test master as well. |
Oh, that’s interesting. The error I’m seeing is the CI failure here too afaik. That will be helpful, thanks! |
did you happen to start up metro? If so, what command did you use? |
Summary: This is needed for use_frameworks! support with CocoaPods. Also, with recent changes to RCTImageLoader etc (moved to CoreModules), we need to add a dep to `React-RCTImage` pod. If this approach works for 0.61 branch as well, it should be beneficial to pick. Note that #26151 attempts to fix similar things, but in 0.61 branch, not master. Reviewed By: axe-fb Differential Revision: D17120352 fbshipit-source-id: ca96a7a61a6422a6f9fc3a4bf3add51e6f33f4f1
here's the commit from master btw: |
I didn't start it manually, but it was launch by the build phase when I run the tests. However, I get the same failure when starting it with Do you see the tests passing for you? It is failing on CI both on master and here. |
the test passed for me and in our CI. I wonder if there's some env difference, I'll try a fresh clone if the repo and explore more |
Ah, so its passing in FB CI? I wonder what is different between that and CircleCI. |
I debugged this a bit more, it's definitely a race condition between the lookup of the module vs the __turboModuleProxy installation. We'll need to investigate further. Note that RNTester app (with frameworks) seemed to work fine, it's just the tests that are failing. So I have a few suggestions:
|
I meant, the CI job should just verify that it compiles, no need to run the unit tests. |
I found the issue: for whatever reason, the test may set up a brand new bridge, separate from RNTester app's bridge (that is set up in AppDelegate.mm). For example:
We enabled TM in the RNTester AppDelegate.mm, so when the individual test setup runs, This is non ideal, but for now let's disable TM for any test purpose. I'll send a fix. |
Summary: For now, disable TM completely in test environment, like RNTester integration/unit tests. See details in T53341772 This also fixes the failure discussed in #26151 Reviewed By: PeteTheHeat Differential Revision: D17147915 fbshipit-source-id: 1c48ebb9c3b81fc08bc33606dcc38c29297d6010
Indeed having to patch all libs is not ideal 😂. Can't wait to have this merged & released! |
…dspec (facebook#25816)"" This reverts commit 612c033.
Summary: For now, disable TM completely in test environment, like RNTester integration/unit tests. See details in T53341772 This also fixes the failure discussed in facebook#26151 Reviewed By: PeteTheHeat Differential Revision: D17147915 fbshipit-source-id: 1c48ebb9c3b81fc08bc33606dcc38c29297d6010
7f3a0e8
to
e51227c
Compare
I'm not sure why this is failing now. I'll try take a look soon. |
cc @axe-fb - was there Yoga podspec change? |
I got this yesterday
I had to change my podfile from pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga' to pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga' |
Maybe those PRs just need to be picked to RC? cc @grabbou |
Summary: For now, disable TM completely in test environment, like RNTester integration/unit tests. See details in T53341772 This also fixes the failure discussed in #26151 Reviewed By: PeteTheHeat Differential Revision: D17147915 fbshipit-source-id: 1c48ebb9c3b81fc08bc33606dcc38c29297d6010
Thanks for working on this as well, @jtreanor! |
Hey y'all - I'm seeing the For context - I am using Cocoapods with |
Note, due to this podspec change in Yoga, I believe people may have to git remove the Target Support Files folder from git and then re-add as it would almost certainly show the folder Yoga as "yoga". For me, this was breaking appcenter CI builds. |
Summary
It was pointed out in #25818 (comment) that the iOS framework tests were failing on the 0.61-stable branch. As a quick fix @grabbou reverted #25816. This got us out of the bind but has potentially undesirable implications of requiring
s.static_framework = true
in every podspec that depends on RN.This is the clean, simple solution to avoid that. I have reverted the temporary patch and updated
React-CoreModules.podspec
to fix the build error.Changelog
I don't think we need an entry for this.
Test Plan
test_ios_frameworks
should be passing on CircleCI now.