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

Add custom FBLPromises modulemap to cocoapods #131

Open mlfairy opened 4 years ago

mlfairy commented 4 years ago

This is to address the issue described in this ticket: https://github.com/google/promises/issues/130

googlebot commented 4 years ago

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

mlfairy commented 4 years ago

@googlebot I signed it!

googlebot commented 4 years ago

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

vijaysharm commented 4 years ago

@googlebot I consent

googlebot commented 4 years ago

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

ghost commented 4 years ago

Thank you for the PR! Left a couple of comments. Are you able to verify that these changes work for iOS as well?

mlfairy commented 4 years ago

Thanks @temrich, Ill give each one of your comments a go, and get back to you.

mlfairy commented 4 years ago

@temrich I updated the PR with only the lines necessary for the module map to be included in the pod. Let me know if there's anything else I can do to help!

ghost commented 4 years ago

Thank you! Were you able to verify that this change works for both macOS and iOS? Also, which version of CocoaPods are you using?

mlfairy commented 4 years ago

@temrich I tried it on osx, and ios (and tvos just for good measure). Im currently on cocoapods 1.7.5

ghost commented 4 years ago

Thank you for verifying! Any idea why specifying the module_map is not required for iOS but is for OSX?

mlfairy commented 4 years ago

@temrich I can't explain why this only affects osx. The issue peaked my understanding of cocoapods and Xcode builds. This isn't a problem with Carthage or SPM, but im guessing that's because they both are using the project or targets to actually build the framework (which defines and uses the custom modulemap). In the case of cocoapods. it seems to be creating the project from the source files (including creating its own modulemap), without taking anything from the project/target itself.

Why this seems to affect osx and not any other platform is beyond my understanding. I tried to get to the root cause, but didnt come up with anything

ghost commented 4 years ago

I tried looking into this a bit more. It's interesting, I am seeing test errors when I run: pod spec lint PromisesObjC.podspec --no-clean --platforms=ios

but not when I run:

pod spec lint PromisesObjC.podspec --no-clean --platforms=osx

Do you see the same?

mlfairy commented 4 years ago

Hi @temrich

I just did a clean checkout and im not seeing error?

$ pod spec lint PromisesObjC.podspec --no-clean --platforms=ios

 -> PromisesObjC (1.2.8)
    - NOTE  | xcodebuild:  note: Using new build system
    - NOTE  | xcodebuild:  note: Planning build
    - NOTE  | xcodebuild:  note: Constructing build description
    - NOTE  | [iOS] xcodebuild:  warning: Skipping code signing because the target does not have an Info.plist file and one is not being generated automatically. (in target 'App' from project 'App')

Pods workspace available at `/var/folders/xp/jw8rssf12bz6mxy7fskgt_380000gn/T/CocoaPods-Lint-20191003-56438-1iemkmu-PromisesObjC/App.xcworkspace` for inspection.

Analyzed 1 podspec.

PromisesObjC.podspec passed validation.
$ pod spec lint PromisesObjC.podspec --no-clean --platforms=macos

 -> PromisesObjC (1.2.8)
    - NOTE  | xcodebuild:  note: Using new build system
    - NOTE  | xcodebuild:  note: Planning build
    - NOTE  | xcodebuild:  note: Constructing build description

Pods workspace available at `/var/folders/xp/jw8rssf12bz6mxy7fskgt_380000gn/T/CocoaPods-Lint-20191003-60715-swi1d4-PromisesObjC/App.xcworkspace` for inspection.

Analyzed 1 podspec.

PromisesObjC.podspec passed validation.

Again, I'm on cocoapods 1.7.5. If there's a version you'd like me to test with, im more than happy to do so.

mlfairy commented 4 years ago

Also, did you mean to run pod spec lint or pod lib lint? Are you checking the remote podspec or the local one?

ghost commented 4 years ago

I am using 1.7.5 as well. pod spec lint, was checking my local version without your changes.

@paulb777, anything else we should try to verify to determine whether this is a CocoaPods bug or not?

paulb777 commented 4 years ago

The default Xcode version might make a difference

mlfairy commented 4 years ago

Hi @paulb777 I tried it with Xcode 11 and Xcode 10.3, both seem to give me the error without patch, and pass with the patch.

eytanbiala commented 4 years ago

Hey, I think this also causes missing modulemaps when using Xcode's preprocessing of a file, error:

Module map file '~/Library/Developer/Xcode/DerivedData/app-aqiyiglyrsbmvzhjitgjbclucaxz/Build/Products/AppStore-iphonesimulator/PromisesSwift/Promises.modulemap' not found

Is there any reason not to merge this PR?

sgehrman commented 2 years ago

dyld[50618]: Library not loaded: @rpath/FBLPromises.framework/Versions/A/FBLPromises Referenced from: /Users/steve/Library/Developer/Xcode/DerivedData/Runner-dxohvkdpondjoxcgfbjhylmeoezo/Build/Products/Debug/Dashboard.app/Contents/MacOS/Dashboard Reason: tried: '/Users/steve/Library/Developer/Xcode/DerivedData/Runner-dxohvkdpondjoxcgfbjhylmeoezo/Build/Products/Debug/FBLPromises.framework/Versions/A/FBLPromises' (no such file), '/usr/lib/swift/FBLPromises.framework/Versions/A/FBLPromises' (no such file), '/Users/steve/Library/Developer/Xcode/DerivedData/Runner-dxohvkdpondjoxcgfbjhylmeoezo/Build/Products/Debug/Dashboard.app/Contents/MacOS/../Frameworks/FBLPromises.framework/Versions/A/FBLPromises' (code signature in <4EFC1C03-34BA-302C-8153-DF1B0507C339> '/Users/steve/Library/Developer/Xcode/DerivedData/Runner-dxohvkdpondjoxcgfbjhylmeoezo/Build/Products/Debug/Dashboard.app/Contents/Frameworks/FBLPromises.framework/Versions/A/FBLPromises' not valid for use in process: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?)), '/Users/steve/Library/Developer/Xcode/DerivedData/Runner-dxohvkdpondjoxcgfbjhylmeoezo/Build/Products/Debug/Dashboard.app/Contents/MacOS/Frameworks/FBLPromises.framework/Versions/A/FBLPromises' (no such file), '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/FBLPromises.framework/Versions/A/FBLPromises' (no such file), '/Users/steve/Library/Developer/Xcode/DerivedData/Runner-dxohvkdpondjoxcgfbjhylmeoezo/Build/Products/Debug/Dashboard.app/Contents/MacOS/../Frameworks/FBLPromises.framework/Versions/A/FBLPromises' (code signature in <4EFC1C03-34BA-302C-8153-DF1B0507C339> '/Users/steve/Library/Developer/Xcode/DerivedData/Runner-dxohvkdpondjoxcgfbjhylmeoezo/Build/Products/Debug/Dashboard.app/Contents/Frameworks/FBLPromises.framework/Versions/A/FBLPromises' not valid for use in process: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?)), '/usr/lib/swift/FBLPromises.framework/Versions/A/FBLPromises' (no such file), '/Users/steve/Library/Developer/Xcode/DerivedData/Runner-dxohvkdpondjoxcgfbjhylmeoezo/Build/Products/Debug/Dashboard.app/Contents/MacOS/../Frameworks/FBLPromises.framework/Versions/A/FBLPromises' (code signature in <4EFC1C03-34BA-302C-8153-DF1B0507C339> '/Users/steve/Library/Developer/Xcode/DerivedData/Runner-dxohvkdpondjoxcgfbjhylmeoezo/Build/Products/Debug/Dashboard.app/Contents/Frameworks/FBLPromises.framework/Versions/A/FBLPromises' not valid for use in process: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?)), '/Users/steve/Library/Developer/Xcode/DerivedData/Runner-dxohvkdpondjoxcgfbjhylmeoezo/Build/Products/Debug/Dashboard.app/Contents/MacOS/Frameworks/FBLPromises.framework/Versions/A/FBLPromises' (no such file), '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/FBLPromises.framework/Versions/A/FBLPromises' (no such file), '/Users/steve/Library/Developer/Xcode/DerivedData/Runner-dxohvkdpondjoxcgfbjhylmeoezo/Build/Products/Debug/Dashboard.app/Contents/MacOS/../Frameworks/FBLPromises.framework/Versions/A/FBLPromises' (code signature in <4EFC1C03-34BA-302C-8153-DF1B0507C339> '/Users/steve/Library/Developer/Xcode/DerivedData/Runner-dxohvkdpondjoxcgfbjhylmeoezo/Build/Products/Debug/Dashboard.app/Contents/Frameworks/FBLPromises.framework/Versions/A/FBLPromises' not valid for use in process: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?)), '/Library/Frameworks/FBLPromises.framework/Versions/A/FBLPromises' (no such file), '/System/Library/Frameworks/FBLPromises.framework/Versions/A/FBLPromises' (no such file)