Feature hasn't been suggested before.
Describe the enhancement you want to request
Problem
The build script (script/build.ts) only supports --single to build for the current platform. Cross-compiling for a different platform (e.g. building linux-arm64 from macOS) requires either building all 14 targets or editing the source file to narrow allTargets.
Proposed approach
charlesverge#1
Make --single accept an optional value like --single linux-arm64 or --single win32. Without an argument it keeps the existing behavior (current platform). The value is parsed as <os>[-<arch>[-<variant>]] and matched against the target definitions.
Valid examples:
| Command |
Builds |
--single |
current platform, native variant |
--single linux-arm64 |
Linux ARM64 (glibc) |
--single linux-arm64-musl |
Linux ARM64 (musl) |
--single linux-x64 |
Linux x64 (glibc) |
--single linux-x64-musl |
Linux x64 (musl) |
--single linux-x64-baseline |
Linux x64 baseline/SSE |
--single linux-x64-musl-baseline |
Linux x64 musl baseline |
--single darwin |
all macOS variants |
--single win32 |
all Windows variants |
The implementation adds ~30 lines of matching logic to packages/opencode/script/build.ts and a usage comment at the top of the file.
Why it belongs in OpenCode
Developers who need to test platform-specific builds or deploy to remote machines (Linux ARM64 servers, etc.) currently have no ergonomic way to build a single cross-compiled target. This is a small change to the existing build entrypoint with no effect on CI or release workflows.
Feature hasn't been suggested before.
Describe the enhancement you want to request
Problem
The build script (
script/build.ts) only supports--singleto build for the current platform. Cross-compiling for a different platform (e.g. buildinglinux-arm64from macOS) requires either building all 14 targets or editing the source file to narrowallTargets.Proposed approach
charlesverge#1
Make
--singleaccept an optional value like--single linux-arm64or--single win32. Without an argument it keeps the existing behavior (current platform). The value is parsed as<os>[-<arch>[-<variant>]]and matched against the target definitions.Valid examples:
--single--single linux-arm64--single linux-arm64-musl--single linux-x64--single linux-x64-musl--single linux-x64-baseline--single linux-x64-musl-baseline--single darwin--single win32The implementation adds ~30 lines of matching logic to
packages/opencode/script/build.tsand a usage comment at the top of the file.Why it belongs in OpenCode
Developers who need to test platform-specific builds or deploy to remote machines (Linux ARM64 servers, etc.) currently have no ergonomic way to build a single cross-compiled target. This is a small change to the existing build entrypoint with no effect on CI or release workflows.