can not start opencode on ubuntu /tmp does not allow execution of .so
Description
When trying to run opencode it tries to execute/use a shared object file from the /tmp directory, however execution of shared object files on Ubuntu is blocked for security reasons.
> TMPDIR=~/.opencode/tmp opencode --print-logs --log-level DEBUG <region:eu-central-1>
INFO 2025-12-06T20:19:48 +153ms service=default version=1.0.134 args=["--print-logs","--log-level","DEBUG"] opencode
ERROR 2025-12-06T20:19:48 +362ms service=acp-command promise={} reason=Failed to initialize OpenTUI render library: Failed to open library "/tmp/.1b7ffdebf6a76fe6-00000001.so": /tmp/.1b7ffdebf6a76fe6-00000001.so: failed to map segment from shared object Unhandled rejection
ERROR 2025-12-06T20:19:48 +0ms service=default e=Failed to initialize OpenTUI render library: Failed to open library "/tmp/.1b7ffdebf6a76fe6-00000001.so": /tmp/.1b7ffdebf6a76fe6-00000001.so: failed to map segment from shared object rejection
ERROR 2025-12-06T20:19:48 +0ms service=default Error: Failed to initialize OpenTUI render library: Failed to open library "/tmp/.1b7ffdebf6a76fe6-00000001.so": /tmp/.1b7ffdebf6a76fe6-00000001.so: failed to map segment from shared object
it would be nice if the tmp directory could be specified or a common directory like ~/.local/share/opencode could be used on systems with standard security hardening.
OpenCode version
1.0.134
Steps to reproduce
sudo snap install bun-js
bun install -g opencode-ai
TMPDIR=~/.opencode/tmp opencode --print-logs --log-level DEBUG
Operating System
> cat /etc/issue Ubuntu 24.04.3 LTS \n \l
Terminal
kitty
This issue might be a duplicate of existing issues. Please check:
- #4743: [FEATURE]: allow /tmp or $TMPDIR folder access option
This is a feature request to allow write access to /tmp or specify a custom TMPDIR, which would address the security hardening issue you're experiencing on Ubuntu. Feel free to ignore if your specific case requires a different solution.
follwing the link of the actions box, I found a fix
BUN_TMPDIR=~/.opencode/tmp opencode --print-logs --log-level DEBUG
I would still wish that opencode would work out of the box