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

Parent directory chunks in host workspace's project paths result in project duplicates after pod install #8481

Closed
1 task done
ogarkov-dev opened this issue Feb 2, 2019 · 3 comments · Fixed by CocoaPods/Xcodeproj#760
Labels
d1:easy An easy ticket that is a good start for first-time contributors s7:workaround available A workaround for the issue is available t2:defect These are known bugs. The issue should also contain steps to reproduce. PRs welcome!

Comments

@ogarkov-dev
Copy link

ogarkov-dev commented Feb 2, 2019

TL&DR: If the predefined workspace contains relative Projects' paths with parent directory chunks (i.e. /..) then pod install may reassemble the workspace with duplicated projects.

See also: #2413

Report

What did you do?

Run pod install

What did you expect to happen?

All dependencies installed. The old workspace structure preserved.

What happened instead?

Before pod install

Workspace contains subprojects: App, FirstLibrary, SecondLibrary, ThirdLibrary.

After pod install

Workspace contains subprojects: App, FirstLibrary, SecondLibrary, ThirdLibrary, Pods, FirstLibrary (duplicate).

CocoaPods Environment

(For example project)

Stack

   CocoaPods : 1.5.3
        Ruby : ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin17]
    RubyGems : 2.6.14
        Host : Mac OS X 10.14.3 (18D42)
       Xcode : 9.4.1 (9F2000)
         Git : git version 2.17.1
Ruby lib dir : /Users/antonogarkov/.rvm/rubies/ruby-2.4.1/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ 7cc24887f2051cbc6e30b7a0bd6bd94cbc923b3e
**other private repositories were removed for the output**

Installation Source

Executable Path: /Users/antonogarkov/.rvm/gems/ruby-2.4.1/bin/pod

Plugins

cocoapods-deintegrate : 1.0.2
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.0.0
cocoapods-trunk       : 1.3.0
cocoapods-try         : 1.1.0
slather               : 2.4.6

Podfile

platform :ios, '12.0'
use_frameworks!
workspace 'CocoapodsDuplicatedProjectDemo.xcworkspace'
project 'FirstLibrary/FirstLibrary.xcodeproj'

abstract_target 'FirstDependencies' do
  pod 'OAuthSwift', '1.2.2'
  pod 'SwiftReorder', '6.0.1'

  target 'FirstLibrary' do
    project 'FirstLibrary/FirstLibrary.xcodeproj'
  end

  target 'App' do
    project 'App/App.xcodeproj'
  end

end

Project that demonstrates the issue

CocoapodsDuplicatedProjectDemo.zip

Please see the structure of contents.xcworkspacedata in the project - FirstLibrary project reference is the following:
"group:OMGNotExistingDirectory/../FirstLibrary/FirstLibrary.xcodeproj"

@ogarkov-dev
Copy link
Author

Workaround is described here: #2413 (comment)

@dnkoutso
Copy link
Contributor

dnkoutso commented Feb 3, 2019

Thanks @Antoha !

@dnkoutso dnkoutso added t2:defect These are known bugs. The issue should also contain steps to reproduce. PRs welcome! d1:easy An easy ticket that is a good start for first-time contributors s7:workaround available A workaround for the issue is available labels Feb 3, 2019
@dnkoutso
Copy link
Contributor

Fixed by CocoaPods/Xcodeproj#760 will ship in next version of Xcodeproj gem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
d1:easy An easy ticket that is a good start for first-time contributors s7:workaround available A workaround for the issue is available t2:defect These are known bugs. The issue should also contain steps to reproduce. PRs welcome!
Projects
None yet
2 participants