I updated Homebrew for the first time in a while and my Hammerspoon config broke. My Hammerspoon config is written in Fennel. Turns out Lua is 5.5 now, and the Homebrew installer for Fennel installs in the luajit version (5.1) and the current version (5.5) but not Homebrew's version (5.4).
$ hs
> require("fennel")
...poon.app/Contents/Resources/extensions/hs/_coresetup.lua:662: module 'fennel' not found:
no field package.preload['fennel']
no file '/Users/kbd/.hammerspoon/fennel.lua'
no file '/Users/kbd/.hammerspoon/fennel/init.lua'
no file '/Users/kbd/.hammerspoon/Spoons/fennel.spoon/init.lua'
no file '/opt/homebrew/share/lua/5.4/fennel.lua'
no file '/opt/homebrew/share/lua/5.4/fennel/init.lua'
no file '/opt/homebrew/lib/lua/5.4/fennel.lua'
no file '/opt/homebrew/lib/lua/5.4/fennel/init.lua'
no file '/usr/local/share/lua/5.4/fennel.lua'
no file '/usr/local/share/lua/5.4/fennel/init.lua'
no file '/usr/local/lib/lua/5.4/fennel.lua'
no file '/usr/local/lib/lua/5.4/fennel/init.lua'
no file './fennel.lua'
no file './fennel/init.lua'
no file '/Applications/Hammerspoon.app/Contents/Resources/extensions/fennel.lua'
no file '/Applications/Hammerspoon.app/Contents/Resources/extensions/fennel/init.lua'
no file '/Users/kbd/.local/share/hammerspoon/site/fennel.lua'
no file '/Users/kbd/.local/share/hammerspoon/site/fennel/init.lua'
no file '/Users/kbd/.local/share/hammerspoon/site/Spoons/fennel.spoon/init.lua'
no file '/Users/kbd/.hammerspoon/fennel.dylib'
no file '/Users/kbd/.hammerspoon/fennel.so'
no file '/opt/homebrew/lib/lua/5.4/fennel.so'
no file '/opt/homebrew/lib/lua/5.4/loadall.so'
no file '/usr/local/lib/lua/5.4/fennel.so'
no file '/usr/local/lib/lua/5.4/loadall.so'
no file './fennel.so'
no file '/Applications/Hammerspoon.app/Contents/Frameworks/fennel.dylib'
no file '/Users/kbd/.local/share/hammerspoon/site/lib/fennel.dylib'
no file '/Users/kbd/.local/share/hammerspoon/site/lib/fennel.so'
Contents of homebrew/share/lua:
/opt/homebrew/share/lua$ eza -alT
drwxr-xr-x@ - kbd 16 Apr 13:51 .
drwxr-xr-x@ - kbd 16 Apr 16:33 ├── 5.1
lrwxr-xr-x@ - kbd 16 Apr 16:33 │ ├── fennel.lua -> ../../../Cellar/fennel/1.6.1_1/share/lua/5.1/fennel.lua
lrwxr-xr-x@ - kbd 16 Apr 13:51 │ └── re.lua -> ../../../Cellar/lpeg/1.1.0_2/share/lua/5.1/re.lua
drwxr-xr-x@ - kbd 16 Apr 13:51 ├── 5.4
lrwxr-xr-x@ - kbd 16 Apr 13:51 │ └── re.lua -> ../../../Cellar/lpeg/1.1.0_2/share/lua/5.4/re.lua
drwxr-xr-x@ - kbd 16 Apr 16:33 └── 5.5
lrwxr-xr-x@ - kbd 16 Apr 16:33 ├── fennel.lua -> ../../../Cellar/fennel/1.6.1_1/share/lua/5.5/fennel.lua
lrwxr-xr-x@ - kbd 16 Apr 13:51 └── re.lua -> ../../../Cellar/lpeg/1.1.0_2/share/lua/5.5/re.lua
For now I've symlinked the 5.5 fennel.lua into .hammerspoon:
~/.hammerspoon$ ln -s /opt/homebrew/share/lua/5.5/fennel.lua fennel.lua
In the future I could switch to luarocks to install fennel, which afaik lets you install for specific versions. Figured it was worth opening this ticket to track 5.5 status (as there was a ticket for 5.4).
I updated Homebrew for the first time in a while and my Hammerspoon config broke. My Hammerspoon config is written in Fennel. Turns out Lua is 5.5 now, and the Homebrew installer for Fennel installs in the luajit version (5.1) and the current version (5.5) but not Homebrew's version (5.4).
Contents of
homebrew/share/lua:For now I've symlinked the 5.5
fennel.luainto.hammerspoon:~/.hammerspoon$ ln -s /opt/homebrew/share/lua/5.5/fennel.lua fennel.luaIn the future I could switch to luarocks to install fennel, which afaik lets you install for specific versions. Figured it was worth opening this ticket to track 5.5 status (as there was a ticket for 5.4).