bash packages/opencode/script/upgrade.shFlags: --dry-run (preview changes), --no-build (commit but skip nix build).
- Fetches
upstream/dev - Updates
package.jsonpackageManagerto match upstream's bun version - If nixpkgs' bun < upstream's bun, relaxes the version check in
packages/script/src/index.tsfrom^<version>to^1 - Commits with
chore: upgrade to upstream <commit> (bun@<version>) - Builds via
nix run .#opencode -- --version
export SSH_AUTH_SOCK="$HOME/.ssh/ssh_auth_sock"
git fetch upstream dev
git merge upstream/dev --no-ff -m "chore: merge upstream dev <commit>"Use --no-ff because the fork has its own commits (upgrade script, hash fixes) that diverge from upstream.
If the build fails with a hash mismatch for node_modules, update nix/hashes.json:
{
"nodeModules": {
"x86_64-linux": "<new hash from build error>",
...
}
}The correct hash appears in the nix build error output as got: sha256-....
nix run .#opencode -- --versionSSH agent is at ~/.ssh/ssh_auth_sock (stable symlink from sshd rc). Set SSH_AUTH_SOCK before any git operations.
Commits require -c user.signingkey= to bypass SSH-based GPG signing (the local key isn't available in the agent).
The .qwen/ directory is untracked and makes git status --porcelain non-empty. Use git status --porcelain -u no to ignore untracked files.
nixpkgs-unstable ships bun@1.3.13; upstream's packageManager is bun@1.3.14. The version check in packages/script/src/index.ts must be relaxed to ^1 so the nix build doesn't fail. The upgrade script handles this automatically.
The nix build needs ~2GB free. If the build fails with "No space left on device", run nix-collect-garbage -d first.