This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This repository is part of the Compiler Explorer project. It builds Docker images used to create binary packages for various compilers and tools that are more difficult to build or have special requirements. These built tools are then used on the Compiler Explorer website.
The repository follows a consistent pattern:
- Each tool/compiler has its own
Dockerfile.{toolname}(e.g.,Dockerfile.nix,Dockerfile.misc) - Each tool has a corresponding directory with build scripts (e.g.,
nix/build.sh,misc/build-*.sh) - All build scripts use
common.shfor shared functionality - GitHub Actions builds and pushes Docker images to Docker Hub as
compilerexplorer/{toolname}-builder:latest
# Build a Docker image for a specific tool (replace 'nix' with desired tool)
docker build -t builder -f Dockerfile.nix .
# Run a build script (example for nix); mounting `/tmp/out` as /build in the container, and outputting there
docker run --rm -v/tmp/out:/build builder ./build.sh 2.29.0 /build
# For debugging - start an interactive shell
docker run -it --rm builder bashMost build scripts follow this pattern:
./build.sh <version> <output-directory> [optional-last-revision]version: The version/tag/branch to buildoutput-directory: Where to place the resulting tar.xz fileoptional-last-revision: Previous revision (for skip detection)
-
Build scripts output metadata:
ce-build-revision:- The revision being builtce-build-output:- Output file pathce-build-status:- OK, SKIPPED, or error
-
The
common.shprovides:initialise: Sets up build, checks if already builtcomplete: Creates the final tar.xz archiveget_remote_revision: Gets git revision from remote
-
Output format:
{toolname}-{version}.tar.xzcontaining the built binaries
- Create
Dockerfile.{toolname}based on existing patterns - Create
{toolname}/build.shscript - Add the new tool to
.github/workflows/build.ymlmatrix - Ensure build script is executable:
chmod +x {toolname}/build.sh
- The
miscDockerfile contains multiple unrelated tools (legacy structure being split up) - Some tools like
heaptrackhave both x86_64 and arm64 builds - Build outputs are tar.xz archives with XZ compression using all available threads