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

Add custom FBLPromises modulemap to cocoapods #131

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mlfairy
Copy link

@mlfairy mlfairy commented Oct 1, 2019

This is to address the issue described in this ticket: #130

@googlebot
Copy link

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).

📝 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
Copy link
Author

mlfairy commented Oct 1, 2019

@googlebot I signed it!

@googlebot
Copy link

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
Copy link

@googlebot I consent

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

Comment on lines 28 to 30
s.xcconfig = {
'HEADER_SEARCH_PATHS' => "\"${PODS_TARGET_SRCROOT}/Sources/#{s.module_name}/include\""
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this still work if we remove s.xcconfig and use s.pod_target_xcconfig instead?

@@ -23,9 +23,14 @@ Pod::Spec.new do |s|
s.public_header_files = "Sources/#{s.module_name}/include/**/*.h"
s.private_header_files = "Sources/#{s.module_name}/include/FBLPromisePrivate.h"
s.source_files = "Sources/#{s.module_name}/**/*.{h,m}"
s.module_map = "Sources/#{s.module_name}/include/framework.modulemap"
s.preserve_path = "Sources/#{s.module_name}/include/framework.modulemap"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @temrich! do you specifically mean preserve_path or do you mean both preserve_path and module_map?

Ill try playing with a combination of both.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

preserve_path, but also curious why module_map is needed as well. Also, which version of CocoaPods are you using?

@ghost
Copy link

ghost commented Oct 3, 2019

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

@mlfairy
Copy link
Author

mlfairy commented Oct 3, 2019

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

@mlfairy
Copy link
Author

mlfairy commented Oct 3, 2019

@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
Copy link

ghost commented Oct 3, 2019

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
Copy link
Author

mlfairy commented Oct 3, 2019

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

@ghost
Copy link

ghost commented Oct 3, 2019

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

@mlfairy
Copy link
Author

mlfairy commented Oct 3, 2019

@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
Copy link

ghost commented Oct 3, 2019

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
Copy link
Author

mlfairy commented Oct 3, 2019

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
Copy link
Author

mlfairy commented Oct 3, 2019

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

@ghost
Copy link

ghost commented Oct 3, 2019

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
Copy link
Member

paulb777 commented Oct 3, 2019

The default Xcode version might make a difference

@mlfairy
Copy link
Author

mlfairy commented Oct 3, 2019

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
Copy link

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
Copy link

sgehrman commented Jul 6, 2022

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)

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

Successfully merging this pull request may close these issues.

None yet

6 participants