Giter VIP home page Giter VIP logo

cocoapods-downloader's Introduction

Downloader

A small library for downloading files from remotes in a folder.

Build Status Gem Version Maintainability

Install

$ [sudo] gem install cocoapods-downloader

Usage

require 'cocoapods-downloader'

target_path = './Downloads/MyDownload'
options = { :git => 'example.com' }
options = Pod::Downloader.preprocess_options(options)
downloader = Pod::Downloader.for_target(target_path, options)
downloader.cache_root = '~/Library/Caches/APPNAME'
downloader.max_cache_size = 500
downloader.download
downloader.checkout_options #=> { :git => 'example.com', :commit => 'd7f410490dabf7a6bde665ba22da102c3acf1bd9' }

The downloader class supports the following option keys:

  • git: commit, tag, branch, submodules
  • svn: revision, tag, folder, externals
  • hg: revision, tag, branch
  • http: type, flatten
  • scp: type, flatten

The downloader also provides hooks which allow to customize its output or the way in which the commands are executed

require 'cocoapods-downloader'

module Pod
  module Downloader
    class Base

      override_api do
        def self.execute_command(executable, command, raise_on_failure = false)
          puts "Will download"
          super
        end

        def self.ui_action(ui_message)
          puts ui_message.green
          yield
        end
      end

    end
  end
end

Extraction

This gem was extracted from CocoaPods. Refer to also that repository for the history and the contributors.

Collaborate

All CocoaPods development happens on GitHub, there is a repository for CocoaPods and one for the CocoaPods specs. Contributing patches or Pods is really easy and gratifying and for a lot of people is their first time.

Follow @CocoaPods to get up to date information about what's going on in the CocoaPods world.

Development

You need to have svn, hg and git installed to run the specs. There are some specs which require hdiutil which will only run on macOS.

License

This gem and CocoaPods are available under the MIT license.

cocoapods-downloader's People

Contributors

akhomchenko avatar alisoftware avatar alloy avatar amorde avatar banjun avatar champo avatar chipp avatar dependabot[bot] avatar dlackty avatar dnkoutso avatar endocrimes avatar fabiopelosin avatar fmccann avatar gfontenot avatar kylef avatar lazerwalker avatar manicmaniac avatar marcc-orange avatar mbishop-fiksu avatar mrackwitz avatar neonichu avatar nevyn avatar orta avatar seanreinhardtapps avatar segiddins avatar sethfri avatar wilmarvh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cocoapods-downloader's Issues

Download file from a private S3 bucket

We have private pods which references to vendored_frameworks stored on a private Amazon S3 bucket. We do not want to make these files public, so we have to provide the necessary authentication information to Amazon.

Currently curl does not support Amazon authentication (.netrc seems to be insufficient for this) and they do not plan to add support for it. Amazon has an authentication tool for curl, which is a Perl wrapper around curl and cannot be applied to our scenario. We could also add the necessary information as url query parameters in the podspec, but it is not an option as well.

Based on the amazon docs, support requires to add a per-request Authorization header (it contains the request hash signed with the AWS secret).

What would be the best way to add support for this?

cache root is not working

require 'cocoapods-downloader'

target_path = './Downloads/MyDownload'
options = { :http => 'http://www.xxxx.com/webrtc/1.2.0/release/ios/webrtc.tar.bz2' }
options = Pod::Downloader.preprocess_options(options)
downloader = Pod::Downloader.for_target(target_path, options)
#downloader.cache_root = '~/Library/Caches/testRuby'
#downloader.max_cache_size = 500
downloader.download
#downloader.checkout_options #=> { :git => 'example.com', :commit => 'd7f410490dabf7a6bde665ba22da102c3acf1bd9' }

error is test.rb:7:in <main>': undefined method cache_root=' for #Pod::Downloader::Http:0x007ffe990e46c0 (NoMethodError)

[HTTP] Make it fail when a HTTP error status code is returned

E.g. this should fail

~/tmp » 
curl -O https://www.dropbox.com/developers/downloads/sdks/datastore/ios/dropbox-ios-sync-sdk-3.1.1.zip
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   613    0   613    0     0    362      0 --:--:--  0:00:01 --:--:--   362
~/tmp » unzip dropbox-ios-sync-sdk-3.1.1.zip 
Archive:  dropbox-ios-sync-sdk-3.1.1.zip
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of dropbox-ios-sync-sdk-3.1.1.zip or
        dropbox-ios-sync-sdk-3.1.1.zip.zip, and cannot find dropbox-ios-sync-sdk-3.1.1.zip.ZIP, period.
~/tmp » cat dropbox-ios-sync-sdk-3.1.1.zip 

<!DOCTYPE html>
<html>
<head><title>Dropbox - 404</title>
<link href="https://www.dropbox.com/static/css/error.css" rel="stylesheet" type="text/css">
<link rel="shortcut icon" href="/static/images/favicon.ico"/>
</head>
<body>
<div class="figure">
<img src="/static/images/psychobox.png" alt="Error:"/>
</div>
<div id="errorbox">
<h1>Error (404)</h1>We can't find the page you're looking for. Check out our <a href="https://www.dropbox.com/help">Help Center</a> and <a href="https://forums.dropbox.com">forums</a> for help, or head back to <a href="https://www.dropbox.com/home">home</a>.
</div>

</body>
</html>

`homepage` error in gemspec

In the cocoapods-downloader.gemspec:

  s.homepage = "https://github.com/CocoaPods/Downloader"

It seams that it is a error url. It should be

  s.homepage = "https://github.com/CocoaPods/cocoapods-downloader"

proxy support

Hi,

Is there any plan to add a proxy support? This way artifacts can be served from internal http proxies transparently.

Alternatively: if I make a PR adding such support, what are your thoughts on adding such functionality?

Cheers,

  • Daniel

Feature Request: Rename spec.source

Protocol types can be set in podspec's source, which is good.

But I have a dynamic library file about 150 MB.
I use tar.xz to compress this file, up to 35MB.
But the network in China is not very good, so I want to use https://dev.azure.com to provide the library file.
This seems to have CDN support, and downloads are very fast in China and the United States West.

The URL downloaded from the file on this site is like this:

https://dev.azure.com/cjlspy/45712d4b-2fcf-403d-92a0-3a6848a955d8/_apis/git/repositories/397233d0-159f-4f02-9d54-6fa854eb61d1/Items?path=%2FIJKMediaFramework.txz&versionDescriptor%5BversionOptions%5D=0&versionDescriptor%5BversionType%5D=1&versionDescriptor%5Bversion%5D=0.0.6&download=true&resolveLfs=true&%24format=octetStream&api-version=5.0-preview.1

log like this

-> FlutterIJK (0.0.7)
    - WARN  | description: The description is shorter than the summary.
    - ERROR | [iOS] unknown: Encountered an unknown error (Unsupported file type: 
/Library/Ruby/Gems/2.3.0/gems/cocoapods-downloader-1.2.2/lib/cocoapods-downloader/remote_file.rb:77:in `filename_with_type'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-downloader-1.2.2/lib/cocoapods-downloader/remote_file.rb:23:in `download!'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-downloader-1.2.2/lib/cocoapods-downloader/base.rb:82:in `block in download'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/lib/cocoapods/downloader.rb:157:in `block in ui_action'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/lib/cocoapods/downloader.rb:156:in `ui_action'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-downloader-1.2.2/lib/cocoapods-downloader/base.rb:80:in `download'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/lib/cocoapods/downloader.rb:108:in `download_source'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/lib/cocoapods/downloader.rb:75:in `download_request'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/lib/cocoapods/downloader/cache.rb:171:in `download'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/lib/cocoapods/downloader/cache.rb:154:in `block in uncached_pod'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/lib/cocoapods/downloader/cache.rb:181:in `in_tmpdir'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/lib/cocoapods/downloader/cache.rb:153:in `uncached_pod'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/lib/cocoapods/downloader/cache.rb:33:in `download_pod'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/lib/cocoapods/downloader.rb:42:in `download'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/lib/cocoapods/installer/pod_source_installer.rb:104:in `download_source'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/lib/cocoapods/installer/pod_source_installer.rb:62:in `install!'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/lib/cocoapods/installer.rb:426:in `install_source_of_pod'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/lib/cocoapods/installer.rb:377:in `block (2 levels) in install_pod_sources'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/lib/cocoapods/user_interface.rb:86:in `titled_section'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/lib/cocoapods/installer.rb:376:in `block in install_pod_sources'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/lib/cocoapods/installer.rb:359:in `each'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/lib/cocoapods/installer.rb:359:in `install_pod_sources'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/lib/cocoapods/installer.rb:189:in `block in download_dependencies'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/lib/cocoapods/installer.rb:188:in `download_dependencies'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/lib/cocoapods/validator.rb:520:in `block in download_pod'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/lib/cocoapods/validator.rb:520:in `each'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/lib/cocoapods/validator.rb:520:in `download_pod'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/lib/cocoapods/validator.rb:365:in `block in perform_extensive_analysis'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/lib/cocoapods/validator.rb:359:in `each'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/lib/cocoapods/validator.rb:359:in `perform_extensive_analysis'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/lib/cocoapods/validator.rb:128:in `validate'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/lib/cocoapods/command/spec/lint.rb:77:in `block in run'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/lib/cocoapods/command/spec/lint.rb:63:in `each'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/lib/cocoapods/command/spec/lint.rb:63:in `run'
/Library/Ruby/Gems/2.3.0/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:22:in `load'
/usr/local/bin/pod:22:in `<main>'
) during validation.

Analyzed 1 podspec.

[!] The spec did not pass validation, due to 1 error and 1 warning.

/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/lib/cocoapods/command/spec/lint.rb:94:in `run'
/Library/Ruby/Gems/2.3.0/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.1/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:22:in `load'
/usr/local/bin/pod:22:in `<main>'
Pod::Spec.new do |spec|

  spec.name         = "FlutterIJK"
  spec.version      = "0.0.7"
  spec.summary      = "IJKPlayer for Flutter."
  spec.description  = <<-DESC
  IJKPlayer for flutter
                   DESC
  
  spec.homepage     = "https://github.com/CaiJingLong/flutter_ijkplayer_pod"
  spec.license      = { :type => 'MIT', :file => 'LICENSE' }
  spec.author             = { "Caijinglong" => "[email protected]" }
  # spec.source       = { :http => "https://github.com/CaiJingLong/flutter_ijkplayer_pod/releases/download/0.0.6/IJKMediaFramework.txz"}
  spec.source       = { :http => "https://dev.azure.com/cjlspy/45712d4b-2fcf-403d-92a0-3a6848a955d8/_apis/git/repositories/397233d0-159f-4f02-9d54-6fa854eb61d1/Items?versionDescriptor%5BversionOptions%5D=0&versionDescriptor%5BversionType%5D=1&versionDescriptor%5Bversion%5D=0.0.6&download=true&resolveLfs=true&%24format=octetStream&api-version=5.0-preview.1&path=%2FIJKMediaFramework.txz"}
  spec.vendored_frameworks = 'IJKMediaFramework.framework'
  spec.frameworks  = "AudioToolbox", "AVFoundation", "CoreGraphics", "CoreMedia", "CoreVideo", "MobileCoreServices", "OpenGLES", "QuartzCore", "VideoToolbox", "Foundation", "UIKit", "MediaPlayer"
  spec.libraries   = "bz2", "z", "stdc++"

  spec.platform = :ios
  spec.ios.deployment_target = '8.0'
  spec.requires_arc = true

end

So can you provide spec.source with an attribute in the future so that it can be read when curl downloads to specify the file name?

Such as:

spec.source = {:http => "https://example.com/abc?name=lib.txz&path=master", :rename=>"lib.txz" }

Are remote shares supported?

Is there a way to access remote shares through cocoapods? I know it works when I mount share through samba to Volumes - it's treated as normal :path that time. But I still want to be able to have it done from end-2-end using cocoapods.

prune_cache is pruning folder that doesn't exist.

I'm downloading with these options { :git => "https://github.com/0xced/ABGetMe.git", :tag => "1.0.0" } and the gem is correctly cloning but at the end its trying to access a folder that doesn't exist.

Screen Shot 2013-03-02 at 14 27 35

spec = eval( File.open(podfile_file_path).read )
download_location = current_dir + "/download/#{spec.name}/#{spec.version}"

unless File.exists? download_location
  downloader = Pod::Downloader.for_target(download_location, spec.source)
  downloader.cache_root = ''
  downloader.max_cache_size = 500
  downloader.download  
end
Updating cache git repo (/Volumes/Cache/orta/spiel/html/cocoadocs-host/GitHub/40a05edf506a6dcfcce5f1353a001b55f4467cd9)
Fetching origin
Initialized empty Git repository in /Volumes/Cache/orta/spiel/html/cocoadocs-host/download/ABGetMe/1.0.0/.git/

From /Volumes/Cache/orta/spiel/html/cocoadocs-host/GitHub/40a05edf506a6dcfcce5f1353a001b55f4467cd9
 * tag               1.0.0      -> FETCH_HEAD
HEAD is now at 8d8d7ca Add MIT license file
Switched to a new branch 'activated-pod-commit'
/Volumes/Cache/orta/.rvm/rubies/ruby-1.9.3-p385/lib/ruby/1.9.1/pathname.rb:397:in `open': No such file or directory - /Volumes/Cache/orta/spiel/html/cocoadocs-host/GitHub/GitHub (Errno::ENOENT)
    from /Volumes/Cache/orta/.rvm/rubies/ruby-1.9.3-p385/lib/ruby/1.9.1/pathname.rb:397:in `foreach'
    from /Volumes/Cache/orta/.rvm/rubies/ruby-1.9.3-p385/lib/ruby/1.9.1/pathname.rb:397:in `children'
    from /Volumes/Cache/orta/.rvm/gems/ruby-1.9.3-p385/gems/cocoapods-downloader-0.1.0/lib/cocoapods-downloader/base.rb:185:in `block in prune_cache'
    from /Volumes/Cache/orta/.rvm/gems/ruby-1.9.3-p385/gems/cocoapods-downloader-0.1.0/lib/cocoapods-downloader/base.rb:184:in `chdir'
    from /Volumes/Cache/orta/.rvm/gems/ruby-1.9.3-p385/gems/cocoapods-downloader-0.1.0/lib/cocoapods-downloader/base.rb:184:in `prune_cache'
    from /Volumes/Cache/orta/.rvm/gems/ruby-1.9.3-p385/gems/cocoapods-downloader-0.1.0/lib/cocoapods-downloader/base.rb:102:in `block in download'
    from /Volumes/Cache/orta/.rvm/gems/ruby-1.9.3-p385/gems/cocoapods-downloader-0.1.0/lib/cocoapods-downloader/api.rb:43:in `ui_action'
    from /Volumes/Cache/orta/.rvm/gems/ruby-1.9.3-p385/gems/cocoapods-downloader-0.1.0/lib/cocoapods-downloader/base.rb:99:in `download'
    from Rakefile:26:in `<main>'

cocoapods-downloader does not support http downloads where url contains get params

  1. Create a podspec where s.source contains a url with get params. For example:s.source = { :http => 'http://example.com/1/2?x=1&artifact=file.zip' }
  2. Run pod install

Result: source fails to download

Installing MyPod (1.0.0)
[!] Pod::Executable -L -o /Users/user/MyPod/file.zip http://example.com/1/2?x=1&artifact=file.zip --create-dirs

sh: --create-dirs: command not found

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

                                 Dload  Upload   Total   Spent    Left  Speed

100   708    0   708    0     0   5149      0 --:--:-- --:--:-- --:--:--  5167

Note: This could be fixed by quoting the url passed to curl:
https://github.com/CocoaPods/cocoapods-downloader/blob/master/lib/cocoapods-downloader/http.rb#L87

  def download_file(full_filename)
    curl! %|-L -o #{full_filename.shellescape} "#{url}" --create-dirs|
  end

Stop use of intermediate shell and sandbox commands.

(iirc, the reason we use an intermediate shell has to do with Ruby 1.8 and 1.9/2.x differences)

When we drop Ruby 1.8.7 support, we should:

  • Make the download commands use arrays of commands instead of string commands, this way we can spawn subprocesses without the need for a shell. This ensures we’ll no longer have the chance for breakage related to spaces in paths and/or other characters that might need to be spaced before using in a shell.
  • Use OS X sandboxing to limit access of the invoked command to just network access and write access to the destination dir. This ensures that a command (coming from a podspec's source attribute) can no longer inject malicious commands that invokes commands other than the download command in question (e.g. git) and cannot make FS changes outside of the destination dir where it is expected to make changes.

Faulty extraction in remote_file.rb if compressed file contains only .framework

I'm trying to download via http a pod that is uploaded as a tarball with only a .framework as its contents. Right now, because the .framework is a technically just a directory, the cocoapods downloader will move the contents of the .framework without consideration of the structure. Specifically, I'm looking at lines 106-122 in remote_file.rb.

# If the archive is a tarball and it only contained a folder, move its
# contents to the target (#727)
#
if should_flatten?
  contents = target_path.children
  contents.delete(target_path + @filename)
  entry = contents.first
  if contents.count == 1 && entry.directory?
    tmp_entry = entry.sub_ext("#{entry.extname}.tmp")
    begin
      FileUtils.move(entry, tmp_entry)
      FileUtils.move(tmp_entry.children, target_path)
    ensure
      FileUtils.remove_entry(tmp_entry)
    end
  end
end

If the conditional is changed to if contents.count == 1 && entry.directory? && File.extname(entry) != '.framework', I am able to successfully pod install. Without it, the named pod folder in the pods directory of the project is empty.

$CHILD_STATUS is nil in some Ruby versions without require "English"

See CocoaPods/CocoaPods#2225

This causes ref_exists? to always return false.

I don't know why it doesn't cause other issues elsewhere, but the nicely named $CHILD_STATUS global var in ruby 1.9 and later (or something, not exactly sure of the circumstances). It's fixed if you replace $CHILD_STATUS with the timeless $? or place require "English" at the top of git.rb (although that may introduce a new ruby version dependency, I'm not familiar with when it was introduced).

Usage example not working: undefined method 'cache_root'

cocoapods-downloader 1.1.3
cocoapods 1.2.1
ruby 2.2.1p85

I created a new ruby file with the usage example from the README:

require 'cocoapods-downloader'

target_path = './Downloads/MyDownload'
options = { :git => 'example.com' }
options = Pod::Downloader.preprocess_options(options)
downloader = Pod::Downloader.for_target(target_path, options)
downloader.cache_root = '~/Library/Caches/APPNAME'
downloader.max_cache_size = 500
downloader.download
downloader.checkout_options #=> { :git => 'example.com', :commit => 'd7f410490dabf7a6bde665ba22da102c3acf1bd9' }

When I execute the file, i get the error:

download.rb:7:in `<main>': undefined method `cache_root=' for #<Pod::Downloader::Git:0x007fd8c41fadc0> (NoMethodError)

Adopt a different namespace

The Downloader class is currently namespaced under the Pod module. I would prefer to change this so in CocoaPods a simple class Pod::Downloader which takes care of configuring the cache in a central location can be created. Also I would be tempted to reserve the Pod module for only the CocoaPod gems (proper & core).

@alloy Your feedback also on this one would be great.

Error downloading pod using nexus proxy with cdn remote

Feature Request: sonatype nexus cocoapods repo is sometimes not providing file type when downloading, maybe cocoapods can figure it out if from the :http request?
some info

  • Using self signed cocoapods cache proxy with nexus.
  • docker image used: docker pull bradbeck/nexus-https
    https://github.com/bradbeck/nexus-https
  • cocoapods version 1.7.2 - latest version doesn't work at all with self signed repos
  • most pods are installing ok and succeed, AppLovinSDK doesn't, maybe downloader can't figure file type?
  • echo "--insecure" >> ~/.curlrc

✔  pod install --verbose
Preparing

Analyzing dependencies

Inspecting targets to integrate
Using ARCHS setting to build architectures of target Pods-podtest: (``)

Resolving dependencies of Podfile
CDN: 200-repository-cocoapods-cache Relative path: CocoaPods-version.yml exists! Returning local because checking is only perfomed in repo update
CDN: cocoapods- Relative path: CocoaPods-version.yml exists! Returning local because checking is only perfomed in repo update
CDN: 200-repository-cocoapods-cache Relative path: all_pods_versions_9_c_c.txt exists! Returning local because checking is only perfomed in repo update
CDN: 200-repository-cocoapods-cache Relative path: Specs/9/c/c/AppLovinSDK/6.12.8/AppLovinSDK.podspec.json exists! Returning local because checking is only perfomed in
repo update
CDN: 200-repository-cocoapods-cache Relative path: Specs/9/c/c/AppLovinSDK/6.12.4/AppLovinSDK.podspec.json exists! Returning local because checking is only perfomed in
repo update

Comparing resolved specification to the sandbox manifest
A AppLovinSDK

Downloading dependencies

-> Installing AppLovinSDK (6.12.4)
my comment - download target: /var/folders/43/cnq_n_r130l9cmgh27r8kyvw0000gp/T/d20200602-18863-sig1kl
my comment - download params: {:http=>"https://192.168.200.39:8443/repository/cocoapods-cache/pods/AppLovinSDK/6.12.4/https/bintray.com/applovin/iOS/download_file?file_path=applovin-ios-sdk-6.12.4.zip"}

Http download
my comment type is:

[!] Error installing AppLovinSDK

Command

/Users/guym/.rvm/gems/ruby-2.4.0/bin/pod install --verbose

Report

  • What did you do? pod install

  • What did you expect to happen? pods installed

  • What happened instead? command failed to download the pod

Stack

   CocoaPods : 1.7.2
        Ruby : ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-darwin18]
    RubyGems : 2.7.9
        Host : Mac OS X 10.15.1 (19B88)
       Xcode : 11.3 (11C29)
         Git : git version 2.25.0
Ruby lib dir : /Users/guym/.rvm/rubies/ruby-2.4.0/lib
Repositories :
               amazonaws-v1-repos-cocoapods - https://git-codecommit.us-east-1.amazonaws.com/v1/repos/CocoaPods @ 26f1dcf0c42a348c7ffa5c9ebc6a267a1f098a09

               vungle - https://github.com/Vungle/ios-sdk-beta.git @ b9d4955a563e402a8bf73b51f334605c99594152

Plugins

cocoapods-deintegrate : 1.0.4
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.1.0
cocoapods-trunk       : 1.5.0
cocoapods-try         : 1.2.0

Podfile

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

source 'https://192.168.200.39:8443/repository/cocoapods-cache/'

target 'podtest' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for podtest
  pod 'AppLovinSDK', '6.12.4'
end

Error

Pod::Downloader::RemoteFile::UnsupportedFileTypeError - Unsupported file type:
/Users/guym/.rvm/gems/ruby-2.4.0/gems/cocoapods-downloader-1.3.0/lib/cocoapods-downloader/remote_file.rb:83:in `filename_with_type'
/Users/guym/.rvm/gems/ruby-2.4.0/gems/cocoapods-downloader-1.3.0/lib/cocoapods-downloader/remote_file.rb:24:in `download!'
/Users/guym/.rvm/gems/ruby-2.4.0/gems/cocoapods-downloader-1.3.0/lib/cocoapods-downloader/base.rb:82:in `block in download'
/Users/guym/.rvm/gems/ruby-2.4.0/gems/cocoapods-1.7.2/lib/cocoapods/downloader.rb:159:in `block in ui_action'
/Users/guym/.rvm/gems/ruby-2.4.0/gems/cocoapods-1.7.2/lib/cocoapods/user_interface.rb:64:in `section'
/Users/guym/.rvm/gems/ruby-2.4.0/gems/cocoapods-1.7.2/lib/cocoapods/downloader.rb:158:in `ui_action'
/Users/guym/.rvm/gems/ruby-2.4.0/gems/cocoapods-downloader-1.3.0/lib/cocoapods-downloader/base.rb:80:in `download'
/Users/guym/.rvm/gems/ruby-2.4.0/gems/cocoapods-1.7.2/lib/cocoapods/downloader.rb:110:in `download_source'
/Users/guym/.rvm/gems/ruby-2.4.0/gems/cocoapods-1.7.2/lib/cocoapods/downloader.rb:75:in `download_request'
/Users/guym/.rvm/gems/ruby-2.4.0/gems/cocoapods-1.7.2/lib/cocoapods/downloader/cache.rb:171:in `download'
/Users/guym/.rvm/gems/ruby-2.4.0/gems/cocoapods-1.7.2/lib/cocoapods/downloader/cache.rb:154:in `block in uncached_pod'
/Users/guym/.rvm/gems/ruby-2.4.0/gems/cocoapods-1.7.2/lib/cocoapods/downloader/cache.rb:181:in `in_tmpdir'
/Users/guym/.rvm/gems/ruby-2.4.0/gems/cocoapods-1.7.2/lib/cocoapods/downloader/cache.rb:153:in `uncached_pod'
/Users/guym/.rvm/gems/ruby-2.4.0/gems/cocoapods-1.7.2/lib/cocoapods/downloader/cache.rb:33:in `download_pod'
/Users/guym/.rvm/gems/ruby-2.4.0/gems/cocoapods-1.7.2/lib/cocoapods/downloader.rb:42:in `download'
/Users/guym/.rvm/gems/ruby-2.4.0/gems/cocoapods-1.7.2/lib/cocoapods/installer/pod_source_installer.rb:109:in `download_source'
/Users/guym/.rvm/gems/ruby-2.4.0/gems/cocoapods-1.7.2/lib/cocoapods/installer/pod_source_installer.rb:62:in `install!'
/Users/guym/.rvm/gems/ruby-2.4.0/gems/cocoapods-1.7.2/lib/cocoapods/installer.rb:545:in `install_source_of_pod'
/Users/guym/.rvm/gems/ruby-2.4.0/gems/cocoapods-1.7.2/lib/cocoapods/installer.rb:496:in `block (2 levels) in install_pod_sources'
/Users/guym/.rvm/gems/ruby-2.4.0/gems/cocoapods-1.7.2/lib/cocoapods/user_interface.rb:86:in `titled_section'
/Users/guym/.rvm/gems/ruby-2.4.0/gems/cocoapods-1.7.2/lib/cocoapods/installer.rb:495:in `block in install_pod_sources'
/Users/guym/.rvm/gems/ruby-2.4.0/gems/cocoapods-1.7.2/lib/cocoapods/installer.rb:478:in `each'
/Users/guym/.rvm/gems/ruby-2.4.0/gems/cocoapods-1.7.2/lib/cocoapods/installer.rb:478:in `install_pod_sources'
/Users/guym/.rvm/gems/ruby-2.4.0/gems/cocoapods-1.7.2/lib/cocoapods/installer.rb:235:in `block in download_dependencies'
/Users/guym/.rvm/gems/ruby-2.4.0/gems/cocoapods-1.7.2/lib/cocoapods/user_interface.rb:64:in `section'
/Users/guym/.rvm/gems/ruby-2.4.0/gems/cocoapods-1.7.2/lib/cocoapods/installer.rb:234:in `download_dependencies'
/Users/guym/.rvm/gems/ruby-2.4.0/gems/cocoapods-1.7.2/lib/cocoapods/installer.rb:157:in `install!'
/Users/guym/.rvm/gems/ruby-2.4.0/gems/cocoapods-1.7.2/lib/cocoapods/command/install.rb:51:in `run'
/Users/guym/.rvm/gems/ruby-2.4.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
/Users/guym/.rvm/gems/ruby-2.4.0/gems/cocoapods-1.7.2/lib/cocoapods/command.rb:52:in `run'
/Users/guym/.rvm/gems/ruby-2.4.0/gems/cocoapods-1.7.2/bin/pod:55:in `<top (required)>'
/Users/guym/.rvm/gems/ruby-2.4.0/bin/pod:23:in `load'
/Users/guym/.rvm/gems/ruby-2.4.0/bin/pod:23:in `<main>'
/Users/guym/.rvm/gems/ruby-2.4.0/bin/ruby_executable_hooks:24:in `eval'
/Users/guym/.rvm/gems/ruby-2.4.0/bin/ruby_executable_hooks:24:in `<main>'

HTTPS downloads can fail on 10.8

As of yesterday (may have coincided with pods 0.32 / downloader 0.5, but the code changes don't seem responsible) pods can no longer download content hosted at https://raw.githubusercontent.com, as it fails with a curl SSL error, on 10.8. Mavericks works fine, likely because it uses a newer curl or because that curl doesn't use OpenSSL. The curl error is error:14077458:SSL routines:SSL23_GET_SERVER_HELLO:reason(1112), which is also produced when trying to download using curl manually. Adding -ssl3 to the curl command lets it work.

Best option may just be for the downloader add -ssl3 to its curl invocation. Should work everywhere, as hopefully no site is locked to older SSL versions.

Ignore curlrc config file

CocoaPods currently uses curl's default config file, which causes it to fail when providing options that conflict with the contents of that file.

This is easily solved by adding the --disable flag when invoking curl. I will submit a pull request that does this momentarily.

Pod::Downloader::Http::UnsupportedFileTypeError - Unsupported file type: tgz

$ pod install
Analyzing dependencies
Downloading dependencies
Using AAPullToRefresh (1.0.2)
Using AFNetworking (1.3.4)
Using AFOAuth1Client (0.2.2)
Using APPhotolibrary (0.0.2)
Using Appirater (2.0.2)
Using AviarySDK (3.3.11)
Installing Calabash (0.9.168)

[!] Error installing Calabash

Report

  • What did you do?
    Ran 'pod install' with calabash as a dependency
  • What did you expect to happen?
    Expected the pods to install
  • What happened instead?
    An error

Stack

   CocoaPods : 0.33.0
        Ruby : ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin12.0]
    RubyGems : 2.2.2
        Host : Mac OS X 10.9.2 (13C64)
       Xcode : 5.1.1 (5B1008)
Ruby lib dir : /Users/admin/.rvm/rubies/ruby-2.1.1/lib
Repositories : [redacted]

Podfile

platform :ios, '6.1'
pod 'Keel', :head
pod 'Classy', '~> 0.2.4'
pod 'AAPullToRefresh', '~> 1.0.2'
pod 'NYXImagesKit', '~> 2.3'
pod 'UIImage-Categories', '~> 0.0.1'
pod 'TCControls', '~> 0.1'
pod 'FXBlurView', '~> 1.5.1'
pod 'Querygular', :head
pod 'APPhotolibrary', '~> 0.0.1'
pod 'Slash', '~> 0.1.1'
pod 'TCParallaxView', '~> 0.2'
pod 'EZForm', '~> 1.1.4'
pod 'Reefer', '~> 0.1'
pod 'Formular', :head
pod 'ClassyUtilities', :head
pod 'Catapult', :head
pod 'Facebook-iOS-SDK', '~> 3.12.0'
pod 'ReFashAssets', :head
pod 'UIDevice+BlurEnabled', '~> 0.1'
pod 'FormatterKit', '~> 1.4.0'
pod 'STPTransitions', '= 0.0.2tc'
pod 'Masonry', '~> 0.4.0'
pod 'SKBounceAnimation', '~> 1.0.04'
pod 'RDRStickyKeyboardView', '~> 0.0.2tc'
pod 'ClassyLiveLayout', '~> 0.4'
pod 'Snapshot', :head
pod 'AviarySDK', '~> 3.3'
pod 'ScrollViewListener', '~> 0.1'
pod 'Appirater', '~> 2.0'
pod 'UIActionSheet+Blocks', '~> 0.8'
pod 'JSBadgeView', '~> 1.3'
pod 'JDStatusBarNotification', '~> 1.4.8tc'
pod 'EXPhotoViewer', '~> 1.0.1tc'
pod 'MBProgressHUD', '~> 0.8'
pod 'CrashlyticsFramework', '~> 2.1.7'
pod 'FRActionSheet', '~> 0.0.1'
pod 'NSTimer-Blocks', '~> 0.0'
target 'Refash-cal', :exclusive => false do
  pod 'Calabash', '>= 0.9.168'
end

Error

Pod::Downloader::Http::UnsupportedFileTypeError - Unsupported file type: tgz
/Users/admin/.rvm/gems/ruby-2.1.1@global/gems/cocoapods-downloader-0.6.0/lib/cocoapods-downloader/http.rb:82:in `filename_with_type'
/Users/admin/.rvm/gems/ruby-2.1.1@global/gems/cocoapods-downloader-0.6.0/lib/cocoapods-downloader/http.rb:21:in `download!'
/Users/admin/.rvm/gems/ruby-2.1.1@global/gems/cocoapods-downloader-0.6.0/lib/cocoapods-downloader/base.rb:109:in `block in download'
/Users/admin/.rvm/gems/ruby-2.1.1@global/gems/cocoapods-0.33.0/lib/cocoapods/downloader.rb:25:in `block in ui_action'
/Users/admin/.rvm/gems/ruby-2.1.1@global/gems/cocoapods-0.33.0/lib/cocoapods/user_interface.rb:52:in `section'
/Users/admin/.rvm/gems/ruby-2.1.1@global/gems/cocoapods-0.33.0/lib/cocoapods/downloader.rb:24:in `ui_action'
/Users/admin/.rvm/gems/ruby-2.1.1@global/gems/cocoapods-downloader-0.6.0/lib/cocoapods-downloader/base.rb:107:in `download'
/Users/admin/.rvm/gems/ruby-2.1.1@global/gems/cocoapods-0.33.0/lib/cocoapods/installer/pod_source_installer.rb:117:in `download_source'
/Users/admin/.rvm/gems/ruby-2.1.1@global/gems/cocoapods-0.33.0/lib/cocoapods/installer/pod_source_installer.rb:64:in `install!'
/Users/admin/.rvm/gems/ruby-2.1.1@global/gems/cocoapods-0.33.0/lib/cocoapods/installer.rb:274:in `install_source_of_pod'
/Users/admin/.rvm/gems/ruby-2.1.1@global/gems/cocoapods-0.33.0/lib/cocoapods/installer.rb:248:in `block (2 levels) in install_pod_sources'
/Users/admin/.rvm/gems/ruby-2.1.1@global/gems/cocoapods-0.33.0/lib/cocoapods/user_interface.rb:73:in `titled_section'
/Users/admin/.rvm/gems/ruby-2.1.1@global/gems/cocoapods-0.33.0/lib/cocoapods/installer.rb:247:in `block in install_pod_sources'
/Users/admin/.rvm/gems/ruby-2.1.1@global/gems/cocoapods-0.33.0/lib/cocoapods/installer.rb:239:in `each'
/Users/admin/.rvm/gems/ruby-2.1.1@global/gems/cocoapods-0.33.0/lib/cocoapods/installer.rb:239:in `install_pod_sources'
/Users/admin/.rvm/gems/ruby-2.1.1@global/gems/cocoapods-0.33.0/lib/cocoapods/installer.rb:107:in `block in download_dependencies'
/Users/admin/.rvm/gems/ruby-2.1.1@global/gems/cocoapods-0.33.0/lib/cocoapods/user_interface.rb:52:in `section'
/Users/admin/.rvm/gems/ruby-2.1.1@global/gems/cocoapods-0.33.0/lib/cocoapods/installer.rb:105:in `download_dependencies'
/Users/admin/.rvm/gems/ruby-2.1.1@global/gems/cocoapods-0.33.0/lib/cocoapods/installer.rb:90:in `install!'
/Users/admin/.rvm/gems/ruby-2.1.1@global/gems/cocoapods-0.33.0/lib/cocoapods/command/project.rb:40:in `run_install_with_update'
/Users/admin/.rvm/gems/ruby-2.1.1@global/gems/cocoapods-0.33.0/lib/cocoapods/command/project.rb:70:in `run'
/Users/admin/.rvm/gems/ruby-2.1.1@global/gems/claide-0.6.1/lib/claide/command.rb:281:in `run'
/Users/admin/.rvm/gems/ruby-2.1.1@global/gems/cocoapods-0.33.0/lib/cocoapods/command.rb:48:in `run'
/Users/admin/.rvm/gems/ruby-2.1.1@global/gems/cocoapods-0.33.0/bin/pod:33:in `<top (required)>'
/Users/admin/.rvm/rubies/ruby-2.1.1/bin/pod:23:in `load'
/Users/admin/.rvm/rubies/ruby-2.1.1/bin/pod:23:in `<main>'
/Users/admin/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval'
/Users/admin/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `<main>'

cocoapods checkout wrong branch if pod's branch name is separated by slashes

Assume that pod A only has a branch named release/0.1.0.

...
pod 'A', git: 'xxx', branch: '0.1.0'
...

Install project with the Podfile above, and it will checkout release/0.1.0 branch.

def self.preprocess_options(options)
  return options unless options[:branch]

  command = ['ls-remote',
             options[:git],
             options[:branch]]
  output = Git.execute_command('git', command)  # will return release/0.1.0 branch
  match = /^([a-z0-9]*)\t.*/.match(output)

  return options if match.nil?

  options[:commit] = match[1]
  options.delete(:branch)

  options
end

I think /^([a-z0-9]*)\t.*/ is not strict for the case.

cURL version issue

Hi guys!

The cocoapods-downloader 1.4 introduced this feature: CocoaPods/CocoaPods#9619

macOS Catalina 10.15.6 is using the curl 7.64.1 by default and with the latest cocoapods-downloader-1.4.0 there is an issue.
this cURL version is not able to handle this command:

curl -f -L -o /var/folders/file.zip https://example.zip --create-dirs --netrc-optional --retry 2 -A 'CocoaPods/1.9.3 cocoapods-downloader/1.4.0'
output: curl: (6) Could not resolve host: cocoapods-downloader

somehow the latest 1.4 version is adding the -A 'CocoaPods/1.9.3 cocoapods-downloader/1.4.0' to the end of the command and the curl 7.64.1 is not able to handle this.

with curl 7.71.1 working perfectly but by default the macOS 10.15.6 is not using this version.

Do you plan to fix this issue in the next version?

Git shallow cloning is not used when branch is set

Report

What did you do?

bundle exec pod --verbose install

What did you expect to happen?

For Git dependencies, use --depth 1 when cloning.

What happened instead?

--depth 1 is not used:

% bundle exec pod --verbose install
  Preparing

Analyzing dependencies

Inspecting targets to integrate
  Using `ARCHS` setting to build architectures of target `Pods-Example`: (``)

Fetching external sources
-> Pre-downloading: `YPImagePicker` from `https://github.com/Yummypets/YPImagePicker.git`, branch `bypass-compression`
  $ /opt/local/bin/git ls-remote https://github.com/Yummypets/YPImagePicker.git bypass-compression
  9fd06737d0ed9039ede045a85526d92477a8c562	refs/heads/bypass-compression
 > Git download
 > Git download
     $ /opt/local/bin/git clone https://github.com/Yummypets/YPImagePicker.git
     /var/folders/9v/8vsfgn095n58ypf76vmt6kjr0000gn/T/d20200814-84273-1nidkbq --template=
     Cloning into '/var/folders/9v/8vsfgn095n58ypf76vmt6kjr0000gn/T/d20200814-84273-1nidkbq'...

CocoaPods Environment

Stack

   CocoaPods : 1.10.0.beta.2
        Ruby : ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]
    RubyGems : 3.0.3
        Host : Mac OS X 10.15.6 (19G73)
       Xcode : 11.6 (11E708)
         Git : git version 2.28.0
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib
Repositories : trunk - CDN - https://cdn.cocoapods.org/

Installation Source

Executable Path: /Users/user/Downloads/some-b/.bundle/ruby/2.6.0/bin/pod

Plugins

cocoapods-deintegrate : 1.0.4
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-trunk       : 1.5.0
cocoapods-try         : 1.2.0

Podfile

platform :ios, '11.0'

target 'Example' do
  use_frameworks!

  pod 'YPImagePicker', :git => 'https://github.com/Yummypets/YPImagePicker.git', :branch => 'bypass-compression'
end

Slow `pod install` after upgrading to 0.34.4

After upgrading CocoaPods to 0.34.4 recently, we began to suffer from very slow pod install time. After doing some investigation, we realized that this issue is related to the deprecation of git cache.

cocoapods-downloader 0.70 uses git shallow clone and stop using caches, this speeds up first time clone of most pods. But for pod specifying commit, shallow clone doesn't work, and we have a git repo which is 200+ MB large. Before 0.70, we had caches to avoid long clone time, now the cache is gone.

Any idea on this? Probably get cache back for full clone repos? Is it possibly for cache to work with shallow clones?

Change interface

Change the interface to receive a single parameter and to output a single one:

require 'cocoapods-downloader'

input = Downloader::Configuration.new
input.target_path = './Downloads/MyDownload'
input.options = { :git => 'example.com' }
input.cache_root = '~/Library/Caches/APPNAME'
input.max_cache_size = 500

downloader = Pod::Downloader.for_target(input)
output = downloader.download
output.checkout_options #=> { :git => 'example.com', :commit => 'd7f410490dabf7a6bde665ba22da102c3acf1bd9' }

Considerations:

  • The implicit contract with clients is clearer and favours the replacement of the class via Dependency injection in clients (CocoaPods).
  • The checkout options should be always returned if applicable (this is internal logic of the downloader) in any case the operation is very fast and should not have an impact on performance.

@alloy I would love to hear your take when you have a minute.

[Downloader::Http::UnsupportedFileTypeError] Failed to download the source file with the http parameterized uri

source uri in podspec

http://our_sonatype_nexus_repo/path/redirect?r=#{repository}&g=#{groupId}&a=#{artifactId}&v=#{version}&c=#{classfier}&e=#{extension}

Report

  • What did you do?
    After pod version update, pod install/update didn't working

from : 0.34.1
to : 0.35.0

  • What did you expect to happen?
    pod install or update should be success.
  • What happened instead?
    Following error occurred.

Stack

   CocoaPods : 0.35.0
        Ruby : ruby 2.0.0p451 (2014-02-24 revision 45167) [universal.x86_64-darwin13]
    RubyGems : 2.0.14
        Host : Mac OS X 10.9.4 (13E28)
       Xcode : 6.0 (6A313)
         Git : git version 1.9.3 (Apple Git-50)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib
Repositories : daumkakao-privatepods - [email protected]:benedict-lee/PrivatePods.git @ e7f7f1e6085a2c0348644b227930a88a9759bd95
               master - https://github.com/CocoaPods/Specs.git @ 30027a3f7f7d82660859d032171aad331266348a

Plugins

cocoapods-plugins : 0.3.2
cocoapods-trunk   : 0.2.0
cocoapods-try     : 0.4.2

Podfile

platform :ios, '6.0'
pod 'MobileLibraryIphone', '2.0.0'
pod 'MobileTiaraLibraryIphone', '2.0.1'
pod 'MobileLoginLibraryIphone', '2.2.3'
pod 'MobileReportLibraryIphone', '1.4.0'
pod 'MobileUploaderLibraryIphone', '1.3.0'
target 'iCafe-cal', :exclusive => false do
  pod 'Calabash', '0.9.168'
end

post_install do |r|
  r.project.targets.each do |target|
    target.frameworks_build_phase.files.each do |f|
      target.build_configuration_list.set_setting('VALID_ARCHS', 'armv7s armv7 i386 arm64')
      target.build_configuration_list.set_setting('ONLY_ACTIVE_ARCH', 'NO')
    end
  end
end

Error

Pod::Downloader::Http::UnsupportedFileTypeError - Unsupported file type:
/Library/Ruby/Gems/2.0.0/gems/cocoapods-downloader-0.8.1/lib/cocoapods-downloader/http.rb:83:in `filename_with_type'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-downloader-0.8.1/lib/cocoapods-downloader/http.rb:21:in `download!'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-downloader-0.8.1/lib/cocoapods-downloader/base.rb:80:in `block in download'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.35.0/lib/cocoapods/downloader.rb:29:in `block in ui_action'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.35.0/lib/cocoapods/user_interface.rb:49:in `section'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.35.0/lib/cocoapods/downloader.rb:28:in `ui_action'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-downloader-0.8.1/lib/cocoapods-downloader/base.rb:78:in `download'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.35.0/lib/cocoapods/installer/pod_source_installer.rb:98:in `download_source'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.35.0/lib/cocoapods/installer/pod_source_installer.rb:45:in `install!'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.35.0/lib/cocoapods/installer.rb:298:in `install_source_of_pod'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.35.0/lib/cocoapods/installer.rb:273:in `block (2 levels) in install_pod_sources'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.35.0/lib/cocoapods/user_interface.rb:70:in `titled_section'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.35.0/lib/cocoapods/installer.rb:272:in `block in install_pod_sources'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.35.0/lib/cocoapods/installer.rb:264:in `each'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.35.0/lib/cocoapods/installer.rb:264:in `install_pod_sources'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.35.0/lib/cocoapods/installer.rb:116:in `block in download_dependencies'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.35.0/lib/cocoapods/user_interface.rb:49:in `section'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.35.0/lib/cocoapods/installer.rb:114:in `download_dependencies'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.35.0/lib/cocoapods/installer.rb:91:in `install!'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.35.0/lib/cocoapods/command/project.rb:71:in `run_install_with_update'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.35.0/lib/cocoapods/command/project.rb:101:in `run'
/Library/Ruby/Gems/2.0.0/gems/claide-0.7.0/lib/claide/command.rb:271:in `run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.35.0/lib/cocoapods/command.rb:45:in `run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.35.0/bin/pod:43:in `<top (required)>'
/usr/bin/pod:23:in `load'
/usr/bin/pod:23:in `<main>'

Force curl to use HTTP/1.1

Report

My podspec has a source zip on a server that supports HTTP/2. Curl 7.54.0 in the latest macOS 10.14.2 (18C54) has a bug which causes issues with files fetched over HTTP/2. Therefore my pod keeps failing to validate and install for users. I don't think there is a way in my podspec to provide flags to curl is there? Are there any other possible solutions?

SVN authentication using --username and --password

Hi,
As I said there: CocoaPods/CocoaPods#4086 (comment) I have to export repo with those two parameters because my server refuse http basic authentication and it doesn't support svn+ssh protocol.
Unfortunately Cocoapods is launching on OS X Server and I can not store the credentials in Keychain with the server user. I tried to copy the keychain-item in the server user keychain, but it is still not working. My only solution is to populate --username and --password parameters. How can I do this? Thanks

Rename

The name of this gem clashes with the convention that the cocoapods- prefix is reserved to plugins. Moreover this gem offers general purpose utility which can be useful outside the scope of CocoaPods.

I propose to rename it a more universal name like UniDownloader (Uni stands for universal).

Vendored framework not matched when only file in pod source

Report

What did you do?

I created a Podspec that spec.source references a tgz file containing an already-compiled iOS framework. This tgz file is hosted in a GitHub release. I then tried to lint the Podspec.

What did you expect to happen?

I expected the podspec lint to complete successfully.

What happened instead?

The lint failed with:

- ERROR | [iOS] file patterns: The `vendored_frameworks` pattern did not match any file

I tracked this down to a quirk where this error only happens if the .framework directory is the only thing in the spec.source referenced a tgz file. If I touch dummy to create an empty file, add that along with the .framework to a tgz file, and reference that as the spec.source, the podspec passes lint just fine.

CocoaPods Environment

Stack

   CocoaPods : 1.8.4
        Ruby : ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]
    RubyGems : 3.0.3
        Host : Mac OS X 10.15.1 (19B88)
       Xcode : 11.1 (11A1027)
         Git : git version 2.21.0 (Apple Git-122)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib
Repositories : trunk - CDN - https://cdn.cocoapods.org/

Installation Source

Executable Path: /Users/aaron/.gem/bin/pod

Plugins

cocoapods-deintegrate : 1.0.4
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.1.0
cocoapods-trunk       : 1.4.1
cocoapods-try         : 1.1.0

Project that demonstrates the issue

A "broken" release of the tgz file (containing only the .framework) is located at https://github.com/textileio/grpc-ipfs-lite/releases/download/v0.0.1-rc0/grpc-ipfs-lite_v0.0.1-rc0_ios-framework.tar.gz.

A working release of the tgz file (containing the .framework and an empty dummy file) is located at https://github.com/textileio/grpc-ipfs-lite/releases/download/v0.0.1-rc1/grpc-ipfs-lite_v0.0.1-rc1_ios-framework.tar.gz.

I've attached a zip containing two pod specs, one referencing each of the above tgz files. You can lint each one and see the results.
Archive.zip

Feature Requests:Try shallow git clones as much as possible

Hi, I noticed that now when there is a branch or tag in the parameter it will do a shallow clone, if the parameter is a commit, I think I can try to check if there is a branch head or tag that can be mapped to this commit such as git ls-remote, which can Use shallow clones whenever possible to reduce download times.
(Note that this modification should not break the existing cocoapods git cache)

Shallow clone for submodule doesn't work for some Git repo

As CocoaPods 0.34.0 was released, I got some problem installing facebook-ios-sdk pod. After digging a while, I found it might be a git related issue.

To reproduce, first git clone facebook-ios-sdk repo, then run:

$ git submodule update --init --depth 1                                                                                                                 
Submodule 'Bolts-IOS' (git://github.com/BoltsFramework/Bolts-iOS.git) registered for path 'Bolts-IOS'
Submodule 'vendor/OCHamcrest' (git://github.com/hamcrest/OCHamcrest) registered for path 'vendor/OCHamcrest'
Submodule 'vendor/OCMock' (git://github.com/erikdoe/ocmock) registered for path 'vendor/OCMock'
Submodule 'vendor/OHHTTPStubs' (git://github.com/AliSoftware/OHHTTPStubs.git) registered for path 'vendor/OHHTTPStubs'
Submodule 'vendor/appledoc' (git://github.com/tomaz/appledoc.git) registered for path 'vendor/appledoc'
Submodule 'vendor/ios-snapshot-test-case' (git://github.com/facebook/ios-snapshot-test-case.git) registered for path 'vendor/ios-snapshot-test-case'
Submodule 'vendor/xctool' (git://github.com/facebook/xctool.git) registered for path 'vendor/xctool'
Cloning into 'Bolts-IOS'...
remote: Counting objects: 86, done.
remote: Compressing objects: 100% (70/70), done.
remote: Total 86 (delta 13), reused 45 (delta 6)
Receiving objects: 100% (86/86), 68.46 KiB | 0 bytes/s, done.
Resolving deltas: 100% (13/13), done.
Checking connectivity... done.
fatal: reference is not a tree: d679df70933da29463e44e15f4ce4f740d7b5dfd
...SKIP...
Unable to checkout 'd679df70933da29463e44e15f4ce4f740d7b5dfd' in submodule path 'Bolts-IOS'
Unable to checkout 'da09243ef136883fa8cea7ea2d42f48a9256fbdf' in submodule path 'vendor/OCHamcrest'
Unable to checkout '2191c124a93f535056e5cae05d55545a415fcde1' in submodule path 'vendor/OCMock'
Unable to checkout 'c87ded1ac299bc659a7e36bac43cac094bf7adb9' in submodule path 'vendor/OHHTTPStubs'
Unable to checkout 'd2e65f8c2faa066acfea2dbb51a5ec2d5364c7ec' in submodule path 'vendor/appledoc'
Unable to checkout 'a04ea585a5efb6cce6e5cd17f568eb1e6c472b2c' in submodule path 'vendor/ios-snapshot-test-case'
Unable to checkout 'f8720fe7e6af818054328c0325c7e9ce195f7c7c' in submodule path 'vendor/xctool'

My git --version is:

$ git --version
git version 1.9.3 (Apple Git-50)

Add option to avoid shallow git clone

Shallow git cloning was introduced into cocoapods-downloader in August this year, which breaks any HTTP git repository, like ours.

It would be nice to have an option to disable this via the Podspec so we can continue to offer CocoaPods support for HTTP git repositories.

Unrecognized options [:headers]

Hi,

I'm trying to set up private repo and have a problem with source setting with http url.
http://guides.cocoapods.org/syntax/podspec.html#source

It seems the document says 'headers' is a supported key, but I keep getting this error if I use headers.
If I remove headers, then it fails on different error, which looks like failing to download zip file because of missing authorization.

I'm using pod 1.8.4 and it seems cocoa pod-downloader is 1.2.2.

error

pod spec lint test-framework.podspec


 -> test-framework (0.1.0)
    - ERROR | [iOS] unknown: Encountered an unknown error (Unrecognized options `[:headers]`) during validation.


Analyzed 1 podspec.


[!] The spec did not pass validation, due to 1 error.

podspec file

Pod::Spec.new do |spec|


  spec.name         = "test-framework"
  spec.version      = "0.1.0"
  spec.summary      = "test-framework"
  spec.homepage     = "http://example.com"
  spec.license      = "NO_MIT"
  spec.author       = { "[email protected]" => "[email protected]" }
  spec.platform     = :ios, "10.0"
  spec.source       = { :http => 'https://enterprise-github/test/releases/download/0.1.0/TEST.framework.zip',
                         :type => 'zip',
                         :headers => ['Authorization: token token-value-here']
                        
                      }
  spec.vendored_frameworks = 'TEST.framework'


end

gemfile.lock

    cocoapods (1.8.4)
      activesupport (>= 4.0.2, < 5)
      claide (>= 1.0.2, < 2.0)
      cocoapods-core (= 1.8.4)
      cocoapods-deintegrate (>= 1.0.3, < 2.0)
      cocoapods-downloader (>= 1.2.2, < 2.0)
      cocoapods-plugins (>= 1.0.0, < 2.0)

NoMethodError - undefined method `start_with?' for <Pod::Version version=x.x.x>:Pod::Version

Command

/Users/bundlefile/ruby/2.6.0/bin/pod install --repo-update

Report

  • What did you do?

Yesterday everything was perfect, but today, I got this error. I searched the log and found out the cocoapods-downloader version was changed form 1.5.1 to 1.6.0 .

  • What did you expect to happen?

No error 🙏🏻

  • What happened instead?

Stack

   CocoaPods : 1.10.1
        Ruby : ruby 2.6.8p205 (2021-07-07 revision 67951) [universal.x86_64-darwin21]
    RubyGems : 3.0.3.1
        Host : macOS 12.2.1 (21D62)
       Xcode : 13.2.1 (13C100)
         Git : git version 2.32.0 (Apple Git-132)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib
Repositories : team-specs - git - https://gitlab.xxx.fm/team/Specs.git @ 19cf70bddeb44766

Plugins

cocoapods-binary-flutter              : 0.0.3
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

Podfile

source 'https://gitlab.xxx.fm/team/Specs.git'
# I have ‘2.24.4’ tag on my gitlab(https://gitlab.xxx.fm/team/Specs.git)
AWSCore, ‘2.24.4

Error

NoMethodError - undefined method `start_with?' for <Pod::Version version=2.24.4>:Pod::Version
/Users/bundlefile/ruby/2.6.0/gems/cocoapods-downloader-1.6.0/lib/cocoapods-downloader/git.rb:63:in `block in validate_input'
/Users/bundlefile/ruby/2.6.0/gems/cocoapods-downloader-1.6.0/lib/cocoapods-downloader/git.rb:63:in `any?'
/Users/bundlefile/ruby/2.6.0/gems/cocoapods-downloader-1.6.0/lib/cocoapods-downloader/git.rb:63:in `validate_input'
/Users/bundlefile/ruby/2.6.0/gems/cocoapods-downloader-1.6.0/lib/cocoapods-downloader/git.rb:24:in `preprocess_options'
/Users/bundlefile/ruby/2.6.0/gems/cocoapods-downloader-1.6.0/lib/cocoapods-downloader.rb:78:in `preprocess_options'
/Users/bundlefile/ruby/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/downloader.rb:130:in `preprocess_request'
/Users/bundlefile/ruby/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/downloader.rb:37:in `download'
/Users/bundlefile/ruby/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/pod_source_installer.rb:118:in `download_source'
/Users/bundlefile/ruby/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/pod_source_installer.rb:69:in `install!'
/Users/bundlefile/ruby/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:561:in `install_source_of_pod'
/Users/bundlefile/ruby/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:512:in `block (2 levels) in install_pod_sources'
/Users/bundlefile/ruby/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:86:in `titled_section'
/Users/bundlefile/ruby/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:511:in `block in install_pod_sources'
/Users/bundlefile/ruby/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:494:in `each'
/Users/bundlefile/ruby/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:494:in `install_pod_sources'
/Users/bundlefile/ruby/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:253:in `block in download_dependencies'
/Users/bundlefile/ruby/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:64:in `section'
/Users/bundlefile/ruby/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:252:in `download_dependencies'
/Users/bundlefile/ruby/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:161:in `install!'
/Users/bundlefile/ruby/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/command/install.rb:52:in `run'
/Users/bundlefile/ruby/2.6.0/gems/claide-1.1.0/lib/claide/command.rb:334:in `run'
/Users/bundlefile/ruby/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/command.rb:52:in `run'
/Users/bundlefile/ruby/2.6.0/gems/cocoapods-1.10.1/bin/pod:55:in `<top (required)>'
/Users/bundlefile/ruby/2.6.0/bin/pod:23:in `load'
/Users/bundlefile/ruby/2.6.0/bin/pod:23:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/cli/exec.rb:74:in `load'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/cli/exec.rb:74:in `kernel_load'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/cli/exec.rb:28:in `run'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/cli.rb:463:in `exec'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/cli.rb:27:in `dispatch'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/cli.rb:18:in `start'
/Library/Ruby/Gems/2.6.0/gems/bundler-1.17.2/exe/bundle:30:in `block in <top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/friendly_errors.rb:124:in `with_friendly_errors'
/Library/Ruby/Gems/2.6.0/gems/bundler-1.17.2/exe/bundle:22:in `<top (required)>'
/usr/bin/bundle:23:in `load'
/usr/bin/bundle:23:in `<main>'

download only branch with --depth 1 was not work on cocoapods 1.1.1

I found line 24 of git.rb
return options unless options[:branch]

but I was setting the right branch in my Podfile using :branch => 'xxx'. the this preprocess function will always to check the git ls-remote and replace the options[:branch] with options[:commit], then the clone_argument( force_head, shallow_clone) function would bypass the "--depth 1" paraments when downloading the source from my github, and always download the full .git and then checkout the the branch instead only download the specified branch from my github.

could you have a look at?

git clone error

/usr/local/bin/git clone /Volumes/Macintosh HD/Users/chipp/Library/Caches/CocoaPods/GitHub/a7c41d0c21b511276199ca7c6615dadde050fbe7 /Volumes/Macintosh\
     HD/Users/chipp/Developer/alabama-power-lakes/Pods/Mantle
     Too many arguments.

As you can see, first argument for clone command are passing without escaping:

def clone(from, to, flags = '')
        ui_sub_action("Cloning to Pods folder") do
          command = %Q|clone #{from} #{to.shellescape}|

.git Folders not Deleted after pod install in 0.34.1

Moved here from CocoaPods/CocoaPods#2584

After updating to cocoapods 0.34.1 I deleted the whole contents of the Pods folder (due to another problem) and did a new pod install. Surprisingly, the single Pods' .git folders are not deleted anymore. I did not provide the --no-clean parameter.

We check in the Pods folder to our git repo, so we need the .git folders to be deleted.

Support for path downloading

I'm building a private library, and I use cocoapods to to test it & distribute it.
I wand in my pod spec to support something like

s.source       = { :path => "./MyLib/" }

So when I will do pod spec lint it will take sources from the supplied path

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.