1#!/bin/bash -eux 2# Verifies mixed builds succeeds when building "libc". 3# This verification script is designed to be used for continuous integration 4# tests, though may also be used for manual developer verification. 5 6if [[ -z ${DIST_DIR+x} ]]; then 7 echo "DIST_DIR not set. Using out/dist. This should only be used for manual developer testing." 8 DIST_DIR="out/dist" 9fi 10 11# Run a mixed build of "libc" 12build/soong/soong_ui.bash --make-mode USE_BAZEL_ANALYSIS=1 BAZEL_STARTUP_ARGS="--max_idle_secs=5" BAZEL_BUILD_ARGS="--color=no --curses=no --show_progress_rate_limit=5" TARGET_PRODUCT=aosp_arm64 TARGET_BUILD_VARIANT=userdebug libc dist DIST_DIR=$DIST_DIR 13 14# Verify there are artifacts under the out directory that originated from bazel. 15echo "Verifying OUT_DIR contains bazel-out..." 16if find out/ | grep bazel-out &>/dev/null; then 17 echo "bazel-out found." 18else 19 echo "bazel-out not found. This may indicate that mixed builds are silently not running." 20 exit 1 21fi 22 23# Run a mixed build of "libbacktrace" 24# This is a small module which uses propagated includes from libc; thus will 25# fail if includes are not propagated appropriately from bazel-built libc. 26build/soong/soong_ui.bash --make-mode USE_BAZEL_ANALYSIS=1 BAZEL_STARTUP_ARGS="--max_idle_secs=5" BAZEL_BUILD_ARGS="--color=no --curses=no --show_progress_rate_limit=5" TARGET_PRODUCT=aosp_arm64 TARGET_BUILD_VARIANT=userdebug libbacktrace dist DIST_DIR=$DIST_DIR 27