Skip to content

opencode: vendor a bun-version-matched bun.lock + restore --frozen-lockfile (reproducible deps) #302

Description

@bryan-minimal

Context

#298 dropped --frozen-lockfile from packages/opencode/build.sh to unblock a rebuild: minimal's shipped bun (1.3.x) resolves opencode's upstream-committed lockfile differently and rejected it (lockfile had changes, but lockfile is frozen). That was the right call to unblock, but it trades dependency-version reproducibility — bun now floats the lockfile, so two builds of the same opencode version can resolve different transitive deps. (The install already network-fetches deps, so the build isn't hermetic either way.)

Proper fix

Restore deterministic resolution by vendoring a bun.lock regenerated with minimal's bun, and reinstating --frozen-lockfile against it:

  1. With minimal's shipped bun, run bun install on the pinned opencode version to generate a matching bun.lock.
  2. Vendor it in packages/opencode/ (or have build.sh overwrite the upstream tarball's lockfile with it before the frozen install).
  3. Re-add --frozen-lockfile so a future build fails loudly if resolution drifts, instead of silently floating.
  4. Refresh the vendored lockfile whenever opencode's version or the shipped bun is bumped — a step the auto-updater should own (relates to the generated-.ncl validation theme in gominimal/pkgmgr-rs#389).

Why it matters

Floating deps is a supply-chain surface (an upstream transitive dep can change under us between builds) and makes opencode's artifact non-reproducible — exactly the property the signed-index / provenance work (build-servers#86, inbox#37) wants to be able to assert.

Related (separate)

The same build-time-network fragility bit cabal in the same #298 rebuild — its bootstrap live-fetches from http://hackage.haskell.org with a 10s timeout and timed out (transient). Vendoring those bootstrap tarballs (alex/happy/…) into the source mirror is the analogous fix; worth its own issue if it recurs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions