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

[Yoga] Update to the current framework version (1.3.0) requires changing import path. #25

Closed
weibel opened this issue Apr 18, 2017 · 15 comments
Assignees

Comments

@weibel
Copy link
Contributor

weibel commented Apr 18, 2017

This is a copy of facebookarchive/AsyncDisplayKit#3248

On AsyncDisplayKit v. 2.2, Xcode 8.3.1

I'm testing Yoga for for some non-AsyncDisplayKit views, but not for any actual AsyncDisplayKit views.

AsyncDisplayKit 2.2 is installed with the Core subspec.
Yoga 1.3.0 is also installed by Cocoapods.

I wanted to update Yoga to the latest 1.3.0, but have run into a compile problem in ASDisplayNode+Beta.h and probably also elsewhere as Yuga has changed it's path names from#import <Yoga/Yoga.h> in 1.0.2 to #import <yoga/Yoga.h> in 1.3.0.

./Pods/AsyncDisplayKit/AsyncDisplayKit/ASDisplayNode+Beta.h:17:9: 
Non-portable path to file '<yoga/Yoga.h>'; specified path differs in case from file name on disk

I think the -Wno-nonportable-include-path warning is new with Xcode 8.3.

Is there a ways to prevent this when AsyncDisplayKit is installed without the Yoga subspec? The __has_include(<Yoga/Yoga.h>) check does not seem to work in this case.

Alternatively upgrade the Yoga podspec and the code to the later version

@maicki
Copy link
Contributor

maicki commented Apr 25, 2017

@appleguy We would appreciate your help on this issue to fix this. I think the right way to fix this issue is to to change the way Yoga is currently integrated. The current way can be a problem for people that are using Texture and have Yoga as another pod defined. They don't necessarily would like to use the Yoga integration within Texture, but maybe use it somewhere else in the app.

We have to provide a way to use Texture without automatically enabling Yoga, if it's not explicitly defined somewhere, so just enabling it by looking at a specific path is not feasible anymore.

I would appreciate and rely on @appleguy to look into this issue and provide a fix sooner than later. Thanks!

@appleguy
Copy link
Member

appleguy commented Apr 30, 2017 via email

appleguy added a commit that referenced this issue Apr 30, 2017
Everything seems to build fine with this version, so I'll
seek clarifying information from the reporter of this bug:

#25
@appleguy
Copy link
Member

@weibel hey there - could you take a look at this change and help me reproduce the issue?

#91

I tried building the examples/ASDKLayoutTransition project, which includes Yoga as a dependency in its Podfile, and I wasn't able to reproduce a build issue.

Is it possible that you have a case-sensitive filesystem on your computer? I would be happy to change the Yoga import if it has now become lowercase, if that fixes the issue for you.

@appleguy
Copy link
Member

Oh - I downloaded Xcode 8.3 when it came out, but it looks like it didn't get installed. That's probably the cause, as the description pointed out.

@maicki your description is helpful as well; I'm not sure this reporter is experiencing any issues from the Yoga integration being enabled, though. I think all of our other integrations, like PINRemoteImage and IGListKit, function in the same way...as long as the runtime characteristics can never be changed by the existence of the Yoga framework without the user adding calls to #if YOGA-gated API definitions, is there any trouble with using __has_include?

I'd expect that the rename to a lowercase yoga/ is a one-time change for the framework, so I'm not too worried about fixing that. I also know that the gated code can't affect a user unless they engage with yoga-specific APIs, so I think we will be safe after I confirm the capitalization fix.

@appleguy
Copy link
Member

@weibel I still wasn't able to hit the compiler warning after updating to 8.3.1. Let me know how you're able to reproduce - either send over a small test project, or see if you can modify the example project I mentioned to make it occur.

@appleguy appleguy changed the title Yoga 1.3.0 has changed it's path names [Yoga] Update to the current framework version (1.3.0) requires changing import path. Apr 30, 2017
@maicki
Copy link
Contributor

maicki commented Apr 30, 2017

@appleguy Yeah you are right all of our integrations changed to this way. It used to be that all our integration except Yoga were enabled by CocodaPods or Carthage if specifically defined via a subspec. Now all integrations look for the include path.

The problem I see in this integrations is: if users are using Texture, don't want to use this integration but e.g. use a different version of the library within a different part of the app. They declare Texture main spec in the Podfile and explicitly declare e.g. Yoga in there too with a version that is not supported yet in Texture (maybe it's older or newer ...). As we only look for the include header we will assume they would like to use Yoga in there, but that is not the case and compiler errors will happen as our integration is using either a too old or too new API.

cc @garrettmoon @Adlai-Holler See this conversion as I think it becomes a more general problem how we handle other libraries.

@appleguy
Copy link
Member

OK, that makes sense. I will be very cautious about this, and we should consider if we want some other kind of feature flag setup.

For Yoga specifically, the good news is that it is very unlikely that they will make API-breaking changes regularly. I doubt they even realized the capitalization thing could cause issues. So, as long as the Yoga support in the framework only uses APIs they had in 1.0, both forward and backward compatibility is likely to work smoothly. That's especially true for clients not using the node-based Yoga APIs / who happen to just be using it in another part of the app — the only risk is if we don't build.

We should probably create another issue or design discussion around the right way to control framework dependencies (Yoga included), and meanwhile I'll try to find a way to reproduce this problem and make sure it is fixed.

@weibel
Copy link
Contributor Author

weibel commented May 3, 2017

@appleguy I've tried to reproduce the issue on the demo project, but had no luck. This week I'll work on our integration of Texture, and hope to get to the bottom of what's going on.

@appleguy
Copy link
Member

appleguy commented May 3, 2017

@weibel awesome, thanks! Please do check if you have a Case Sensitive filesystem -- this could be a real issue, but possibly only reproduces on case sensitive. I would of course still want to fix it if that's what is going on.

Note that Yoga 1.4.0 is now out (although it is not up on Cocoapods), so you might want to try with that as well.

@appleguy
Copy link
Member

appleguy commented May 7, 2017

@weibel ping - let me know if you were able to get past this issue. Even though you didn't see it in the test project, is it still an issue in your main one?

@appleguy
Copy link
Member

@weibel could you try the latest Yoga? It is now on 1.5.0 (even on cocoapods - https://cocoapods.org/pods/Yoga).

If you could close out this task in the event you can no longer reproduce, that would be helpful. If you can reproduce, I'm still eager to get this fixed up. Thanks for your help!

@weibel
Copy link
Contributor Author

weibel commented May 11, 2017

I upgraded to the new Yoga, but the problem remained so I have dug a bit into it.

In our project we treat warnings as errors, so I think that's the reason I can't compile.
It's rumoured that the -Wno-nonportable-include-path warning has been included in Xcode in preparation for the APFS file system which is case sensitive. When APFS is rolled out these warnings will become errors, so they should be dealt with before then
Some discussion here http://clang-developers.42468.n3.nabble.com/case-insensitive-include-warning-td4050906.html

In my podfile I tried with inhibit_all_warnings! to no avail. So I'll tinker a bit with the warning settings

@garrettmoon
Copy link
Member

Related: #25

@weibel weibel closed this as completed May 17, 2017
@weibel weibel reopened this May 17, 2017
maicki pushed a commit that referenced this issue May 19, 2017
* [Yoga] Increment Yoga version to current, 1.3.0

Everything seems to build fine with this version, so I'll
seek clarifying information from the reporter of this bug:

#25

* Update Yoga version to 1.5.0
@weibel
Copy link
Contributor Author

weibel commented May 24, 2017

#91 did not fix the issue I had. I have made this PR to show what was needed to make our particular project compile #306

@appleguy
Copy link
Member

@weibel Awesome, thank you for the PR! I think we are close to a fix. Check out my comments and let me know what you think. Apologies for the latency in responding.

appleguy pushed a commit that referenced this issue Jun 7, 2017
* Change header path to fix #25

* Use module import

* Update ASDisplayNode+Beta.h
bernieperez pushed a commit to AtomTickets/Texture that referenced this issue Apr 25, 2018
* [Yoga] Increment Yoga version to current, 1.3.0

Everything seems to build fine with this version, so I'll
seek clarifying information from the reporter of this bug:

TextureGroup#25

* Update Yoga version to 1.5.0
bernieperez pushed a commit to AtomTickets/Texture that referenced this issue Apr 25, 2018
)

* Change header path to fix TextureGroup#25

* Use module import

* Update ASDisplayNode+Beta.h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants