square / cocoapods-pack

A CocoaPods plugin for producing xcframeworks from podspecs.
Apache License 2.0
115 stars 7 forks source link

Unable to copy license file #3

Open alvar-bolt opened 2 years ago

alvar-bolt commented 2 years ago

When trying to build from remote podspec that has license file set, the copy_license fails.

For example, Lottie:

bundle exec pod pack https://raw.githubusercontent.com/airbnb/lottie-ios/master/lottie-ios.podspec lottie.zip --out-dir=out --allow-warnings --skip-platforms=watchos,macos,tvos
Errno::ENOENT - No such file or directory @ rb_sysopen - /var/folders/3j/1bx2f0f11qs8vltrck4zt9q00000gn/T/CocoaPods-Bin/1.0.0/Pack_podspec/LICENSE
/Users/alvarhansen/.rbenv/versions/2.7.2/lib/ruby/2.7.0/fileutils.rb:1414:in `initialize'
/Users/alvarhansen/.rbenv/versions/2.7.2/lib/ruby/2.7.0/fileutils.rb:1414:in `open'
/Users/alvarhansen/.rbenv/versions/2.7.2/lib/ruby/2.7.0/fileutils.rb:1414:in `copy_file'
/Users/alvarhansen/.rbenv/versions/2.7.2/lib/ruby/2.7.0/fileutils.rb:511:in `copy_file'
/Users/alvarhansen/Developer/cocoapods-pack/lib/cocoapods-pack/command/pack.rb:402:in `stage_file'
/Users/alvarhansen/Developer/cocoapods-pack/lib/cocoapods-pack/command/pack.rb:375:in `copy_license'
/Users/alvarhansen/Developer/cocoapods-pack/lib/cocoapods-pack/command/pack.rb:212:in `stage_additional_artifacts'
/Users/alvarhansen/Developer/cocoapods-pack/lib/cocoapods-pack/command/pack.rb:134:in `run'
/Users/alvarhansen/Developer/ios-app-client-stage/Vendor/bundle/ruby/2.7.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
/Users/alvarhansen/Developer/ios-app-client-stage/Vendor/bundle/ruby/2.7.0/gems/cocoapods-1.10.1/lib/cocoapods/command.rb:52:in `run'
/Users/alvarhansen/Developer/ios-app-client-stage/Vendor/bundle/ruby/2.7.0/gems/cocoapods-1.10.1/bin/pod:55:in `<top (required)>'
/Users/alvarhansen/Developer/ios-app-client-stage/vendor/bundle/ruby/2.7.0/bin/pod:23:in `load'
/Users/alvarhansen/Developer/ios-app-client-stage/vendor/bundle/ruby/2.7.0/bin/pod:23:in `<top (required)>'
/Users/alvarhansen/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bundler-1.17.3/lib/bundler/cli/exec.rb:74:in `load'
/Users/alvarhansen/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bundler-1.17.3/lib/bundler/cli/exec.rb:74:in `kernel_load'
/Users/alvarhansen/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bundler-1.17.3/lib/bundler/cli/exec.rb:28:in `run'
/Users/alvarhansen/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bundler-1.17.3/lib/bundler/cli.rb:463:in `exec'
/Users/alvarhansen/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bundler-1.17.3/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/Users/alvarhansen/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bundler-1.17.3/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/Users/alvarhansen/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bundler-1.17.3/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
/Users/alvarhansen/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bundler-1.17.3/lib/bundler/cli.rb:27:in `dispatch'
/Users/alvarhansen/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bundler-1.17.3/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
/Users/alvarhansen/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bundler-1.17.3/lib/bundler/cli.rb:18:in `start'
/Users/alvarhansen/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bundler-1.17.3/exe/bundle:30:in `block in <top (required)>'
/Users/alvarhansen/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bundler-1.17.3/lib/bundler/friendly_errors.rb:124:in `with_friendly_errors'
/Users/alvarhansen/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bundler-1.17.3/exe/bundle:22:in `<top (required)>'
/Users/alvarhansen/.rbenv/versions/2.7.2/bin/bundle:23:in `load'
/Users/alvarhansen/.rbenv/versions/2.7.2/bin/bundle:23:in `<main>'
xuzhongping commented 2 years ago

Not only the license, but other file resources will have problems in the remote podspec.

xuzhongping commented 2 years ago

When this program is processing remote podspec file, the logic of copying various resources is wrong, because the original path of the resource is assumed to be the path level as the podspec file in the program, but when remote, the path of the resource actually exists in the sandbox or cocoapods cache. I think it is more reasonable to find resources in the sandbox.🤔

dnkoutso commented 2 years ago

ah yes, remote podspec support was added right before this shipped. Alamofire successfully worked, we should fix this.