Closed LeifAndersen closed 2 years ago
I wonder if the error is related to lines like:
url "https://osdn.dl.osdn.jp/users/#{version.to_s.csv.second.sub(/\..*/, "")}/#{version.to_s.csv.second.gsub(".", "")}/genjyuugothic-x-#{version.to_s.csv.first}.zip", verified: "osdn.jp/"
I'm also experiencing a similar issue on Fedora 35:
brew tap linuxbrew/fonts
==> Tapping linuxbrew/fonts
Cloning into '/home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/linuxbrew/homebrew-fonts'...
remote: Enumerating objects: 70706, done.
remote: Counting objects: 100% (148/148), done.
remote: Compressing objects: 100% (32/32), done.
remote: Total 70706 (delta 120), reused 140 (delta 116), pack-reused 70558
Receiving objects: 100% (70706/70706), 10.02 MiB | 24.08 MiB/s, done.
Resolving deltas: 100% (57715/57715), done.
Error: Invalid formula: /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/linuxbrew/homebrew-fonts/Formula/font-fira-mono.rb
font-fira-mono: undefined method `csv' for "3.206,4.202":String
Error: Invalid formula: /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/linuxbrew/homebrew-fonts/Formula/font-genjyuugothic-l.rb
font-genjyuugothic-l: undefined method `csv' for "20150607,8.643":String
Error: Invalid formula: /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/linuxbrew/homebrew-fonts/Formula/font-genjyuugothic-x.rb
font-genjyuugothic-x: undefined method `csv' for "20150607,8.644":String
Error: Invalid formula: /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/linuxbrew/homebrew-fonts/Formula/font-genjyuugothic.rb
font-genjyuugothic: undefined method `csv' for "20150607,8.642":String
Error: Invalid formula: /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/linuxbrew/homebrew-fonts/Formula/font-genshingothic.rb
font-genshingothic: undefined method `csv' for "20150607,8.637":String
Error: Invalid formula: /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/linuxbrew/homebrew-fonts/Formula/font-hanamina.rb
font-hanamina: undefined method `csv' for "2017.09.04,68253":String
Error: Invalid formula: /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/linuxbrew/homebrew-fonts/Formula/font-meltho.rb
font-meltho: undefined method `csv' for "1.21,2018.06":String
Error: Invalid formula: /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/linuxbrew/homebrew-fonts/Formula/font-titillium.rb
font-titillium: undefined method `csv' for "2.0,258e06fe34c35320321f0458e6625bba":String
Error: Cannot tap linuxbrew/fonts: invalid syntax in tap!
One way to work around the problem for now is to enabled developer mode. I suspect that's why the issue may have slipped in in the first place. When enabled, the exception is not raised.
I seem to still get the same error with developer mode enabled:
leif@FEM ~/src/visr-deps (main) $ brew developer on
leif@FEM ~/src/visr-deps (main) $ brew tap linuxbrew/fonts
==> Tapping linuxbrew/fonts
Cloning into '/home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/linuxbrew/homebrew-fonts'...
remote: Enumerating objects: 71738, done.
remote: Total 71738 (delta 0), reused 0 (delta 0), pack-reused 71738
Receiving objects: 100% (71738/71738), 10.09 MiB | 12.03 MiB/s, done.
Resolving deltas: 100% (58609/58609), done.
Error: Invalid formula: /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/linuxbrew/homebrew-fonts/Formula/font-fira-mono.rb
font-fira-mono: undefined method `csv' for "3.206,4.202":String
Error: Invalid formula: /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/linuxbrew/homebrew-fonts/Formula/font-hanamina.rb
font-hanamina: undefined method `csv' for "2017.09.04,68253":String
Error: Invalid formula: /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/linuxbrew/homebrew-fonts/Formula/font-meltho.rb
font-meltho: undefined method `csv' for "1.21,2018.06":String
Error: Invalid formula: /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/linuxbrew/homebrew-fonts/Formula/font-genjyuugothic-l.rb
font-genjyuugothic-l: undefined method `csv' for "20150607,8.643":String
Error: Invalid formula: /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/linuxbrew/homebrew-fonts/Formula/font-genjyuugothic.rb
font-genjyuugothic: undefined method `csv' for "20150607,8.642":String
Error: Invalid formula: /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/linuxbrew/homebrew-fonts/Formula/font-genjyuugothic-x.rb
font-genjyuugothic-x: undefined method `csv' for "20150607,8.644":String
Error: Invalid formula: /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/linuxbrew/homebrew-fonts/Formula/font-titillium.rb
font-titillium: undefined method `csv' for "2.0,258e06fe34c35320321f0458e6625bba":String
Error: Invalid formula: /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/linuxbrew/homebrew-fonts/Formula/font-genshingothic.rb
font-genshingothic: undefined method `csv' for "20150607,8.637":String
Error: Cannot tap linuxbrew/fonts: invalid syntax in tap!
leif@FEM ~/src/visr-deps (main) $
Am I doing something wrong?
I'm sorry. I had set the HOMEBREW_DEVELOPER
variable. I didn't know about the brew developer
command. I'm not sure what the difference is between them. But, indeed, I still had the error when only using brew developer on
. Setting the HOMEBREW_DEVELOPER
environment variable to any non-empty value makes the tap work.
I've spent the past 30 min. or so debugging it and I still don't quite know what the issue is. It looks to me like the formula's expectation is that the version
call with the version string will create a Cask::DSL::Version
object and that subsequent calls will get that object, which does have a csv
method defined. Instead, the subsequent version
calls such as in the url
declaration, get back the original string, which will not have a csv
method.
What I can't tell is if something changed in the Homebrew DSL that is now causing these formulae to fail or if the formula is using the DSL incorrectly. I can't find many formulae that specifically declare their version to compare against.
Ah, okay, setting $HOMEBREW_DEVELOPER did work around the problem the problem:
leif@FEM ~ $ HOMEBREW_DEVELOPER="notfalse" brew tap linuxbrew/fonts
==> Tapping linuxbrew/fonts
Cloning into '/home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/linuxbrew/homebrew-fonts'...
remote: Enumerating objects: 71738, done.
remote: Total 71738 (delta 0), reused 0 (delta 0), pack-reused 71738
Receiving objects: 100% (71738/71738), 10.09 MiB | 12.62 MiB/s, done.
Resolving deltas: 100% (58610/58610), done.
Error: Invalid formula: /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/linuxbrew/homebrew-fonts/Formula/font-fira-mono.rb
font-fira-mono: undefined method `csv' for "3.206,4.202":String
Error: Invalid formula: /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/linuxbrew/homebrew-fonts/Formula/font-hanamina.rb
font-hanamina: undefined method `csv' for "2017.09.04,68253":String
Error: Invalid formula: /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/linuxbrew/homebrew-fonts/Formula/font-meltho.rb
font-meltho: undefined method `csv' for "1.21,2018.06":String
Error: Invalid formula: /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/linuxbrew/homebrew-fonts/Formula/font-genjyuugothic-l.rb
font-genjyuugothic-l: undefined method `csv' for "20150607,8.643":String
Error: Invalid formula: /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/linuxbrew/homebrew-fonts/Formula/font-genjyuugothic.rb
font-genjyuugothic: undefined method `csv' for "20150607,8.642":String
Error: Invalid formula: /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/linuxbrew/homebrew-fonts/Formula/font-genjyuugothic-x.rb
font-genjyuugothic-x: undefined method `csv' for "20150607,8.644":String
Error: Invalid formula: /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/linuxbrew/homebrew-fonts/Formula/font-titillium.rb
font-titillium: undefined method `csv' for "2.0,258e06fe34c35320321f0458e6625bba":String
Error: Invalid formula: /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/linuxbrew/homebrew-fonts/Formula/font-genshingothic.rb
font-genshingothic: undefined method `csv' for "20150607,8.637":String
Tapped 1862 formulae (1,888 files, 13.5MB).
I can't many formulae that specifically declare their version to compare against.
I think you accidentally a word, so I'm having a hard time parsing that sentence. Do you mind saying it one more time?
I can't many formulae that specifically declare their version to compare against.
I think you accidentally a word, so I'm having a hard time parsing that sentence. Do you mind saying it one more time?
I'm sorry about that. I edited the post. But the missing word was "find": "I can't find many formulae that specifically declare their version to compare against."
Okay cool, thanks.
Comparing these two files:
https://github.com/Linuxbrew/homebrew-fonts/blob/master/Formula/font-fira-mono.rb https://github.com/Homebrew/homebrew-cask-fonts/blob/master/Casks/font-fira-mono.rb
the biggest thing that sticks out to me is that linuxbrew is using to_s
. Maybe upstream homebrew changed so that its no longer needed?
the biggest thing that sticks out to me is that linuxbrew is using
to_s
. Maybe upstream homebrew changed so that its no longer needed?
Ahh, yes. I mixed my notes up. I don't know how this ever would have worked unless something upstream added a String#csv
method. I don't know the whole implementation history of Homebrew, but that seems a bit unlikely. I think it's supposed to be a Cask::DSL::Version
object, which does have csv
defined and that the author may have overlooked it by having HOMEBREW_DEVELOPER
set. That's a lot of speculation, but I could see how that could happen very easily.
The diff at https://github.com/Linuxbrew/homebrew-fonts/commit/caaeb14bfbe679698351463633147724429563a2 looks like a faulty automated import. Its commit message points at https://github.com/Linuxbrew/homebrew-fonts/commit/7408724109e62357b0ece047f59127a7467b29a7, which does use version.csv
without the to_s
in the middle.
I suppose we could fork the repo and set up a new tap with the to_s
calls removed and see if that fixes the issue.
I am really sorry for being inactive on this thread for over 1 month. I am working on this issue.
I hope the latest commit solves your issue. Please check it. Thank you for reporting this issue.
General troubleshooting steps
--force
and the issue is still present.brew update-reset && brew update
and retried my command.brew doctor
, fixed as many issues as possible and retried my command.Description of issue
Whenever I try to tap this fonts directory, I get errors saying that almost every formulea is broken. I have tried it with:
and
with no success. All give a variant of this error repeatedly:
Output of your command with
--verbose --debug
Output of
brew cask doctor