Conversation
Signed-off-by: Michael Rebello <me@michaelrebello.com>
Signed-off-by: Michael Rebello <me@michaelrebello.com>
EnvoyMobile.podspec
Outdated
| s.frameworks = 'SystemConfiguration' | ||
| s.source = { :http => "https://github.com/lyft/envoy-mobile/releases/download/v#{s.version}/envoy_ios_cocoapods.zip" } | ||
| s.vendored_frameworks = 'envoy_ios_cocoapods/Envoy.framework' | ||
| s.source_files = 'envoy_ios_cocoapods/Envoy.framework/Headers/*.h', 'envoy_ios_cocoapods/Envoy.framework/Swift/*.swift' |
There was a problem hiding this comment.
You shouldn't need source files since you're vendoring a framework?
There was a problem hiding this comment.
Without this the framework fails pod spec lint because it's missing libSwiftFoundation, among other Swift libraries. I added some more explanations to the PR description - without this and manually adding a .swift file, the pod doesn't compile. Totally open to better ways to do this
There was a problem hiding this comment.
Is there a corresponding CocoaPods issue about this? Seems weird that no one else would have this case
There was a problem hiding this comment.
Not from what I could tell, but I'm happy to file one. Assuming it's only an issue for mixed Objective-C/Swift libraries?
There was a problem hiding this comment.
CP likely doesn't check that either way, but maybe you adding the swift_version was what broke it?
There was a problem hiding this comment.
Commenting out swift_version and source_files yields the following errors:
Testing with `xcodebuild`.
-> EnvoyMobile (0.2.0)
- ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code.
- NOTE | xcodebuild: note: Using new build system
- NOTE | [iOS] xcodebuild: note: Planning build
- NOTE | [iOS] 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')
- NOTE | xcodebuild: ld: warning: Could not find or use auto-linked library 'swiftFoundation'
- NOTE | xcodebuild: ld: warning: Could not find or use auto-linked library 'swiftCompatibilityDynamicReplacements'
- NOTE | xcodebuild: ld: warning: Could not find or use auto-linked library 'swiftDarwin'
- NOTE | xcodebuild: ld: warning: Could not find or use auto-linked library 'swiftCoreFoundation'
- NOTE | xcodebuild: ld: warning: Could not find or use auto-linked library 'swiftCore'
- NOTE | xcodebuild: ld: warning: Could not find or use auto-linked library 'swiftCoreGraphics'
- NOTE | xcodebuild: ld: warning: Could not find or use auto-linked library 'swiftObjectiveC'
- NOTE | xcodebuild: ld: warning: Could not find or use auto-linked library 'swiftDispatch'
- NOTE | xcodebuild: ld: warning: Could not find or use auto-linked library 'swiftSwiftOnoneSupport'
- NOTE | xcodebuild: ld: warning: Could not find or use auto-linked library 'swiftCompatibility50'
- NOTE | xcodebuild: clang: error: linker command failed with exit code 1 (use -v to see invocation)
There was a problem hiding this comment.
Mind taking another look whenever you get a chance @keith?
Signed-off-by: Michael Rebello <me@michaelrebello.com>
keith
left a comment
There was a problem hiding this comment.
I think this is a fine workaround, but it would be nice to open an issue upstream about it
|
Yep, agree. Looks like CocoaPods/CocoaPods#8649 is actually this problem and their workaround was also to include a |
Adds a job (run on merges to master) to upload an artifact that can be consumed by CocoaPods. This process requires the following steps (outlined in #577): - Unzipping `envoy_ios_framework.zip` - Renaming the directory to `envoy_ios_cocoapods` - Creating an empty file at `envoy_ios_cocoapods/Envoy.framework/Swift/Empty.swift`. This forces CocoaPods to link Swift libraries as necessary. We worked around this in Bazel similarly in the past [here](94ada57#diff-6dc94efb18b54c46a32898ba3a5a0756R15) - Copying the repo's `LICENSE` file and placing it at `envoy_ios_cocoapods/LICENSE` - Re-zipping `envoy_ios_cocoapods` and uploading `envoy_ios_cocoapods.zip` Tested and validated that the artifact was successfully uploaded in [this job](https://github.com/lyft/envoy-mobile/pull/621/checks?check_run_id=376906484). Resolves #578.
Adds a job (run on merges to master) to upload an artifact that can be consumed by CocoaPods. This process requires the following steps (outlined in envoyproxy/envoy-mobile#577): - Unzipping `envoy_ios_framework.zip` - Renaming the directory to `envoy_ios_cocoapods` - Creating an empty file at `envoy_ios_cocoapods/Envoy.framework/Swift/Empty.swift`. This forces CocoaPods to link Swift libraries as necessary. We worked around this in Bazel similarly in the past [here](envoyproxy/envoy-mobile@b8216e4#diff-6dc94efb18b54c46a32898ba3a5a0756R15) - Copying the repo's `LICENSE` file and placing it at `envoy_ios_cocoapods/LICENSE` - Re-zipping `envoy_ios_cocoapods` and uploading `envoy_ios_cocoapods.zip` Tested and validated that the artifact was successfully uploaded in [this job](https://github.com/lyft/envoy-mobile/pull/621/checks?check_run_id=376906484). Resolves envoyproxy/envoy-mobile#578. Signed-off-by: JP Simard <jp@jpsim.com>
Adds a job (run on merges to master) to upload an artifact that can be consumed by CocoaPods. This process requires the following steps (outlined in envoyproxy/envoy-mobile#577): - Unzipping `envoy_ios_framework.zip` - Renaming the directory to `envoy_ios_cocoapods` - Creating an empty file at `envoy_ios_cocoapods/Envoy.framework/Swift/Empty.swift`. This forces CocoaPods to link Swift libraries as necessary. We worked around this in Bazel similarly in the past [here](envoyproxy/envoy-mobile@b8216e4#diff-6dc94efb18b54c46a32898ba3a5a0756R15) - Copying the repo's `LICENSE` file and placing it at `envoy_ios_cocoapods/LICENSE` - Re-zipping `envoy_ios_cocoapods` and uploading `envoy_ios_cocoapods.zip` Tested and validated that the artifact was successfully uploaded in [this job](https://github.com/lyft/envoy-mobile/pull/621/checks?check_run_id=376906484). Resolves envoyproxy/envoy-mobile#578. Signed-off-by: JP Simard <jp@jpsim.com>
Makes several updates to our podspec in order to fix CocoaPods integration with v0.2.0:
resolv.9andc++which is being done with Bazel todaySystemConfigurationwhich is being done with Bazel todaysource_fileswith an empty.swiftfile in order to ensure that Swift libraries are linked when building (i.e.,swiftFoundation)Important notes:
Releasing new versions of the pod requires the following manual changes:
envoy_ios_framework.zipenvoy_ios_cocoapodsenvoy_ios_cocoapods/Envoy.framework/Swift/Empty.swift. This forces CocoaPods to link Swift libraries as necessary. We worked around this in Bazel similarly in the past hereLICENSEfile and placing it atenvoy_ios_cocoapods/LICENSEenvoy_ios_cocoapodsand uploadingenvoy_ios_cocoapods.zipIn the future, we should see if this can be simplified or at the very least add a script that uploads this artifact with each commit to master just like we do with other artifacts. This is being tracked in #578.
Note: There is a similar problem reported in CocoaPods that requires this empty Swift file workaround: CocoaPods/CocoaPods#8649.
I tested this PR by using this podspec for building an app against Envoy Mobile with CocoaPods. This spec is currently published as v0.2.0.
Signed-off-by: Michael Rebello me@michaelrebello.com