Run opencode (the official Bun-compiled
opencode-ai binary) on macOS 11 Big Sur.
The stock binary targets minos 13.0, so it refuses to launch on Big Sur. Two
things break once you get it loading:
- ICU. The binary links
/usr/lib/libicucore.A.dylib. Big Sur ships ICU 66, which is missing 11 symbols the binary needs (ubrk_clone, theunumrf_*range formatters,udtitvfmt_formatCalendarToResult,uplrules_selectForRange,ucal_getTimeZoneOffsetFromLocal). - SQLite. opencode's SQL uses
RETURNING(SQLite >= 3.35) andjsonb(>= 3.45). Big Sur's system SQLite is 3.32, so session creation fails withSQLiteError: near "returning": syntax error. Bundlopenslibsqlite3.dylibby leaf name, so a newer copy on the dyld fallback path wins.
This repo builds a small ICU shim and a modern SQLite dylib, rewrites the binary to use them, and installs everything for the current user.
Verified on: macOS 11.7.10, MacBookAir6,2 (dual-core i5, 8 GB), opencode 1.19.3
(--version, models, chat, and tool calls all pass).
build.sh– buildslibicu.dylib(re-exports the SDK's ICU + defines the 11 missing symbols) and patches/re-signs the opencode binary.build-sqlite.sh– downloads and compiles a modernlibsqlite3.dylib.install.sh– installs the built artifacts for the current user.ubrk_shim.c– the ICU compatibility shim source.
Run the build on a Mac with an Xcode/CLT macOS 11 SDK (a newer Mac is fine; the target machine does not need a compiler):
# 1. get the raw darwin-x64 binary (postinstall won't run it, which is good,
# since it can't execute on a pre-13 machine either)
npm pack opencode-darwin-x64@1.19.3
tar xzf opencode-darwin-x64-1.19.3.tgz
# 2. build (pass the raw binary; default is your global opencode-ai install)
./build.sh package/bin/opencode
./build-sqlite.shCopy dist/ to the Big Sur machine and install:
./install.sh # on the Big Sur Mac; writes to ~/opencode and ~/libThen open a new Terminal and run opencode.
If the SDK isn't at the default path, override it:
SDK=/path/to/MacOSX11.sdk ./build.sh /path/to/opencode- Do not run
opencode upgradeon the Big Sur build. It replaces the patched binary with the officialminos 13build, which will not launch. To update, re-runbuild.shagainst the newopencode-darwin-x64package. - The
install.shPATH line is added to~/.zshrc. - This targets the terminal TUI. The Electron desktop app will not run on
Big Sur (same
minosfloor, and it would be very slow on 2013-2014 Intel Macs anyway).