cocoapods-generate icon indicating copy to clipboard operation
cocoapods-generate copied to clipboard

v2.0.0 adds CWD as an absolute path which can conflict with local sources

Open mikehaney24 opened this issue 4 years ago • 2 comments

In 1.6.0, the cwd wasn't added to the list of local sources (AFAICT), but in v2.0.0, the cwd is added as an absolute path, so if you specify local sources, they can be at odds with each other.

In v2.0.0, I cannot generate my project and the following error is printed:

Generating GoogleDataTransportCCTSupport in `gen/GoogleDataTransportCCTSupport`
[!] There are multiple dependencies with different sources for `GoogleDataTransportCCTSupport` in `CocoaPods.podfile.yaml`:

- GoogleDataTransportCCTSupport/Tests-Integration (from `../../GoogleDataTransportCCTSupport.podspec`)
- GoogleDataTransportCCTSupport/Tests-Monkey (from `../../GoogleDataTransportCCTSupport.podspec`)
- GoogleDataTransportCCTSupport/Tests-Unit (from `../../GoogleDataTransportCCTSupport.podspec`)
- GoogleDataTransportCCTSupport/TestApp (from `../../GoogleDataTransportCCTSupport.podspec`)
- GoogleDataTransportCCTSupport (from `../../GoogleDataTransportCCTSupport.podspec`)
- GoogleDataTransportCCTSupport/TestApp (from `/Users/haneym/coding/firebase-ios-sdk/GoogleDataTransportCCTSupport.podspec`)

Steps to reproduce: (assuming cocoapods and cocoapods-generate is installed):

brew install protobuf nanopb-generator
easy_install --user protobuf
git clone [email protected]:firebase/firebase-ios-sdk.git
cd firebase-ios-sdk
GDT_DEV=1 pod gen GoogleDataTransportCCTSupport.podspec --auto-open --gen-directory=firebase-ios-sdk/gen --local-sources=firebase-ios-sdk --clean --verbose --platforms=ios,macos,tvos

mikehaney24 avatar Jun 02 '20 23:06 mikehaney24

Do you think this mightve been caused by https://github.com/square/cocoapods-generate/commit/ad65284b2ab0b35403dd24dd9460c9c6ff8ec7eb ?

segiddins avatar Jun 04 '20 17:06 segiddins

That definitely seems like a likely candidate, but I also have no idea.

mikehaney24 avatar Jun 04 '20 20:06 mikehaney24