3 # Similar to libcxx/utils/ci/run-buildbot-container, but adds additional options
4 # needed for running Android tests.
8 MONOREPO_ROOT
="$(git rev-parse --show-toplevel)"
9 if [[ ! -d "${MONOREPO_ROOT}/libcxx/utils/ci/vendor/android" ]]; then
10 echo "Was unable to find the root of the LLVM monorepo; are you running from within the monorepo?"
15 DOCKER_OPTIONS
+=(--volume "${MONOREPO_ROOT}:/llvm")
16 DOCKER_OPTIONS
+=(--workdir "/llvm")
17 DOCKER_OPTIONS
+=(--cap-add=SYS_PTRACE
)
19 # Mount this volume to allow the main image to share its copy of the Android
20 # platform tools with the emulator image, ensuring that the adb versions match.
21 # This argument will create a new volume if it doesn't already exist.
22 DOCKER_OPTIONS
+=(--volume android-platform-tools
:/mnt
/android-platform-tools
)
24 # Pass through the Docker socket so that the buildbot can start a sibling
25 # container running an Android emulator.
26 if [ -S /var
/run
/docker.sock
]; then
27 DOCKER_OPTIONS
+=(--volume /var
/run
/docker.sock
:/var
/run
/docker.sock
)
30 docker run
"${DOCKER_OPTIONS[@]}" libcxx-builder-android \
31 bash
-c 'git config --global --add safe.directory /llvm; (/opt/android/container-setup.sh && exec bash)'