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
[!] Failed to download 'profile': can't modify frozen String #10920
Comments
hmm interesting, I will try with the link you provided. |
do you happen to have an open source pod or something that i can download? The one you specified I do not have access so I cant verify. |
it seems we are catching an exception and re-throwing but we are missing the underlying message: begin
download_result = Downloader.download(download_request, target, :can_cache => can_cache)
rescue Pod::DSLError => e
raise Informative, "Failed to load '#{name}' podspec: #{e.message}"
rescue => e
raise Informative, "Failed to download '#{name}': #{e.message}"
end Can you also run with |
Alternatively please modify your |
sry, I can't provide that. this is a private repo from the company. the blub.com is just a redacted url 😅
ok cool thx. I'll try that in the morning when I'm in the office again. The weird thing is, the error is only happening in this one repo. If we do the same thing in other repo, it works fine. So definitely interesting to see what the underlying error is. |
ok so
|
just tried this, but unfortunately also just prints:
|
ok, so I've tracked down the line that crashes, which is the I've added bunch of puts for debugging in that method: def self.preprocess_request(request)
puts "============= DEBUG =============== creating Request.new() now ..."
puts "============= DEBUG =============== spec: #{request.spec}"
puts "============= DEBUG =============== real: #{request.released_pod?}"
puts "============= DEBUG =============== name: #{request.name}"
puts "============= DEBUG =============== para: #{request.params}"
# puts "============= DEBUG =============== prep: #{Downloader.preprocess_options(request.params)}" # would crashes here
begin
crashing_params = Downloader.preprocess_options(request.params) # boom 💥
rescue => e
puts "============= DEBUG =============== error: #{e}"
end
req = Request.new(
:spec => request.spec,
:released => request.released_pod?,
:name => request.name,
:params => Downloader.preprocess_options(request.params))
puts "============= DEBUG =============== after creating"
req
end and this is the output: Fetching external sources
-> Pre-downloading: 'profile' from `ssh://git@blub.com:7999/profile.git`, branch `master`
============= DEBUG =============== preprocess_request
============= DEBUG =============== creating Request.new() now ...
============= DEBUG =============== spec:
============= DEBUG =============== real: false
============= DEBUG =============== name: profile
============= DEBUG =============== para: {:git=>"ssh://git@blub.com:7999/profile.git", :branch=>"master"}
$ /usr/bin/git ls-remote ssh://git@blub.com:7999/profile.git master
862052ef4a1df40d1d801a341b280eec78c9137d refs/heads/master
============= DEBUG =============== error: can't modify frozen String
[!] Failed to download 'profile': can't modify frozen String
/Users/cloud/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.10.2/lib/cocoapods/external_sources/abstract_external_source.rb:123:in `rescue in block in pre_download'
/Users/cloud/.rvm/gems/ruby-2.6.3/gems/cocoapods-1.10.2/lib/cocoapods/external_sources/abstract_external_source.rb:115:in `block in pre_download'
... Where is |
so, after some further digging, I finally found the line that causes this error. It is actually a new line that was recently introduced in cocoapods-downloader 1.5.0 release 7 days ago:
encoded_branch_name = branch_name.force_encoding(Encoding::ASCII_8BIT) This line causes the "can't modify frozen string" exception |
lol seems like the issue is fixed by using encoded_branch_name = branch_name.encode(Encoding::ASCII_8BIT) |
I've opened a PR now. Would really appreciate it if somebody could release the bugfix pretty soon :) |
awesome! I will take a look, we can ship cocoapods-downloader 1.5.1 for this. I will help you land the PR. |
This was fixed in cocoapods-downloader and shipped with version 1.5.1. Please use |
Report
What did you do?
Integrated one of our own hosted pod using the branch name:
pod 'profile', git: 'ssh://git@blub.com:7999/profile.git', branch: 'epic/activities'
and run the command normally:
pod update --clean-install --verbose
What did you expect to happen?
Install all pod dependencies correctly.
What happened instead?
Pod update failed during 'Fetching external sources' phase with
can't modify frozen String
. ❌But
pod update
does work if I use thecommit: '...'
option instead ofbranch: '...'
. ✅Using the branch option also works fine using Cocoapods 1.9.1. This error only happened after upgrading to CP 1.10.2 now (we only upgraded recently).
CocoaPods Environment
Cocoapods 1.10.2
Xcode 12.5.1
macOS 11.5
Ruby 2.6.3p62 (2019-04-16 revision 67580)
Error
The text was updated successfully, but these errors were encountered: