It has been a while since my attempted patch for Mudlet to successfully build and fully function for FreeBSD. I have been waiting patiently and have checked back with Grok to see if other solutions would become apparant. Unfortunately my efforts with Grok did not yield any further improvements. However, I recently saw a comment on my proposed patch which could solve the issue.
Thanks for chasing this down on FreeBSD. The crash is real, but the cause is in packaging, not in Geyser, and it isn't specific to FreeBSD.The real cause
The FreeBSD port just hits this first. A Linux distro package or a /usr/local make install fails the same way. The fix is one install rule matching the existing fallback path:
- Adjustable.Container loads its strings with loadTranslations("AdjustableContainer"). That looks for translations/lua/mudlet-lua.json first in the source tree, then under luaGlobalPath .. "/translations/" (Other.lua).
- The make install rules for UNIX AND NOT APPLE in src/CMakeLists.txt install mudlet-lua/lua, the tests and lcf, but never translations/lua/*.json. Only the macOS bundle copies them. This is still true on current development.
- An installed Mudlet loads Lua from ${PREFIX}/share/mudlet/lua (TLuaInterpreter.cpp), so neither path exists and loadTranslations() returns nil. Adjustable.Container:new then fails on self.Locale.lock.message.
That also fixes the package and module install messages in Other.lua, which load translations the same way. Problems with the current patch (checked by running the patched code in lua5.1) install(DIRECTORY "../translations/lua/" DESTINATION "share/mudlet/lua/translations" FILES_MATCHING PATTERN "*.json" PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
- Breaks package installs. It sets mudlet.Locale = {}. Other.lua fills mudlet.Locale lazily (mudlet.Locale = mudlet.Locale or loadTranslations("Mudlet")), so once any adjustable container exists, that load never runs. verbosePackageInstall / verboseModuleInstall then fail with "attempt to index field 'packageInstallSuccess' (a nil value)", even when translations are present.
- The fallback covers 7 of the 17 AdjustableContainer keys. Hovering "Attach" (onEnterAtt, top/bottom/left/right) and calling addConnectMenu() (connectTo/ disconnect) still throw. The English fallback strings also differ from the real ones ("Minimize" vs "Min/Restore", "Lock Style" vs "Lockstyle:", "Custom Items" vs "Custom:").
- The getOS() == "freebsd" gate misses the other affected platforms. OpenBSD, NetBSD and Linux installs still crash.
- Leftover guards. min_restore / max_restore are never read as fields. The second constructor block writes the class Locale, and only that write keeps line 1137 from crashing.
Soon after I saw this, I was a bit uncertain how to continue, so I asked Grok.
Prompt 3 of 20 (17 remaining). This is the breakthrough we needed.Upstream’s analysis is correct
The long comment on your PR (the one that looks Claude-generated) correctly identifies the real root cause:
- Adjustable.Container (and other code) calls loadTranslations("AdjustableContainer").
- That function looks for JSON files under translations/lua/ (first relative to the source tree, then under luaGlobalPath .. "/translations/").
- On a normal make install for UNIX (including FreeBSD and Linux distro packages), those JSON files are never installed. Only the macOS bundle copies them.
- Result: loadTranslations returns nil → self.Locale is nil → Geyser crashes.
The proper fix (recommended by upstream)
Add this install rule (in src/CMakeLists.txt or equivalent):
install(DIRECTORY "../translations/lua/"
DESTINATION "share/mudlet/lua/translations"
FILES_MATCHING PATTERN "*.json"
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
/usr/local/share/mudlet/lua/translations/mudlet-lua.json /usr/local/share/mudlet/lua/translations/translated/...
How to do this in the FreeBSD port (no CMake patch required)
The easiest and cleanest way for the port is a post-stage (or post-install) rule in the Makefile. Add something like this:
post-stage:
@${ECHO_MSG} "==> Installing Lua translation JSON files"
@${MKDIR} ${STAGEDIR}${PREFIX}/share/mudlet/lua/translations
@${CP} -Rp ${WRKSRC}/translations/lua/* \
${STAGEDIR}${PREFIX}/share/mudlet/lua/translations/ 2>/dev/null || true
ls -l /usr/local/share/mudlet/lua/translations/ ls -l /usr/local/share/mudlet/lua/translations/mudlet-lua.json
Next step
- Add the `post-stage` rule above (or the CMake install rule if you prefer a patch).
- Clean rebuild + install.
- Confirm the JSON files are present.
- Test Mudlet (especially the tutorial / any AdjustableContainer UI).
I really only asked Grok for clarity or to give myself a moment to digest the information, the patching I needed to do was already provided, I simply had some uncertainty. Since I already knew that this should be an upstream change and that it affects more than just FreeBSD, what I chose to do was simply edit the src/CMakeLists.txt file as mentioned in the comment to the commit. I found the most appropriate location, directly inside of a conditional for Unix builds. I copied and pasted it in, then created the patch. I cleaned up and removed any other patches for the unofficial -dev port and set it to build.
After a while, and a few rebuilds to be sure the pkg-plist would be complete, it was finished. I had made the adjustements and did the build in a clean jail that had only its necessary dependencies installed. Once I created a fresh pkg-plist, I went outside of the jail to build and install on my system for testing.
The pkg-plist file I had generated already proved that the needed file to check for would be installed. I built and installed a new mudlet on my system, then tested the client. When I chose the mudlet tutorial, everything worked as it should, no complaint about locale and a broken UI.
Now mudlet upstream will soon correct the issue. Technically I did do a pull request with the suggested fix but since I am a such a "great expert" with github and only somewhat better with git itself, it was closed and upstream will need to figure it out. I am not going to add further noise by my git skills. Git frustrates me with regard to backing out of commits, merging the whole mess I have on my end to upstream without my desire, and how I don't truly understand much of git or github.
We can now truly celebrate. Before