32 lines · plain
1#!/usr/bin/env bash2 3# This script starts a shell in a container running the libc++ build bot Docker4# image. That image emulates the environment used by libc++'s Linux builders on5# BuildKite.6#7# Once you're inside the shell, you can run the various build jobs with the8# `run-buildbot` script.9#10# This script must be run from within the LLVM monorepo. Furthermore, the11# monorepo will be mounted as `/llvm` inside the container. Be careful, the12# state in `/llvm` is shared between the container and the host machine, which13# is useful for editing files on the host machine and re-running the build bot14# in the container.15#16# If you are on Linux you will likely not be able to write to the mount because17# the user in the container doesn't have permissions to do so.18# If you need to do this, give that user permission to do so after running19# the container or add this flag to run the container as your local user IDs:20# --user $(id -u):$(id -g)21 22set -e23 24MONOREPO_ROOT="$(git rev-parse --show-toplevel)"25if [[ ! -d "${MONOREPO_ROOT}/libcxx/utils/ci" ]]; then26 echo "Was unable to find the root of the LLVM monorepo; are you running from within the monorepo?"27 exit 128fi29docker pull ghcr.io/llvm/libcxx-linux-builder:d6b22a347f813cf4a9832627323a43074f57bbcf30docker run -it --volume "${MONOREPO_ROOT}:/llvm" --workdir "/llvm" --cap-add=SYS_PTRACE ghcr.io/llvm/libcxx-linux-builder:d6b22a347f813cf4a9832627323a43074f57bbcf \31 bash -c 'git config --global --add safe.directory /llvm ; exec bash'32