I’ve been trying to statically link my Crystal Discord bot so I can use a distroless Docker image, and it…mostly works. But the tracebacks look like this:
Unhandled exception: Errno: Error connecting to 'localhost:6379': Connection refused (Redis::CannotConnectError)
from ???
from ???
from ???
from ???
from ???
from ???
from ???
from ???
from ???
from ???
from ???
from ???
from ???
from ???
from ???
from ???
from ???
from ???
from ???
IOW, there’s no debugging information shown in the frames, but I definitely compiled with debug info enabled. Is there a trick to getting this to work? All I could find on Google was my old Alpine Linux static linking issue that’s unrelated (I’m already linking with libstdc++ for the mongo libraries), as well as someone asking this on IRC which was completely unresolved.
1.0 marks a point where breaking changes should stop happening. Fixing stack traces can happen before or after 1.0, it’s not related to breaking changes.
I totally agree. No breaking changes should happen in 1.x after 1.0 release.
OTOH if statically linked binaries considered a major use-case by hopefully a huge list of newcomers when Crystal is declared 1.0, then this issue with missing stack traces can be 1 additional point in cons list.
Of course I would put things like a reliable debugger higher on the list than this issue with statically linked binaries.
Anyways, it’s just my wishlist for things like debugger, monitoring and anything else that can help me to show that Crystal is reliable/safe enough to start new projects in it.Then one day I could use it in my job and not my pet projects.