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

Not all fragments index files should be validated on each specified global CDN source #12338

Open
maikelvdh opened this issue Apr 8, 2024 · 0 comments

Comments

@maikelvdh
Copy link

Report

What did you do?

Specify two global CDN sources (one to trunk and one to private Artifactory repository local CDN repository) within Podfile, and while running pod install this fails on fragment file with Errno::ENOENT - No such file or directory @ rb_sysopen

What did you expect to happen?

Each global CDN source would get evaluated accordingly one by one based on the respective available fragment index files.

What happened instead?

CDN source is failing with error like: Errno::ENOENT - No such file or directory @ rb_sysopen on fragment index file which isn't present on global CDN source.

CocoaPods Environment

   CocoaPods : 1.14.3
   Ruby : ruby 2.7.5p203 (2021-11-24 revision f69aeb8314) [arm64-darwin22]
   RubyGems : 3.1.6
   Host : macOS 13.6.4 (22G513)
   Xcode : 15.0.1 (15A507)
   Git : git version 2.40.0
   
   cocoapods-deintegrate : 1.0.5
   cocoapods-plugins        : 1.0.0
   cocoapods-search         : 1.0.1
   cocoapods-trunk            : 1.6.0
   cocoapods-try                : 1.2.0

Project that demonstrates the issue

Following patch in cdn_source.rb in cocoapods core library is addressing the problem:

diff --git a/lib/cocoapods-core/cdn_source.rb b/lib/cocoapods-core/cdn_source.rb
index 9345a9fe..aa5f6814 100644
--- a/lib/cocoapods-core/cdn_source.rb
+++ b/lib/cocoapods-core/cdn_source.rb
@@ -282,14 +282,17 @@ module Pod
       # We use those because you can't get a directory listing from a CDN.
       index_file_name = index_file_name_for_fragment(fragment)
       download_file(index_file_name)
-      versions_raw = local_file(index_file_name, &:to_a).map(&:chomp)
-      @version_arrays_by_fragment_by_name[fragment] = versions_raw.reduce({}) do |hash, row|
-        row = row.split('/')
-        pod = row.shift
-        versions = row
-
-        hash[pod] = versions
-        hash
+      file_okay = local_file_okay?(partial_url)
+      if file_okay
+        versions_raw = local_file(index_file_name, &:to_a).map(&:chomp)
+        @version_arrays_by_fragment_by_name[fragment] = versions_raw.reduce({}) do |hash, row|
+          row = row.split('/')
+          pod = row.shift
+          versions = row
+
+          hash[pod] = versions
+          hash
+        end
       end
     end
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

No branches or pull requests

1 participant