promises icon indicating copy to clipboard operation
promises copied to clipboard

Add custom FBLPromises modulemap to cocoapods

Open mlfairy opened this issue 4 years ago • 20 comments

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

mlfairy avatar Oct 01 '19 02:10 mlfairy

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.

googlebot avatar Oct 01 '19 02:10 googlebot

@googlebot I signed it!

mlfairy avatar Oct 01 '19 02:10 mlfairy

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.

googlebot avatar Oct 01 '19 02:10 googlebot

@googlebot I consent

vijaysharm avatar Oct 01 '19 02:10 vijaysharm

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

googlebot avatar Oct 01 '19 02:10 googlebot

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

ghost avatar Oct 03 '19 00:10 ghost

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

mlfairy avatar Oct 03 '19 00:10 mlfairy

@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!

mlfairy avatar Oct 03 '19 01:10 mlfairy

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

ghost avatar Oct 03 '19 02:10 ghost

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

mlfairy avatar Oct 03 '19 02:10 mlfairy

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

ghost avatar Oct 03 '19 03:10 ghost

@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

mlfairy avatar Oct 03 '19 12:10 mlfairy

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?

ghost avatar Oct 03 '19 19:10 ghost

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 avatar Oct 03 '19 19:10 mlfairy

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

mlfairy avatar Oct 03 '19 19:10 mlfairy

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?

ghost avatar Oct 03 '19 19:10 ghost

The default Xcode version might make a difference

paulb777 avatar Oct 03 '19 20:10 paulb777

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.

mlfairy avatar Oct 03 '19 20:10 mlfairy

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?

eytanbiala avatar Mar 11 '20 16:03 eytanbiala

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)

sgehrman avatar Jul 06 '22 08:07 sgehrman