javybin

package
v0.2.17 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 27, 2026 License: MPL-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package javybin resolves a `javy` CLI binary matching the Javy version the vendored QuickJS plugin was emitted from (chassis/compute/javyplugin). The op build path (chassis/cli/op) needs javy to compile JS/TS nano-ops to wasm, but we don't want users to install it by hand — so Resolve transparently downloads the pinned release into the txco home on first use and caches it.

Resolution order (first hit wins):

  1. $TXCO_JAVY — an explicit binary path the operator chose; trusted as-is.
  2. A `javy` already on PATH whose `--version` matches the pin — respected so we never download when a correct toolchain is already present.
  3. A previously downloaded managed binary under <txco-home>/tools/.
  4. A freshly downloaded release, checksum-verified against its .sha256.

The managed binary is version-stamped in its filename, so a Javy bump (new pin) lands a new file rather than silently reusing an incompatible one.

Index

Constants

Version is the Javy toolchain Resolve targets — pinned to the vendored plugin so built modules' bytecode always matches what the runtime links.

Variables

View Source
var ErrUnavailable = errors.New("javy unavailable")

ErrUnavailable wraps every terminal failure to obtain javy (unsupported platform, offline with no cached/PATH binary, checksum mismatch). Callers classify it distinctly from a genuine compile error — e.g. the demo server surfaces it as "compile_unavailable" with an install hint.

Functions

func Resolve

func Resolve(ctx context.Context, progress io.Writer) (string, error)

Resolve returns the path to a usable javy binary at the pinned Version, downloading and caching it if necessary. progress (may be nil) receives one-time human-readable status lines for the download. Safe for concurrent use; a successful result is memoized for the process.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL