Allow Yoga Pod to be built on any platform #821

Closed
pablosichert wants to merge 3 commits from master into master
pablosichert commented 2018-10-06 07:20:13 -07:00 (Migrated from github.com)

Currently the CocoaPod for Yoga explicitly states platform requirements.

Since the Yoga implementation doesn't depend on any platform features, it would be safe to build it on any platform.

That can be configured by omitting the platform/platforms key:

The platform on which this Pod is supported. Leaving this blank means the Pod is supported on all platforms.

http://guides.cocoapods.org/syntax/podspec.html#platform

Among others, that would allow to use the pod in macOS projects

Currently the CocoaPod for Yoga explicitly states platform requirements. Since the Yoga implementation doesn't depend on any platform features, it would be safe to build it on any platform. That can be configured by omitting the `platform`/`platforms` key: > The platform on which this Pod is supported. Leaving this blank means the Pod is supported on all platforms. > > http://guides.cocoapods.org/syntax/podspec.html#platform Among others, that would allow to use the pod in macOS projects
pablosichert commented 2018-11-28 05:54:08 -08:00 (Migrated from github.com)

@priteshrnandgaonkar could you have a look at this?

It's about removing a single line that would enable building the Yoga pod on all platforms.

(I saw that you authored commit c52c7cdd1e. Previously, it was configured for osx, now for ios and tvos, but it would work for all of them)

@priteshrnandgaonkar could you have a look at this? It's about removing a single line that would enable building the Yoga pod on all platforms. (I saw that you authored commit https://github.com/facebook/yoga/commit/c52c7cdd1e289656cb22f5ae82a7766790c94bc5. Previously, it was configured for `osx`, now for `ios` and `tvos`, but it would work for all of them)
facebook-github-bot (Migrated from github.com) reviewed 2018-12-06 06:42:33 -08:00
facebook-github-bot (Migrated from github.com) left a comment

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

@priteshrnandgaonkar has imported this pull request. If you are a Facebook employee, you can view this diff [on Phabricator](https://phabricator.internmc.facebook.com/D13358861).
priteshrnandgaonkar commented 2018-12-07 09:56:00 -08:00 (Migrated from github.com)

@PabloSichert Did you try pod lib lint ? It does not validate for OSX.

@PabloSichert Did you try `pod lib lint` ? It does not validate for OSX.
pablosichert commented 2018-12-07 10:03:06 -08:00 (Migrated from github.com)

When I run pod lib lint on master I get an error, so I don't think it has been introduced in this PR (and also not sure if you meant it was).

What does the output say?

When I run `pod lib lint` on `master` I get an error, so I don't think it has been introduced in this PR (and also not sure if you meant it was). What does the output say?
pablosichert commented 2018-12-07 10:22:19 -08:00 (Migrated from github.com)

If I checkout 1.10.0, pod lib lint --verbose Yoga.podspec succeeds.

On master I get:

pod lib lint --verbose Yoga.podspec output
 -> Yoga
  Yoga (1.9.0) - Analyzing on iOS 8.0 platform.
  Preparing

Analyzing dependencies

Inspecting targets to integrate
Using ARCHS setting to build architectures of target Pods-App: (``)

Fetching external sources
-> Fetching podspec for Yoga from /Volumes/git/facebook/yoga

Resolving dependencies of

Comparing resolved specification to the sandbox manifest
A Yoga

Downloading dependencies

-> Installing Yoga (1.9.0)

  • Running pre install hooks

Generating Pods project

  • Creating Pods project
  • Adding source files to Pods project
  • Adding frameworks to Pods project
  • Adding libraries to Pods project
  • Adding resources to Pods project
  • Adding development pod helper files to Pods project
  • Linking headers
  • Installing targets
    • Installing target Yoga iOS 8.0
      • Generating module map file at ../../../../private/var/folders/31/269zg3dn5hg6nrzd1dh2ddhm0000gn/T/CocoaPods-Lint-20181207-5004-3e8kok-Yoga/Pods/Target Support Files/Yoga/Yoga.modulemap
      • Generating umbrella header at ../../../../private/var/folders/31/269zg3dn5hg6nrzd1dh2ddhm0000gn/T/CocoaPods-Lint-20181207-5004-3e8kok-Yoga/Pods/Target Support Files/Yoga/Yoga-umbrella.h
      • Generating Info.plist file at ../../../../private/var/folders/31/269zg3dn5hg6nrzd1dh2ddhm0000gn/T/CocoaPods-Lint-20181207-5004-3e8kok-Yoga/Pods/Target Support Files/Yoga/Info.plist
    • Installing target Pods-App iOS 8.0
      • Generating Info.plist file at ../../../../private/var/folders/31/269zg3dn5hg6nrzd1dh2ddhm0000gn/T/CocoaPods-Lint-20181207-5004-3e8kok-Yoga/Pods/Target Support Files/Pods-App/Info.plist
      • Generating module map file at ../../../../private/var/folders/31/269zg3dn5hg6nrzd1dh2ddhm0000gn/T/CocoaPods-Lint-20181207-5004-3e8kok-Yoga/Pods/Target Support Files/Pods-App/Pods-App.modulemap
      • Generating umbrella header at ../../../../private/var/folders/31/269zg3dn5hg6nrzd1dh2ddhm0000gn/T/CocoaPods-Lint-20181207-5004-3e8kok-Yoga/Pods/Target Support Files/Pods-App/Pods-App-umbrella.h
  • Running post install hooks
  • Writing Xcode project file to ../../../../private/var/folders/31/269zg3dn5hg6nrzd1dh2ddhm0000gn/T/CocoaPods-Lint-20181207-5004-3e8kok-Yoga/Pods/Pods.xcodeproj
  • Writing Lockfile in ../../../../var/folders/31/269zg3dn5hg6nrzd1dh2ddhm0000gn/T/CocoaPods-Lint-20181207-5004-3e8kok-Yoga/Podfile.lock
  • Writing Manifest in ../../../../private/var/folders/31/269zg3dn5hg6nrzd1dh2ddhm0000gn/T/CocoaPods-Lint-20181207-5004-3e8kok-Yoga/Pods/Manifest.lock

Integrating client project

[!] Please close any current Xcode sessions and use App.xcworkspace for this project from now on.

Integrating target Pods-App (../../../../var/folders/31/269zg3dn5hg6nrzd1dh2ddhm0000gn/T/CocoaPods-Lint-20181207-5004-3e8kok-Yoga/App.xcodeproj project)
Adding Build Phase '[CP] Embed Pods Frameworks' to project.
Adding Build Phase '[CP] Check Pods Manifest.lock' to project.

  • Running post install hooks

-> Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.
Building with xcodebuild.
$ /usr/bin/xcodebuild clean build -workspace /var/folders/31/269zg3dn5hg6nrzd1dh2ddhm0000gn/T/CocoaPods-Lint-20181207-5004-3e8kok-Yoga/App.xcworkspace -scheme App -configuration Release CODE_SIGN_IDENTITY=- -sdk iphonesimulator -destination id=B82F4BE6-C48D-4515-8E19-1551054F3875
Build settings from command line:
CODE_SIGN_IDENTITY = -
SDKROOT = iphonesimulator12.1

note: Using new build system

** CLEAN SUCCEEDED ** [0.059 sec]

note: Using new build system
note: Planning build
note: Constructing build description
Build system information
warning: Skipping code signing because the target does not have an Info.plist file. (in target 'App')

/** TRUNCATED **/

/main.o
While building module 'yoga' imported from
/var/folders/31/269zg3dn5hg6nrzd1dh2ddhm0000gn/T/CocoaPods-Lint-20181207-5004-3e8kok-Yoga/App/main.m:3:
In file included from :1:
In file included from /Users/pablo/Library/Developer/Xcode/DerivedData/App-aluerrkmdyghggaqejkckrodpske/Build/Products/Release-appletvsimulator/Yoga/yoga.framework/Headers/Yoga-umbrella.h:15:
/Users/pablo/Library/Developer/Xcode/DerivedData/App-aluerrkmdyghggaqejkckrodpske/Build/Products/Release-appletvsimulator/Yoga/yoga.framework/Headers/Yoga.h:22:
10:
fatal error:
'YGValue.h' file not found
#include "YGValue.h"
^~~~~~~~~~~
1 error
generated.
/var/folders/31/269zg3dn5hg6nrzd1dh2ddhm0000gn/T/CocoaPods-Lint-20181207-5004-3e8kok-Yoga/App/main.m
:3:9
: fatal error: could not build module 'yoga'
@import yoga;
~~~~~~~^~~~
2 errors generated.

Testing with xcodebuild.
-> Yoga (1.9.0)
- ERROR | xcodebuild: Returned an unsuccessful exit code.
- NOTE | xcodebuild: note: Using new build system
- NOTE | xcodebuild: note: Planning build
- NOTE | xcodebuild: note: Constructing build description
- NOTE | xcodebuild: warning: Skipping code signing because the target does not have an Info.plist file. (in target 'App')
- NOTE | [iOS] xcodebuild: 10: fatal error:
- NOTE | [iOS] xcodebuild: :9: fatal error: could not build module 'yoga'
- NOTE | [iOS] xcodebuild: /Users/pablo/Library/Developer/Xcode/DerivedData/App-aluerrkmdyghggaqejkckrodpske/Build/Products/Release-iphonesimulator/Yoga/yoga.framework/Headers/Yoga.h:22:10: fatal error: 'YGValue.h' file not found
- NOTE | [iOS] xcodebuild: /var/folders/31/269zg3dn5hg6nrzd1dh2ddhm0000gn/T/CocoaPods-Lint-20181207-5004-3e8kok-Yoga/App/main.m:3:9: fatal error: could not build module 'yoga'
- NOTE | [tvOS] xcodebuild: fatal error:
- NOTE | [tvOS] xcodebuild: : fatal error: could not build module 'yoga'

[!] Yoga did not pass validation, due to 1 error.
You can use the --no-clean option to inspect any issue.

/usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/lib/cocoapods/command/lib/lint.rb:85:in block in run' /usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/lib/cocoapods/command/lib/lint.rb:54:in each'
/usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/lib/cocoapods/command/lib/lint.rb:54:in run' /usr/local/Cellar/cocoapods/1.5.3/libexec/gems/claide-1.0.2/lib/claide/command.rb:334:in run'
/usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/lib/cocoapods/command.rb:52:in run' /usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/bin/pod:55:in <top (required)>'
/usr/local/Cellar/cocoapods/1.5.3/libexec/bin/pod:22:in load' /usr/local/Cellar/cocoapods/1.5.3/libexec/bin/pod:22:in

'


Quick guess, d19da9e528 could be related

If I checkout `1.10.0`, `pod lib lint --verbose Yoga.podspec` succeeds. On `master` I get: <details> <summary><code>pod lib lint --verbose Yoga.podspec</code> output</summary> <pre> -> Yoga Yoga (1.9.0) - Analyzing on iOS 8.0 platform. Preparing Analyzing dependencies Inspecting targets to integrate Using `ARCHS` setting to build architectures of target `Pods-App`: (``) Fetching external sources -> Fetching podspec for `Yoga` from `/Volumes/git/facebook/yoga` Resolving dependencies of Comparing resolved specification to the sandbox manifest A Yoga Downloading dependencies -> Installing Yoga (1.9.0) - Running pre install hooks Generating Pods project - Creating Pods project - Adding source files to Pods project - Adding frameworks to Pods project - Adding libraries to Pods project - Adding resources to Pods project - Adding development pod helper files to Pods project - Linking headers - Installing targets - Installing target `Yoga` iOS 8.0 - Generating module map file at `../../../../private/var/folders/31/269zg3dn5hg6nrzd1dh2ddhm0000gn/T/CocoaPods-Lint-20181207-5004-3e8kok-Yoga/Pods/Target Support Files/Yoga/Yoga.modulemap` - Generating umbrella header at `../../../../private/var/folders/31/269zg3dn5hg6nrzd1dh2ddhm0000gn/T/CocoaPods-Lint-20181207-5004-3e8kok-Yoga/Pods/Target Support Files/Yoga/Yoga-umbrella.h` - Generating Info.plist file at `../../../../private/var/folders/31/269zg3dn5hg6nrzd1dh2ddhm0000gn/T/CocoaPods-Lint-20181207-5004-3e8kok-Yoga/Pods/Target Support Files/Yoga/Info.plist` - Installing target `Pods-App` iOS 8.0 - Generating Info.plist file at `../../../../private/var/folders/31/269zg3dn5hg6nrzd1dh2ddhm0000gn/T/CocoaPods-Lint-20181207-5004-3e8kok-Yoga/Pods/Target Support Files/Pods-App/Info.plist` - Generating module map file at `../../../../private/var/folders/31/269zg3dn5hg6nrzd1dh2ddhm0000gn/T/CocoaPods-Lint-20181207-5004-3e8kok-Yoga/Pods/Target Support Files/Pods-App/Pods-App.modulemap` - Generating umbrella header at `../../../../private/var/folders/31/269zg3dn5hg6nrzd1dh2ddhm0000gn/T/CocoaPods-Lint-20181207-5004-3e8kok-Yoga/Pods/Target Support Files/Pods-App/Pods-App-umbrella.h` - Running post install hooks - Writing Xcode project file to `../../../../private/var/folders/31/269zg3dn5hg6nrzd1dh2ddhm0000gn/T/CocoaPods-Lint-20181207-5004-3e8kok-Yoga/Pods/Pods.xcodeproj` - Writing Lockfile in `../../../../var/folders/31/269zg3dn5hg6nrzd1dh2ddhm0000gn/T/CocoaPods-Lint-20181207-5004-3e8kok-Yoga/Podfile.lock` - Writing Manifest in `../../../../private/var/folders/31/269zg3dn5hg6nrzd1dh2ddhm0000gn/T/CocoaPods-Lint-20181207-5004-3e8kok-Yoga/Pods/Manifest.lock` Integrating client project [!] Please close any current Xcode sessions and use `App.xcworkspace` for this project from now on. Integrating target `Pods-App` (`../../../../var/folders/31/269zg3dn5hg6nrzd1dh2ddhm0000gn/T/CocoaPods-Lint-20181207-5004-3e8kok-Yoga/App.xcodeproj` project) Adding Build Phase '[CP] Embed Pods Frameworks' to project. Adding Build Phase '[CP] Check Pods Manifest.lock' to project. - Running post install hooks -> Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed. Building with `xcodebuild`. $ /usr/bin/xcodebuild clean build -workspace /var/folders/31/269zg3dn5hg6nrzd1dh2ddhm0000gn/T/CocoaPods-Lint-20181207-5004-3e8kok-Yoga/App.xcworkspace -scheme App -configuration Release CODE_SIGN_IDENTITY=- -sdk iphonesimulator -destination id=B82F4BE6-C48D-4515-8E19-1551054F3875 Build settings from command line: CODE_SIGN_IDENTITY = - SDKROOT = iphonesimulator12.1 note: Using new build system ** CLEAN SUCCEEDED ** [0.059 sec] note: Using new build system note: Planning build note: Constructing build description Build system information warning: Skipping code signing because the target does not have an Info.plist file. (in target 'App') /** TRUNCATED **/ /main.o While building module 'yoga' imported from /var/folders/31/269zg3dn5hg6nrzd1dh2ddhm0000gn/T/CocoaPods-Lint-20181207-5004-3e8kok-Yoga/App/main.m:3: In file included from <module-includes>:1: In file included from /Users/pablo/Library/Developer/Xcode/DerivedData/App-aluerrkmdyghggaqejkckrodpske/Build/Products/Release-appletvsimulator/Yoga/yoga.framework/Headers/Yoga-umbrella.h:15: /Users/pablo/Library/Developer/Xcode/DerivedData/App-aluerrkmdyghggaqejkckrodpske/Build/Products/Release-appletvsimulator/Yoga/yoga.framework/Headers/Yoga.h:22: 10: fatal error: 'YGValue.h' file not found #include "YGValue.h" ^~~~~~~~~~~ 1 error generated. /var/folders/31/269zg3dn5hg6nrzd1dh2ddhm0000gn/T/CocoaPods-Lint-20181207-5004-3e8kok-Yoga/App/main.m :3:9 : fatal error: could not build module 'yoga' @import yoga; ~~~~~~~^~~~ 2 errors generated. Testing with `xcodebuild`. -> Yoga (1.9.0) - ERROR | xcodebuild: Returned an unsuccessful exit code. - NOTE | xcodebuild: note: Using new build system - NOTE | xcodebuild: note: Planning build - NOTE | xcodebuild: note: Constructing build description - NOTE | xcodebuild: warning: Skipping code signing because the target does not have an Info.plist file. (in target 'App') - NOTE | [iOS] xcodebuild: 10: fatal error: - NOTE | [iOS] xcodebuild: :9: fatal error: could not build module 'yoga' - NOTE | [iOS] xcodebuild: /Users/pablo/Library/Developer/Xcode/DerivedData/App-aluerrkmdyghggaqejkckrodpske/Build/Products/Release-iphonesimulator/Yoga/yoga.framework/Headers/Yoga.h:22:10: fatal error: 'YGValue.h' file not found - NOTE | [iOS] xcodebuild: /var/folders/31/269zg3dn5hg6nrzd1dh2ddhm0000gn/T/CocoaPods-Lint-20181207-5004-3e8kok-Yoga/App/main.m:3:9: fatal error: could not build module 'yoga' - NOTE | [tvOS] xcodebuild: fatal error: - NOTE | [tvOS] xcodebuild: : fatal error: could not build module 'yoga' [!] Yoga did not pass validation, due to 1 error. You can use the `--no-clean` option to inspect any issue. /usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/lib/cocoapods/command/lib/lint.rb:85:in `block in run' /usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/lib/cocoapods/command/lib/lint.rb:54:in `each' /usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/lib/cocoapods/command/lib/lint.rb:54:in `run' /usr/local/Cellar/cocoapods/1.5.3/libexec/gems/claide-1.0.2/lib/claide/command.rb:334:in `run' /usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/lib/cocoapods/command.rb:52:in `run' /usr/local/Cellar/cocoapods/1.5.3/libexec/gems/cocoapods-1.5.3/bin/pod:55:in `<top (required)>' /usr/local/Cellar/cocoapods/1.5.3/libexec/bin/pod:22:in `load' /usr/local/Cellar/cocoapods/1.5.3/libexec/bin/pod:22:in `<main>' </pre> </details> <br> Quick guess, https://github.com/facebook/yoga/commit/d19da9e528842871e4610066b325c8cd6af0a160 could be related
pablosichert commented 2018-12-07 10:30:10 -08:00 (Migrated from github.com)

If YGValue is added to spec.public_header_files in Yoga.podspec, it seems to work

If `YGValue` is added to `spec.public_header_files` in `Yoga.podspec`, it seems to work
pablosichert commented 2018-12-07 10:40:53 -08:00 (Migrated from github.com)

You're right - aside from that there seem to be other errors when trying to build for macOS.

I'm looking into it

You're right - aside from that there seem to be other errors when trying to build for macOS. I'm looking into it
pablosichert commented 2018-12-07 11:23:39 -08:00 (Migrated from github.com)

Ok, I got it to work now.

Would be nice if you could have a look again.

Thanks for your time so far, @priteshrnandgaonkar

Ok, I got it to work now. - You likely got an `EXPANDED_CODE_SIGN_IDENTITY: unbound variable` error when building the `osx` target with CocoaPods `1.5.x`. Upgrading to `1.6.x` (beta, unfortunately) seemed to fix it. See https://github.com/CocoaPods/CocoaPods/issues/7708 - Added `YGValue` to public headers - Explicitly added platform requirements since the default for `osx` is `10.6`, but apparently `10.7` is needed for `-stdlib=libc++`. Took the other values from https://guides.cocoapods.org/syntax/podfile.html#platform Would be nice if you could have a look again. Thanks for your time so far, @priteshrnandgaonkar
facebook-github-bot (Migrated from github.com) reviewed 2019-01-28 13:21:26 -08:00
facebook-github-bot (Migrated from github.com) left a comment

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

@davidaurelio has imported this pull request. If you are a Facebook employee, you can view this diff [on Phabricator](https://phabricator.internmc.facebook.com/D13848153).

Pull request closed

Sign in to join this conversation.
No description provided.