Error: can't modify frozen String

(axzxc1236) #1

I’m trying to create a pull request to linuxbrew-core because Youtube broke youtube-dl few days ago and linuxbrew is still providing old version.

Now I figured out the command to create a pull request

brew bump-formula-pr --url=https://github.com/ytdl-org/youtube-dl/releases/download/2019.04.24/youtube-dl-2019.04.24.tar.gz --sha256=1fbf54fb2f1ba3050da0cefe3cfa23604d445c8dc944202caf281d83851fffcf youtube-dl

But it shows me “Error: can’t modify frozen String” everytime I execute this command, and my youtube-dl is still in old version (“brew reinstall youtube-dl” fixes it in this case).

How can I resolve the issue and create a pull request to linuxbrew-core? Or someone else willing to create a pull request for this?

(Michka Popoff) #2

Hi.

Version bumps to formulae need to be done in https://github.com/Homebrew/homebrew-core.

They will get merged to the linux repo later on.

Regarding your error, @MikeMcQuaid has been working on the frozen strings lately. Could you give us a full stacktrace to help us debug this?

(Mike McQuaid) #3

(to do that run again with --debug)

(axzxc1236) #4

I know the updated version is in homebrew-core, I was just getting impatience waiting it to be ported to linuxbrew because it was literally unusable. (Actually I thought the two repository was maintained seperately)

I edited youtube-dl formula to look like old version and run the command with --verbose --debug

control@server:~$ brew bump-formula-pr --url=https://github.com/ytdl-org/youtube-dl/releases/download/2019.04.24/youtube-dl-2019.04.24.tar.gz --sha256=1fbf54fb2f1ba3050da0cefe3cfa23604d445c8dc944202caf281d83851fffcf youtube-dl --verbose --debug
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/youtube-dl.rb
/usr/bin/curl -q --show-error --user-agent Linuxbrew/2.1.1-72-g193173f\ \(Linux\;\ x86_64\ Ubuntu\ 18.04.2\ LTS\)\ curl/7.58.0 --location https://api.github.com/search/issues\?q=youtube-dl\+state\%3Aopen\+repo\%3AHomebrew\%2Flinuxbrew-core\+in\%3Atitle\&per_page=100 --header application/vnd.github.v3\+json --write-out '
'\%\{http_code\} --dump-header /tmp/github_api_headers20190426-28120-1hmortl
==> replace /https:\/\/github\.com\/ytdl\-org\/youtube\-dl\/releases\/download\/2019\.04\.17\/youtube\-dl\-2019\.04\.17\.tar\.gz/ with "https://github.com/ytdl-org/youtube-dl/releases/download/2019.04.24/youtube-dl-2019.04.24.tar.gz"
==> replace "0af9827d90ac37cb8368ebd9d625023de25e9a5edac21c3f7de5ac850de0f637" with "1fbf54fb2f1ba3050da0cefe3cfa23604d445c8dc944202caf281d83851fffcf"
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaContentsLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/youtube-dl.rb
/home/linuxbrew/.linuxbrew/bin/brew audit /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/youtube-dl.rb
/usr/bin/curl -q --show-error --user-agent Linuxbrew/2.1.1-72-g193173f\ \(Linux\;\ x86_64\ Ubuntu\ 18.04.2\ LTS\)\ curl/7.58.0 --location https://api.github.com/repos/Homebrew/linuxbrew-core/forks --header application/vnd.github.v3\+json --write-out '
'\%\{http_code\} --data @/tmp/github_api_post20190426-28120-qpe98o --dump-header /tmp/github_api_headers20190426-28120-1st9ah1
Error: can't modify frozen String
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/utils/github.rb:64:in `initialize'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/utils/github.rb:250:in `exception'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/utils/github.rb:250:in `raise'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/utils/github.rb:250:in `raise_api_error'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/utils/github.rb:209:in `open_api'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/utils/github.rb:322:in `create_fork'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/dev-cmd/bump-formula-pr.rb:318:in `block in bump_formula_pr'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/extend/pathname.rb:281:in `block in cd'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/extend/pathname.rb:281:in `chdir'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/extend/pathname.rb:281:in `cd'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/dev-cmd/bump-formula-pr.rb:301:in `bump_formula_pr'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb:102:in `<main>'
(axzxc1236) #5

I forgot to mention one thing, I don’t know if it is related to the issue or not.

When I issued bump-formula-pr command for the first time, I got an error told me the permission of youtube-dl.rb is wrong, so I used chmod command to set the file perrmission to 644 as stated in error.

Then I issued bump-formula-pr command again, got the terminal output above.

(Mike McQuaid) #6

brew update, try again and this should be resolved.