Skip to content

feat(opencode): added portable static builds#9

Closed
goniz wants to merge 1 commit intodevfrom
feature/portable-musl-dist
Closed

feat(opencode): added portable static builds#9
goniz wants to merge 1 commit intodevfrom
feature/portable-musl-dist

Conversation

@goniz
Copy link
Owner

@goniz goniz commented Jan 29, 2026

  • Portable builds are multi arch, supporting linux-x64 and linux-aarch64
  • build-portable.ts is replacing the existing musl binaries with their static variants
  • Files in dist/ retain their name "opencode-linux-*-musl"
  • install script updated to parse the system's glibc version in order to select the static musl variant even on non-alpine distros
  • build using: bun run build && bun run build:portable
  • build requires docker to be installed

What does this PR do?

How did you verify your code works?

- Portable builds are multi arch, supporting linux-x64 and linux-aarch64
- `build-portable.ts` is replacing the existing musl binaries with their static variants
- Files in dist/ retain their name "opencode-linux-*-musl"
- `install` script updated to parse the system's glibc version in order to select the static musl variant even on non-alpine distros
- build using: `bun run build && bun run build:portable`
- build requires `docker` to be installed
@github-actions
Copy link

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fa0cb0438a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +38 to +40
if (!Bun.file(`dist/${item.artifact}/bin/opencode`).exists()) {
console.error(`Artifact dist/${item.artifact}/bin/opencode does not exist. Please build it first.`)
process.exit(1)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Await Bun.file().exists() before checking artifacts

Bun.file(...).exists() is async (see other usages in this repo that all await it), so the current if (!Bun.file(...).exists()) always evaluates to false because the Promise is truthy. That means missing artifacts won’t be detected and the script will proceed to run file/docker build, failing later with less actionable errors. Use await Bun.file(...).exists() so the early exit actually works when the artifact is absent.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments