Skip to content

opencode, bun: new packages - #5639

Draft
aprozo wants to merge 2 commits into
spack:developfrom
aprozo:add-opencode
Draft

opencode, bun: new packages#5639
aprozo wants to merge 2 commits into
spack:developfrom
aprozo:add-opencode

Conversation

@aprozo

@aprozo aprozo commented Jul 17, 2026

Copy link
Copy Markdown

Adds opencode (anomalyco/opencode), an open-source AI coding agent CLI — useful on headless systems (farm nodes, CI debugging) where a graphical client is not available — together with the bun package it needs to build.

Built from the tagged source archive. opencode is a bun workspace: the lockfile is bun.lock, dependencies use bun's catalog: / workspace: protocols plus patchedDependencies, and the build is Bun.build({ compile: ... }), which links the sources against the bun runtime into a single executable — so npm cannot drive it. The build steps follow the nixpkgs derivation: bun install over the workspaces the CLI pulls in, then bun --bun ./script/build.ts --single --skip-install in packages/opencode.

bun itself is installed from the upstream release archives, in the same shape as the existing deno package: bun is Zig plus a patched JavaScriptCore and needs an existing bun to bootstrap. It is a separate commit and can be split into its own PR if preferred.

Dependencies, each confirmed by shimming the tool out of PATH and re-running the build: bun and node-js at build time (the embedded web UI is built with vite, which runs on node), ripgrep at run time (otherwise opencode downloads an rg binary into the user cache at first use). git and npm are not needed.

Verified on linux-x86_64: clean spack install opencodebin/opencode, opencode --version reports 1.18.3. Companion to #5637; also exercised in the EIC eic-shell stack (eic/eic-spack#986).

@spackbot-triage spackbot-triage Bot added new-package Additions of new packages to the Spack ecosystem new-version Modifications to packages' `depends_on()` directives maintainers Modifications to a package's `maintainers()` directive licenses Modifications to a package's `license()` directive labels Jul 17, 2026
@alecbcs

alecbcs commented Jul 17, 2026

Copy link
Copy Markdown
Member

@aprozo instead of installing opencode from the binary releases we should look at building it from source archives.

An example package that should be pretty close to this one is pi/package.py.

@aprozo

aprozo commented Jul 17, 2026

Copy link
Copy Markdown
Author

Thanks a lot, @alecbcs , will do!

@spackbot-triage spackbot-triage Bot added the dependencies Modifications with a `depends_on()` directive label Jul 28, 2026
aprozo added a commit to eic/eic-spack that referenced this pull request Jul 28, 2026
Build dependency of opencode: its lockfile, catalog:/workspace: dependency
protocols and single-file-executable build are bun-specific. Mirrors the
package proposed upstream in spack/spack-packages#5639; drop this copy once
that lands.
aprozo added a commit to eic/eic-spack that referenced this pull request Jul 28, 2026
Upstream review of spack/spack-packages#5639 asked for a source build rather
than the per-platform GitHub release binaries. Build the tagged source
archive with bun (bun install + Bun.build compile), the way nixpkgs does.
@aprozo aprozo changed the title opencode: new package opencode, bun: new packages Jul 28, 2026
@aprozo

aprozo commented Jul 28, 2026

Copy link
Copy Markdown
Author

@alecbcs, done but had to add bun as well

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

Labels

dependencies Modifications with a `depends_on()` directive licenses Modifications to a package's `license()` directive maintainers Modifications to a package's `maintainers()` directive new-package Additions of new packages to the Spack ecosystem new-version Modifications to packages' `depends_on()` directives

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants