mirror of
https://github.com/goplus/llgo.git
synced 2026-04-23 00:07:34 +08:00
eb4eee08dc
This fixes issue #1518 where dev/llgo.sh would skip rebuilding with the dev tag when the llgo binary already exists. Now dev/_llgo_setup.sh uses 'go install -tags=dev ./cmd/llgo' instead of 'go install ./cmd/llgo' to ensure the dev build is always used. Generated with [codeagent](https://github.com/qbox/codeagent) Co-authored-by: cpunion <8459+cpunion@users.noreply.github.com>
Dev tooling
This directory contains scripts for running LLGo locally and inside reusable Linux dev containers.
Prerequisites
- Docker installed and running
- Docker Compose v2 (
docker compose, notdocker-compose)
1) Start a Linux container, then run dev/llgo.sh / dev/llgo_wasm.sh
Start an interactive shell (pick one):
./dev/docker.sh amd64
./dev/docker.sh arm64
./dev/docker.sh i386
Notes:
amd64uses thepydepsimage target (includes extra Python demo deps likenumpy/torch).arm64andi386use the smallerbasetarget (no extra Python ML deps).
Inside the container, run tests/builds using the repo scripts:
./dev/llgo.sh test ./...
./dev/llgo.sh test ./test
# WASI/WASM (wasip1/wasm)
./dev/llgo_wasm.sh build ./...
Notes:
dev/docker.shstarts in the same repo subdirectory you launched it from.dev/llgo.shanddev/llgo_wasm.shmust be run from withinLLGO_ROOT(the repo) and will error otherwise.
2) Start a Linux container, run one command, then exit
./dev/docker.sh amd64 bash -lc './dev/llgo.sh test ./test'
3) Run on the host (no container)
From anywhere inside the repo:
./dev/llgo.sh test ./test
./dev/llgo_wasm.sh build ./...
4) Run local CI (covers most checks)
./dev/local_ci.sh
This script creates a temporary workspace, runs formatting/build/tests, runs llgo test, and then runs demo checks.
You can control demo parallelism via LLGO_DEMO_JOBS (defaults to up to 4 jobs).
5) dev/docker.sh (composition-friendly)
dev/docker.sh is a thin wrapper around docker compose:
./dev/docker.sh <arch> [command...]
<arch>must beamd64,arm64, ori386.- If
[command...]is omitted, it starts an interactivebash. - If
[command...]is provided, it runs that command and exits. - You must run it from within the repo (within
LLGO_ROOT), and it will start in the matching repo subdirectory inside the container.