[AMDGPU][True16][MC] update VOP1 dasm test with latest script (#120281)
[llvm-project.git] / .ci / monolithic-windows.sh
blob25cdd2f419f479b2ccff2771d546274e7347a105
1 #!/usr/bin/env bash
2 #===----------------------------------------------------------------------===##
4 # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 # See https://llvm.org/LICENSE.txt for license information.
6 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
8 #===----------------------------------------------------------------------===##
11 # This script performs a monolithic build of the monorepo and runs the tests of
12 # most projects on Windows. This should be replaced by per-project scripts that
13 # run only the relevant tests.
16 set -ex
17 set -o pipefail
19 MONOREPO_ROOT="${MONOREPO_ROOT:="$(git rev-parse --show-toplevel)"}"
20 BUILD_DIR="${BUILD_DIR:=${MONOREPO_ROOT}/build}"
22 rm -rf "${BUILD_DIR}"
24 if [[ -n "${CLEAR_CACHE:-}" ]]; then
25 echo "clearing sccache"
26 rm -rf "$SCCACHE_DIR"
29 sccache --zero-stats
30 function at-exit {
31 mkdir -p artifacts
32 sccache --show-stats >> artifacts/sccache_stats.txt
34 # If building fails there will be no results files.
35 shopt -s nullglob
36 if command -v buildkite-agent 2>&1 >/dev/null
37 then
38 python "${MONOREPO_ROOT}"/.ci/generate_test_report.py ":windows: Windows x64 Test Results" \
39 "windows-x64-test-results" "${BUILD_DIR}"/test-results.*.xml
42 trap at-exit EXIT
44 projects="${1}"
45 targets="${2}"
47 echo "--- cmake"
48 pip install -q -r "${MONOREPO_ROOT}"/mlir/python/requirements.txt
49 pip install -q -r "${MONOREPO_ROOT}"/.ci/requirements.txt
51 # The CMAKE_*_LINKER_FLAGS to disable the manifest come from research
52 # on fixing a build reliability issue on the build server, please
53 # see https://github.com/llvm/llvm-project/pull/82393 and
54 # https://discourse.llvm.org/t/rfc-future-of-windows-pre-commit-ci/76840/40
55 # for further information.
56 # We limit the number of parallel compile jobs to 24 control memory
57 # consumption and improve build reliability.
58 cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
59 -D LLVM_ENABLE_PROJECTS="${projects}" \
60 -G Ninja \
61 -D CMAKE_BUILD_TYPE=Release \
62 -D LLVM_ENABLE_ASSERTIONS=ON \
63 -D LLVM_BUILD_EXAMPLES=ON \
64 -D COMPILER_RT_BUILD_LIBFUZZER=OFF \
65 -D LLVM_LIT_ARGS="-v --xunit-xml-output ${BUILD_DIR}/test-results.xml --use-unique-output-file-name --timeout=1200 --time-tests" \
66 -D COMPILER_RT_BUILD_ORC=OFF \
67 -D CMAKE_C_COMPILER_LAUNCHER=sccache \
68 -D CMAKE_CXX_COMPILER_LAUNCHER=sccache \
69 -D MLIR_ENABLE_BINDINGS_PYTHON=ON \
70 -D CMAKE_EXE_LINKER_FLAGS="/MANIFEST:NO" \
71 -D CMAKE_MODULE_LINKER_FLAGS="/MANIFEST:NO" \
72 -D CMAKE_SHARED_LINKER_FLAGS="/MANIFEST:NO" \
73 -D LLVM_PARALLEL_COMPILE_JOBS=16 \
74 -D LLVM_PARALLEL_LINK_JOBS=4
76 echo "--- ninja"
77 # Targets are not escaped as they are passed as separate arguments.
78 ninja -C "${BUILD_DIR}" -k 0 ${targets}