blob: 5d975ebfc4f4eb75ea858eb5489dab7927ad5b4e [file] [log] [blame]
Louis Dionne06dbe822021-03-02 12:59:29 -05001#!/usr/bin/env bash
2
3# This script starts a shell in a container running the libc++ build bot Docker
4# image. That image emulates the environment used by libc++'s Linux builders on
5# BuildKite.
6#
7# Once you're inside the shell, you can run the various build jobs with the
8# `run-buildbot` script.
9#
10# This script must be run from within the LLVM monorepo. Furthermore, the
11# monorepo will be mounted as `/llvm` inside the container. Be careful, the
12# state in `/llvm` is shared between the container and the host machine, which
13# is useful for editing files on the host machine and re-running the build bot
14# in the container.
David Spickett783de8d2021-10-05 10:13:35 +010015#
16# If you are on Linux you will likely not be able to write to the mount because
17# 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 running
19# the container or add this flag to run the container as your local user IDs:
20# --user $(id -u):$(id -g)
Louis Dionne06dbe822021-03-02 12:59:29 -050021
22set -e
23
24MONOREPO_ROOT="$(git rev-parse --show-toplevel)"
25if [[ ! -d "${MONOREPO_ROOT}/libcxx/utils/ci" ]]; then
26 echo "Was unable to find the root of the LLVM monorepo; are you running from within the monorepo?"
27 exit 1
28fi
29docker pull ldionne/libcxx-builder
David Spickett783de8d2021-10-05 10:13:35 +010030docker run -it --volume "${MONOREPO_ROOT}:/llvm" --workdir "/llvm" --cap-add=SYS_PTRACE ldionne/libcxx-builder bash