Homebrew / homebrew-cask

🍻 A CLI workflow for the administration of macOS applications distributed as binaries
https://brew.sh
BSD 2-Clause "Simplified" License
20.83k stars 10.66k forks source link

Bug report: Cask 'caskname' definition is invalid: Bad header line: parse failed #16208

Closed derekperkins closed 8 years ago

derekperkins commented 8 years ago

(Remember to run brew update; brew cleanup; brew cask cleanup before reporting your issue. It usually fixes things!)

Description of issue

Most cask operations tell me that I have bad header lines. I believe it started happening after I used Cmd-C to halt a cask operation. No amount of doctor/cleanup changes the output.

Output of brew cask list --verbose

Cask 'atom' definition is invalid: Bad header line: parse failed

Output of brew cask uninstall mysqlworkbench --verbose

Cask 'mysqlworkbench' definition is invalid: Bad header line: parse failed

Output of brew doctor

Warning: You have external commands with conflicting names.

Found command `brew-cask` in following places:
    /usr/local/bin/brew-cask
    /usr/local/Library/Taps/caskroom/homebrew-cask/cmd/brew-cask.rb

Warning: Homebrew's sbin was not found in your PATH but you have installed
formulae that put executables in /usr/local/sbin.
Consider setting the PATH for example like so
    echo 'export PATH="/usr/local/sbin:$PATH"' >> ~/.zshrc

Output of brew cask doctor

==> OS X Release:
10.11
==> OS X Release with Patchlevel:
10.11.2
==> Hardware Architecture:
intel-64
==> Ruby Version:
2.0.0-p645
==> Ruby Path:
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
==> Homebrew Version:
Homebrew 0.9.5 (git revision 7ef5; last commit 2015-12-28)
==> Homebrew Executable Path:
/usr/local/bin/brew
==> Homebrew Cellar Path:
/usr/local/Cellar
==> Homebrew Repository Path:
/usr/local
==> Homebrew Origin:
https://github.com/Homebrew/homebrew
==> Homebrew-cask Version:
0.54.1
==> Homebrew-cask Install Location:
/usr/local/Cellar/brew-cask/0.54.1
==> Homebrew-cask Staging Location:
/opt/homebrew-cask/Caskroom
==> Homebrew-cask Cached Downloads:
/Library/Caches/Homebrew
/Library/Caches/Homebrew/Casks
0 files
0.00 megs
==> Homebrew-cask Default Tap Path:
/usr/local/Library/Taps/caskroom/homebrew-cask
==> Homebrew-cask Alternate Cask Taps:
<NONE>
==> Homebrew-cask Default Tap Cask Count:
2921
==> Contents of $LOAD_PATH:
/usr/local/Cellar/brew-cask/0.54.1/rubylib
/Library/Ruby/Site/2.0.0
/Library/Ruby/Site/2.0.0/x86_64-darwin15
/Library/Ruby/Site/2.0.0/universal-darwin15
/Library/Ruby/Site
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/vendor_ruby/2.0.0
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/vendor_ruby/2.0.0/x86_64-darwin15
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/vendor_ruby/2.0.0/universal-darwin15
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/vendor_ruby
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/x86_64-darwin15
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin15
==> Contents of $RUBYLIB Environment Variable:
<NONE>
==> Contents of $RUBYOPT Environment Variable:
<NONE>
==> Contents of $RUBYPATH Environment Variable:
<NONE>
==> Contents of $RBENV_VERSION Environment Variable:
<NONE>
==> Contents of $CHRUBY_VERSION Environment Variable:
<NONE>
==> Contents of $GEM_HOME Environment Variable:
<NONE>
==> Contents of $GEM_PATH Environment Variable:
<NONE>
==> Contents of $BUNDLE_PATH Environment Variable:
<NONE>
==> Contents of $PATH Environment Variable:
PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/derek/google-cloud-sdk/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/derek/bin:/usr/local/mysql/bin:/Users/derek/go/bin:/usr/local/Library/Taps/caskroom/homebrew-cask/cmd:/usr/local/Library/ENV/scm"
==> Contents of $SHELL Environment Variable:
SHELL="/bin/zsh"
==> Contents of Locale Environment Variables:
LANG="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"
==> Running As Privileged User:
No
vitorgalvao commented 8 years ago

This error is not a bug, it's caused by an update to how homebrew-cask works. Details can be found here.

To fix the issue, please run:

brew uninstall --force brew-cask; brew update

If you are still having problems, open an issue with the appropriate template

Lohoris commented 8 years ago

Guys, not to sound arrogant, but… yes, it is a bug.

If you do changes which break how stuff works, you should also incorporate some feature into your program that fix those automagically. Especially if the fix is as trivial as that.

Just repeating the mantra "it's not a bug it's not a bug it's not a bug" won't make it so. It is.

vitorgalvao commented 8 years ago

@lohoris. Here’s another thing we repeat since the start of the project: “we’re pre-alpha and things will break”. If you can’t deal with that, then don’t use it until it’s stable.

You suggestion shows you have no understanding of how the system worked. We puggiback on homebrew, and you had to specifically update us (brew cask upgrade brew-cask), just like any other app. However, we’re also a tap, so brew update also updated the cask definitions. That’s where discrepancies happened. We’ve since changed that, an now we update with every brew update, just like homebrew, so these discrepancies should no longer occur.

Borrowing your “not to sound arrogant, but”, if you don’t update regulalrly on pre-alpha software that tells you to do so every step of the way and has messages about changes and how to fix them plastered all over its messages and documentation, then it’s your own fault.

It’s always the people I never see contribute that come with the insane propositions. “Oh, just do this with your limited time for free because I want it, while I sit back”. If you feel strongly about it, get involved in the discussions and contribute. Otherwise, we’re pre-alpha an things will break.

We try to make transitions smooth, but sometimes that isn’t possible. If you need a new version for the transition, but don’t upgrade, there’s no “automagic” to fix that. We can’t retroactively give you the latest version. So no, the fix isn’t trivial. It is trivial for you to do, but not for us to implement.

So no, it is not a bug.

This discussion isn’t even worth having. Like I said, these types of things should no longer happen under the new system. However, I still wanted to explain why we did things this way. To be clear, I’m not lashing out at you and simply aim to make the system clear to you. Next time, please, if you don’t indeed want to sound arrogant, instead of telling us what we should have done, ask us why we did it that way.

Lohoris commented 8 years ago

I can deal with that: I'm using it, I'm VERY happy with it, and I think you are doing an excellent job.

Still, don't claim "it's not a bug" when it is.

Feel free to break anything you need to break, we are fine with that. Just don't use this "it's alpha" as an excuse to say "it's not a bug". The correct thing you should say is "it's alpha, it's a bug, it happens". And that would be perfectly fine.

We are discussing semantics now, but if you don't "fix" this (now little) semantics problem now, you risk ending up being an arrogant "everything we do is sacred even if it's infinitely stupid and obviously buggy and no we won't fix it ha ha ha" like PHP developers do now, for instance. I repeat, you are not doing so now, and I would like you not to do that in future either. And that's why I'm writing this.

Again, please, understand you are doing an excellent job and I'm very very happy with it. And this is only an attempt into preventing you from derailing and stop doing a great job and sucking instead. Hope you read it the correct way ^_^

Bottom line:

PS: the fact that it isn't fixable, and that doing this workaround is the only solution and you couldn't do anything about that… I understand it. It is fine. But it is still to be called "bug".

derekperkins commented 8 years ago

@Lohoris You are coming across like a terribly arrogant troll. They chose to change their architecture with the foreknowledge that is was going to break backwards compatibility. Despite their best efforts to notify users, it's impossible to inform 100% of the 8500 people who have starred the repo plus countless others who just use it. I recognize that you aren't intending to offend, but it's ignorant comments like yours that cause great contributors to open source to burn out. Please be respectful of the incredible commitment that they put into working on cask and projects like it.

vitorgalvao commented 8 years ago

I’ve locked the issue temporarily to prevent an escalation of words before I got the chance to reply (on a phone and out, so it takes a while).

@derekperkins Though I appreciate your concern (burnout is indeed a huge problem, and comments that don’t consider context can be one of the sources for it), I do believe @lohoris had only good intentions in mind, and that his latest comment intended to show it.

Although I still slightly disagree in some regards, @lohoris, I do understand your point and appreciates the thoughtful reply. As already discussed (and reiterated by @derekperkins), we do the best we can with the resources and capabilities we have, and in this case, we had strong constraints. However, it was not done thoughtlessly (we regularly discuss every decision that affects the project as a whole, however minute).

I also agree we’re just arguing semantics at this point, and there isn’t much to be gained from it. If that canned response (that’ll be needed less and less, thanks to the new system) has a section that can be interpreted as having a bad tone, I have no quarrel with removing it. Already made a note to remove that part from the TextExpander snippet when I get home.

Thank you both for caring about and using the project! Have a nice day.

Unlocked again.

Lohoris commented 8 years ago

I'm very glad you understand, thanks!

Keep on the great work!

serginator commented 8 years ago

Well, to follow the issue and avoid opening a new one saying the same, I'm having the same problems. I read other issues and tried brew uninstall --force brew-cask; brew update and the nuclear one, but same problem, Error: Cask 'popcorn-time' definition is invalid: Bad header line: '{:v1=>"popcorn-time"}' does not match file name.

vitorgalvao commented 8 years ago

@serginator We don’t host a popcorn-time cask and never did, you tapped it from somewhere else. That third-party tap needs to fix the header in that cask.

Lohoris commented 8 years ago

Or he could unlink it, somehow?

On Mon, 7 Mar 2016 at 14:00 Vítor Galvão notifications@github.com wrote:

@serginator https://github.com/serginator We don’t host a popcorn-time cask and never did, you tapped it from somewhere else. That third-party tap needs to fix the header in that cask.

— Reply to this email directly or view it on GitHub https://github.com/caskroom/homebrew-cask/issues/16208#issuecomment-193239261 .

serginator commented 8 years ago

Thanks, that was the problem, I just untapped it and it worked.