From spellchecker to system restore: a story of extreme aggression with sudo
I managed to poop all over my operating system with a spell checker.
how, you ask?
Well.
apparently macos, plus stuff like chrome, uses hunspell for its spellchecking and it’s built in.
but it wasn’t visible from the commandline.
and i wanted to use it in emacs.
so I installed it on homebrew.
but it couldn’t find the dictionaries, despite being in the right place.
and I found a bunch of random mentions on SO about bizarre bugs in the latest version.
And homebrew apparently doesn’t let you install versions from previous commits any more. Instead, it yells at you to use some command called “brew extract.”
Because I fucking hate homebrew ,
no, I really really hate homebrew,
but there’s no good alternative
so anyway, I hate homebrew.
so I wasn’t about to let it yell at me to use some random new command
(in bold with exclamation marks, of course, because the homebrew maintainers are, frankly, shouty bossy assholes)
so rather than dig around for docs on brew extract
I just built and installed hunspell from source
that might not be a good idea to do with a system utility?
especially when that system utility still can’t find the dictionaries from the command line
so you say “fuck it” and run `make uninstall?`
and then you randomly decide, “wait a minute, there’s this other command to try in hunspell
let me install it again from homebrew”
and suddenly homebrew refuses to link anything into userspace
claiming it no longer has permission to some filesystem location
so you brew uninstall again
and you run ‘brew doctor’
and brew doctor says nothing about permissions
but demands that you uninstall a bunch of c libs that were,
I kid you not,
“unbrewed,”
plus claims that hunspell… and emacs itself… are around but not linked
but why on earth would deleting a bunch of c libs fix some kind of permissions problem?
and why would I delete libraries for no reason other than that they haven’t been installed by homebrew?
given that, as noted, the homebrew maintainers are a bunch of bossy dictatorial asshats
(n.b., would someone PLEASE PLEASE fucking fork that whole project??)
why on earth would I trust the claim that somehow all of my problems are attributable to having the temerity to having libraries that it didn’t install?
knowing how that project is run,
(badly. that project is run badly.)
it seems less likely that directory permission problems are the results of having a forbidden file,
and more likely that the homebrew maintainers just assume that every user is a moron
and that anything you install on their computer without their permission is bad.
and then I tried to open emacs
but somehow it threw a bytecode error and crashed
so I googled some more
and I chowned some directories
and even though the chown command threw an error, somehow that worked
homebrew would link things again
take that, ‘brew doctor’
it would install hunspell
which still didn’t work
so I uninstalled it again
it would also relink emacs.
and emacs worked again.
except the spacemacs icon I originally had
(all this was from trying to migrate off spacemacs)
was gone.
and so was decent code highlighting in org.
and so was spellchecking
…
system-wide.
oh yeah, hunspell is a system package
and I probably overwrote it by building it myself from source and `sudo make install`ing it
and then when I `sudo make uninstall`ed it,
well.
now, at this point, I suppose I could have tried to build it again.
but we already established that the one I built was crap.
and I’d broken emacs code-highlighting in mysterious ways.
(although I was glad to see the back of that icon)
and I could have installed the homebrew one again
but how likely is it that this would have worked?
and I was just tired of fighting it.
So, I installed aspell.
and then I realized that having emacs with broken code-highlighting
and as the only piece of software on my system that actually can do spell-check
was, uh, sub optional.
and then I realized that I had run a time machine backup about an hour before starting my spellchecker odyssey.
thank you, past me.
in about ten hours I will hopefully have a computer again
also, fuck homebrew
(but seriously, though. homebrew is terrible. this person explains why with less swearing.
and this wise human sums up in even less kind terms than my own: “Homebrew is like herpes: you pay for your moment of instant gratification with a lifetime of burning pain.” Yep.)
Denouement
The next morning, my computer started doing scary things, like asking for the iCloud password for account (null)
but then it remembered that apple shit is supposed to work (and actually accepted my icloud password…?)
and I installed aspell.
and now I have a working machine
and I can do spell checking in emacs. suck it, homebrew.