jfrog / cocoapods-art

CocoaPods Plugin to work against Artifactory Repository
Apache License 2.0
58 stars 27 forks source link

Conflict between Artifactory backed repo & CocoaPods master/trunk repo #42

Open ashokds opened 4 years ago

ashokds commented 4 years ago

I'm using artifactory and cocoapods (via trunk) in some projects.

Using cocoapods-art-1.0.2.gem with cocoapods-1.9.1

Switching over to artifactory backed project A_Art, my system ends up in diffs in Podfile.lock. Or it results in "[!] Unable to find a specification for XYZ (= 1.10.2)".

Example of diff in Podfile.lock after pod install:

SPEC REPOS:
  https://company/artifactory/api/pods/cocoapods-remote:
    - Alamofire
    - AppsFlyerFramework
    - SwiftyDropbox
    - WootricSDK
+  https://github.com/CocoaPods/Specs.git:
    - AppAuth
    - Crashlytics
    - Fabric
    - Firebase
    - FirebaseABTesting
    - FirebaseAnalytics
    - FirebaseCore
    - FirebaseCoreDiagnostics
 ...

(similar to issue: #34) ^ Above, it conveniently pulled AppAuth, Crashlytics, etc from https://github.com/CocoaPods/Specs.git. It also results in diffs for the SPEC CHECKSUMS: section. How do I avoid such difs and have clean pod install?

I'm suspecting, somehow the pod install isn't using repos-art, and the plugin cocoapods-art has broken link?

Podfile structure:

platform :ios, '13.0'

plugin 'cocoapods-art', :sources => [
  'cocoapods-remote',
  'cocoapods-local'
]

target 'App-Name' do
   use frameworks!
 ....
 ....
 ....

Adding more details:

$ bundle exec pod install

/Users/dev/.cocoapods/repos-art/cocoapods-remote/.artpodrc
/Users/dev/.cocoapods/repos-art/cocoapods-local/.artpodrc
Analyzing dependencies
/Users/dev/.cocoapods/repos-art/cocoapods-remote/.artpodrc
/Users/dev/.cocoapods/repos-art/cocoapods-local/.artpodrc
[!] Unable to find a specification for `Fabric (= 1.10.2)`

You have either:
 * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
>>> `pod install --repo-update` and `pod repo-art update` done for all `repo-art`.
 * mistyped the name or version.
>>> Cross-checked the pod names. It works fine if pulling from `cocoapods master/CDN`. Also, the Spec exists on the path `/Users/dev/.cocoapods/repos-art/cocoapods-remote/`
 * not added the source repo that hosts the Podspec to your Podfile.
>>> The source repo exists. I think pod-install is failing to look into repos-art. Any way to fix it without doing entire `pod repo-art add cocoapods-remote "https://company/artifactory/api/pods/cocoapods-remote"`

My system had 4 repos: 2 in repo-art, and 2 in repo master & trunk

$ pod repo-art list

cocoapods-local
- URL: https://company/artifactory/api/pods/cocoapods-local
- Path: /Users/dev/.cocoapods/repos-art/cocoapods-local/

cocoapods-remote
- URL: https://company/artifactory/api/pods/cocoapods-remote
- Path: /Users/dev/.cocoapods/repos-art/cocoapods-remote/

2 repos
$ pod repo list

master
- Type: git (remotes/origin/master)
- URL:  https://github.com/CocoaPods/Specs.git
- Path: /Users/dev/.cocoapods/repos/master

trunk
- Type: CDN
- URL:  https://cdn.cocoapods.org/
- Path: /Users/dev/.cocoapods/repos/trunk

2 repo

I suspected some broken link, and the current project A_Art only depends on the artifactory, so I removed both master and trunk for now with pod repo remove master & pod repo remote trunk. At this point, my system has 2 repos: both in repo-art, and 0 in repo folder under /Users/dev/.cocoapods/repos

After that, pod install is failing to locate the specs. I hoped that it would pick up the specs from /Users/dev/.cocoapods/repos-art.

Tried --clean-install

bundle exec pod install --clean-install
/Users/dev/.cocoapods/repos-art/cocoapods-remote/.artpodrc
/Users/dev/.cocoapods/repos-art/cocoapods-local/.artpodrc
Analyzing dependencies
Cloning spec repo `company-artifactory-api-pods-cocoapods-remote` from `https://company/artifactory/api/pods/cocoapods-remote`
[!] Unable to add a source with url `https://company/artifactory/api/pods/cocoapods-remote` named `company-artifactory-api-pods-cocoapods-remote`.
You can try adding it manually in `/Users/dev/.cocoapods/repos` or via `pod repo add`.

^ Why is it refering to /Users/dev/.cocoapods/repos and not /Users/dev/.cocoapods/repos-art ?

Could be related: https://github.com/jfrog/cocoapods-art/issues/34