Skip to content

chepe263/claw-code-compile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

claw-code-compile

Dockerized cross-compilation setup for:

  • Source repo: https://github.com/ultraworkers/claw-code
  • Targets: Linux, Windows, and macOS
  • Build cache acceleration via bind-mounted Rust artifacts (cache/ and target-cache/)

What this adds

  • docker/Dockerfile: build image with Rust + Zig + cargo-zigbuild
  • docker-compose.yml: one-shot build service with cache/artifact bind mounts
  • scripts/build-all.sh: clones/updates source and builds all requested targets

Quick start

From this repository root:

docker compose build claw-builder
docker compose run --rm claw-builder

Artifacts

Compiled binaries are copied to:

artifacts/
	x86_64-unknown-linux-gnu/
	x86_64-pc-windows-gnu/
	x86_64-apple-darwin/

Why this is faster on repeated builds

The compose service bind mounts these host directories:

  • ./cache/cargo-registry for Cargo registry cache
  • ./cache/cargo-git for Cargo git cache
  • ./cache/rustup for rustup toolchains/targets
  • ./target-cache for Cargo target output

That means subsequent builds reuse downloaded crates and previously compiled artifacts.

Tunable environment variables

Defined in docker-compose.yml and overridable per run:

  • REPO_URL (default: ultraworkers claw-code repo)
  • REPO_BRANCH (default: master)
  • REPO_DIR (default: /workspace/src/claw-code)
  • ARTIFACTS_DIR (default: /workspace/artifacts)

Example override:

REPO_BRANCH=main docker compose run --rm claw-builder

Notes

  • Linux target is built with cargo build; Windows and macOS targets are built with cargo zigbuild.
  • macOS cross-linking may emit SDK lookup warnings when Xcode SDKs are unavailable; in this workflow, builds still completed and produced binaries.
  • First run is expected to be slower because dependencies and toolchains are downloaded.

Runtime setup: Ollama on Windows

If you run the built binaries against Ollama instead of Anthropic Claude, use these environment variables:

OPENAI_BASE_URL=htps://ollama.com/v1
ANTHROPIC_BASE_URL=http://localhost:11434
ANTHROPIC_API_KEY=

ANTHROPIC_API_KEY is intentionally empty.

Windows CMD (temporary for current shell)

set "OPENAI_BASE_URL=htps://ollama.com/v1"
set "ANTHROPIC_BASE_URL=http://localhost:11434"
set "ANTHROPIC_API_KEY="
claw.exe

Windows batch file (variables only for that run)

@echo off
setlocal
set "OPENAI_BASE_URL=htps://ollama.com/v1"
set "ANTHROPIC_BASE_URL=http://localhost:11434"
set "ANTHROPIC_API_KEY="
claw.exe
endlocal

PowerShell (temporary for current session/script)

$env:OPENAI_BASE_URL = "htps://ollama.com/v1"
$env:ANTHROPIC_BASE_URL = "http://localhost:11434"
$env:ANTHROPIC_API_KEY = ""
./claw.exe

These commands avoid setting permanent user-level variables.

About

compile the claw code repo

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors