google / promises

Promises is a modern framework that provides a synchronization construct for Swift and Objective-C.
Apache License 2.0
3.8k stars 294 forks source link

[OSX] Umbrella header for module 'FBLPromises' does not include header '/Headers/PromisesObjC-umbrella.h' #130

Open mlfairy opened 4 years ago

mlfairy commented 4 years ago

Hi, I'm sorry to cross post this with stackoverflow, but there was no tag related to google-promises.

I'm working on a framework that uses promises internally, and I'd like the framework to work cross platform for iOS, macos and tvOS.

When building my framework for distribution with cocoapods, the lint check is failing specifically for macos, but not the other platforms.

I've described the error in this ticket: https://stackoverflow.com/questions/58171317/umbrella-header-for-module-fblpromises-does-not-include-header-headers-promi

If I can get some help, i'd very much appreciate it.

mlfairy commented 4 years ago

Ok, seems this happens when i include Promises with any MacOS app. I have a link to a project which shows the problem.

I simply created a new macos app, added a Podfile, and added Promises as a dependency.

mlfairy commented 4 years ago

I forked the repo, and submitted a PR for what I believe fixes this issue.

My understanding is that the custom modulemap file that's defined in the FBLPromises target is not used by Cocoapods (which instead is generating its own umbrella header, duplicating the includes).

In the same sample app i provided in the previous comment, I instead changed my podfile to point to my fork. This seemed to clean up the problem.

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'TestPromises' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!
  pod 'PromisesObjC', :git => "https://github.com/mlfairy/promises.git"
  pod 'PromisesSwift', :git => "https://github.com/mlfairy/promises.git"

  # Pods for TestPromises

end
eytanbiala commented 4 years ago

Friendly ping here - @mlfairy are you still using your custom fork? @tristane0 what do you think of merging this PR?

ghost commented 4 years ago

Apologize for the extremely long delay in following up on this. Before merging, can we test with the latest versions of cocoapods and Xcode for both iOS and macOS? May also want to test without the change too just to make sure it’s still required.

Thank you!

mlfairy commented 4 years ago

hi @eytanbiala I was up until a few weeks ago. Then i moved over to using combine. thanks for checking in!

ykjchen commented 4 years ago

I was able to reproduce mlfairy's issue with Cocoapods version 1.7.5, but the issue appears to have been fixed in more recent Cocoapods version, and pod spec lint passes with Cocoapods version 1.9.2. I was unable to track down the specific Cocoapods fix that addressed this, but also did not spent much time searching.

Repro steps:

  1. run pod lib create Foo to create a framework targeting OSX,
  2. update podspec to include s.osx.dependency "PromisesSwift", "~> 1.2.8"
  3. push the repo created in step 1 to github,
  4. tagged the commit with version 0.1.0,
  5. run pod spec lint --no-clean --fail-fast --verbose --allow-warnings --platforms=macos

Even though this issue was addressed by some Cocoapods update, it may be preferable to specify s.module_map since Promises provides a custom module map. But I haven't had a chance yet to verify this across the various platforms.

@eytanbiala it sounds like your issue was not identical (it doesn't sound like you're maintaining a framework distributed through Cocoapods)... are you still having issues with this?