crossbind
GitHub

Remote builds

Each toolchain step of a build (compile, link, bindings, cargo, Conan) normally runs in a pinned Docker image on your machine. With RUNNER=REMOTE those steps run on a runner instead, crossbind cloud or one of your own, and your machine needs no Docker.

When it helps

  • A machine without Docker. The build runs as usual; only its toolchain steps run elsewhere.
  • One build machine for several people. crossbind runner start --host 0.0.0.0 serves the other machines on a network you trust.
  • CI. Environment variables choose the runner per job, with nothing written to ~/.crossbind/config.json.

iOS and macOS builds still compile with Xcode on the Mac under every runner; only their bridge steps go to the web runner. Your JavaScript never leaves the machine.

Apps for Android, Linux and Windows are the exception: crossbind app builds them only in the local Docker, under RUNNER=DOCKER_RUN or DOCKER_EXEC.

crossbind cloud

Sign in with GitHub or Apple, and every toolchain image (web, android, linux and windows) builds on crossbind cloud:

shell
crossbind login
crossbind config set RUNNER REMOTE
crossbind build -p wasm
crossbind usage

crossbind login shows a code to enter on crossbind cloud's device page, crossbind.dev/device, where you sign in with GitHub or Apple. Once you approve the code, the page shows a number to type at the terminal, which gets one try, so crossbind login needs a terminal. Neither GitHub nor Apple is asked for a permission, and GitHub accounts younger than 30 days are refused. The token is kept in ~/.crossbind/credentials.json, readable only by you, and stops working after 90 days unused. The cloud is used only while no runner address is set: setting one, for any image, keeps every image off the cloud.

  • Time. 60 build minutes a month per account, counted from a build's first step until a minute after its last. They reset on the 1st (UTC); crossbind usage shows them by image. An account made by signing in with Apple gets them 30 days after it was made, or as soon as it links a GitHub account on its page.
  • Shared caps. Everyone's build time together is capped per day and per month. When your minutes or a cap run out, steps stop with a message; CROSSBIND_RUNNER=DOCKER_RUN builds in the local Docker instead.
  • Isolation. Each account gets a microVM of its own per image, stopped and wiped a minute after its last step.
  • Network. A cloud runner downloads from crates.io, ConanCenter and GitHub and reaches nothing else, so a Conan recipe whose sources live on another host, or a step that uploads, fails there.
  • Versions. The cloud runs the toolchain images of the current crossbind release; a crossbind that pins other images stops with toolchain mismatch until you upgrade.

The cloud keeps your GitHub id and name or Apple's id for you, when you signed in, your tokens' hashes and how long your runners were up: no email, and none of your sources once a runner stops. crossbind logout revokes this machine's token (--all every machine's), and crossbind account delete --yes deletes the account; see Privacy.

A runner of your own

A runner is the toolchain image your crossbind pins, plus a small server that ships inside the CLI. Start one in the local Docker to try it, or to build for other machines:

shell
crossbind runner start
crossbind config set RUNNER REMOTE
crossbind config set REMOTE_URL_WEB http://127.0.0.1:8787
export CROSSBIND_TOKEN_WEB=<token>
crossbind build -p wasm

runner start prints the next three commands, with its token. It listens on 127.0.0.1; --host 0.0.0.0 opens it to other machines over plain HTTP, so keep it on a network you trust or put TLS in front of it. --role android, linux or windows starts the other images, on ports 8788 to 8790; runner delete removes a runner.

To run one elsewhere, crossbind runner init <platform> writes a deploy folder and prints its steps with a new token:

fly: Fly.io
Writes Dockerfile and fly.toml. One performance-4x machine with 16 GB, stopped when idle.
cloudflare: Cloudflare Containers
Writes Dockerfile, wrangler.jsonc and src/worker.js. A standard-4 container, or 1 to 4 vCPUs with --vcpu; it sleeps a minute after the last step.
cloudrun: Google Cloud Run
Writes env.yaml. 4 vCPU and 8 GiB, one instance, scaled to zero when idle.
azure: Azure Container Apps
Writes containerapp.yaml. 4 vCPU and 8 GiB, one replica, scaled to zero about five minutes after the last request; it wakes slower than the others.

Only the Cloudflare deploy needs the local Docker: wrangler deploy builds the image there. Fly, Cloud Run and Azure start a machine for any request, even one without the token, so keep the address private; the Cloudflare Worker refuses such a request before the container wakes.

How a build picks its runner

RUNNER in ~/.crossbind/config.json decides where every toolchain step runs, and the CROSSBIND_RUNNER environment variable overrides it for one shell or CI job. crossbind.config.js has no runner setting; a project that should always build remotely sets the variables in the script that runs the build.

DOCKER_RUN
The default: a fresh container of the pinned image for each step.
DOCKER_EXEC
In the long-lived container crossbind docker create made.
LOCAL
With the toolchain installed on the machine.
REMOTE
On a runner: the image's own address, else the shared one; with no address set at all, crossbind cloud.

Under REMOTE each toolchain image has its own address: a key of ~/.crossbind/config.json, overridden by the environment variable of the same name with a CROSSBIND_ prefix (CROSSBIND_REMOTE_URL_WEB). Tokens are secrets and never live in the file: each comes only from the variable paired with its address, so one image's token never reaches another image's runner.

AddressTokenSteps it takes
REMOTE_URL_WEBCROSSBIND_TOKEN_WEBwasm and wasi builds, and the bridge steps of every platform but android
REMOTE_URL_ANDROIDCROSSBIND_TOKEN_ANDROIDandroid builds and their bridge steps
REMOTE_URL_LINUXCROSSBIND_TOKEN_LINUXlinux and linuxmusl builds
REMOTE_URL_WINDOWSCROSSBIND_TOKEN_WINDOWSwin32 builds
REMOTE_URLCROSSBIND_TOKENevery image without an address of its own
  • A step whose image has no address stops before anything is sent; it never falls back to the local Docker or to the cloud.
  • A desktop build takes its bridges from the web image, so -p linux needs a web runner and a linux runner.
  • Once per image, the build prints which runner its steps go to and which settings chose it.

For a single build, the environment does the same without touching ~/.crossbind/config.json:

shell
CROSSBIND_RUNNER=REMOTE CROSSBIND_REMOTE_URL_WEB=http://127.0.0.1:8787 CROSSBIND_TOKEN_WEB=<token> crossbind build -p wasm

What travels

Each step is its own request, made only when the build runs that step; a step skipped because nothing changed sends nothing.

  • Up: the folders the step reads under paths.base: native sources and headers, the .crossbind cache, the output folder, the dependencies' prebuilt and header folders, crossbind's assets, and any file the command line names. JavaScript and TypeScript files, .env and .env.*, .npmrc, .yarnrc, .yarnrc.yml, .netrc, node_modules and .git never leave.
  • Once: the runner keeps files by their hash and asks only for what it lacks, so an unchanged file never travels twice, and a cut-off upload resumes.
  • Down: what the step created or changed in the cache and output folders, checked by hash; files it deleted are deleted locally too. Cargo target folders stay on the runner; only the release static libraries come back.

Versions, security and limits

  • A runner serves the toolchain of the crossbind that started or generated it. After upgrading crossbind, run runner delete and runner start again, or rerun runner init and redeploy; until then builds stop with toolchain mismatch.
  • A runner runs any command a token holder sends, with internet access, and keeps what earlier builds left: treat the token like a deploy key, and restart the runner after building something you do not trust.
  • A runner token has at least 16 characters. The client follows no redirect and warns when an address is plain http to another machine.
  • A runner runs one step at a time, so concurrent builds queue. Its disk is a cache: a container started fresh takes its inputs again.
  • C and C++ outputs match a local build byte for byte. Rust archives built on an amd64 runner differ from ones built on arm64: a crate's metadata hash includes the machine that compiled it.

Full reference, with the protocol: remote-runner.md.

Type to search every guide page and section.
↑↓ navigate↵ openesc close