File: run-buildbot-container

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.6-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,304 kB
  • sloc: cpp: 7,438,677; ansic: 1,393,822; asm: 1,012,926; python: 241,650; f90: 86,635; objc: 75,479; lisp: 42,144; pascal: 17,286; sh: 10,027; ml: 5,082; perl: 4,730; awk: 3,523; makefile: 3,349; javascript: 2,251; xml: 892; fortran: 672
file content (31 lines) | stat: -rwxr-xr-x 1,507 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env bash

# This script starts a shell in a container running the libc++ build bot Docker
# image. That image emulates the environment used by libc++'s Linux builders on
# BuildKite.
#
# Once you're inside the shell, you can run the various build jobs with the
# `run-buildbot` script.
#
# This script must be run from within the LLVM monorepo. Furthermore, the
# monorepo will be mounted as `/llvm` inside the container. Be careful, the
# state in `/llvm` is shared between the container and the host machine, which
# is useful for editing files on the host machine and re-running the build bot
# in the container.
#
# If you are on Linux you will likely not be able to write to the mount because
# the user in the container doesn't have permissions to do so.
# If you need to do this, give that user permission to do so after running
# the container or add this flag to run the container as your local user IDs:
# --user $(id -u):$(id -g)

set -e

MONOREPO_ROOT="$(git rev-parse --show-toplevel)"
if [[ ! -d "${MONOREPO_ROOT}/libcxx/utils/ci" ]]; then
    echo "Was unable to find the root of the LLVM monorepo; are you running from within the monorepo?"
    exit 1
fi
docker pull ghcr.io/llvm/libcxx-linux-builder:0fd6f684b9c84c32d6cbfd9742402e788b2879f1
docker run -it --volume "${MONOREPO_ROOT}:/llvm" --workdir "/llvm" --cap-add=SYS_PTRACE ghcr.io/llvm/libcxx-linux-builder:0fd6f684b9c84c32d6cbfd9742402e788b2879f1 \
    bash -c 'git config --global --add safe.directory /llvm ; exec bash'