|
| 1 | +#!/usr/bin/env bash |
| 2 | + |
| 3 | +# This script performs the basic steps needed to test Julia previously |
| 4 | +# built and uploaded as a `.tar.gz`. |
| 5 | +# It requires the following environment variables to be defined: |
| 6 | +# - TRIPLET |
| 7 | +# - USE_RR |
| 8 | +set -euo pipefail |
| 9 | + |
| 10 | +# First, get things like `SHORT_COMMIT`, `JULIA_CPU_TARGET`, `UPLOAD_TARGETS`, etc... |
| 11 | +# shellcheck source=SCRIPTDIR/build_envs.sh |
| 12 | +source .buildkite/utilities/build_envs.sh |
| 13 | + |
| 14 | +echo "--- Print kernel version" |
| 15 | +uname -a |
| 16 | + |
| 17 | +# Usually, we download the build artifacts. However, if we're running inside of the |
| 18 | +# `bughunt` tool, for instance, we may already have a Julia unpacked for us. |
| 19 | +if [[ ! -d "${JULIA_INSTALL_DIR}/bin" ]]; then |
| 20 | + # Note that we pass `--step` to prevent ambiguities between downloading the artifacts |
| 21 | + # uploaded by the `build_*` steps vs. the `upload_*` steps. Normally, testing must occur |
| 22 | + # first, however in the event of a soft-fail test, we can re-run a test after a successful |
| 23 | + # upload has occured. |
| 24 | + echo "--- Download build artifacts" |
| 25 | + buildkite-agent artifact download --step "build_${TRIPLET}" "${UPLOAD_FILENAME}.tar.gz" . |
| 26 | + |
| 27 | + echo "--- Extract build artifacts" |
| 28 | + tar xzf "${UPLOAD_FILENAME}.tar.gz" "${JULIA_INSTALL_DIR}/" |
| 29 | +fi |
| 30 | + |
| 31 | +# If we're on macOS, we need to re-sign the downloaded tarball so it will |
| 32 | +# execute on this machine |
| 33 | +if [[ "${OS}" == "macos" ]]; then |
| 34 | + echo "--- [mac] Codesigning" |
| 35 | + .buildkite/utilities/macos/codesign.sh "${JULIA_INSTALL_DIR}" |
| 36 | + echo "--- [mac] Update checksums for stdlib cachefiles after codesigning" |
| 37 | + JULIA_DEBUG=all "${JULIA_INSTALL_DIR}/bin/julia" .buildkite/utilities/update_stdlib_pkgimage_checksums.jl |
| 38 | +fi |
| 39 | + |
| 40 | +echo "--- Print Julia version info" |
| 41 | +${JULIA_BINARY} -e 'using InteractiveUtils; InteractiveUtils.versioninfo()' |
| 42 | + |
| 43 | +echo "--- Set some environment variables" |
| 44 | +# Prevent OpenBLAS from spinning up a large number of threads on our big machines |
| 45 | +export OPENBLAS_NUM_THREADS="${JULIA_CPU_THREADS}" |
| 46 | +export JULIA_TEST_IS_BASE_CI="true" |
| 47 | +unset JULIA_DEPOT_PATH |
| 48 | +unset JULIA_PKG_SERVER |
| 49 | + |
| 50 | +echo "--- Run trimming tests" |
| 51 | +${MAKE} --output-sync -j"${JULIA_CPU_THREADS:?}" -C test/trimming check JULIA="${JULIA_BINARY:?}" BIN="$(dirname "${JULIA_BINARY:?}")" |
0 commit comments