mirror of
https://github.com/goplus/llgo.git
synced 2026-04-23 00:07:34 +08:00
0ac8485c2e
- Add CACHE HIT/MISS verbose output to build.go - Create test/buildcache with 6 snapshot-based test scenarios: 1. First build (all CACHE MISS) 2. Second build (deps CACHE HIT) 3. Force rebuild with -a (all CACHE MISS) 4. Dependency change invalidates cache 5. Partial cache clear (dep2 only) 6. Partial cache clear (dep2 and dep3) - Tests run for both native and WASM builds (12 tests total) - Add dev/build_iwasm.sh to build iwasm with CI-compatible options - test.sh auto-builds iwasm if not found in llgo cache - All build outputs go to temp directory to keep source clean - Add explicit error checking for all build and run commands - Update CI workflow and local_ci.sh to use test.sh Closes #1526
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.