[RISCV] Simplify usage of SplatPat_simm5_plus1. NFC (#125340)
[llvm-project.git] / .ci / monolithic-windows.sh
blob57b276f3e1df057058be5ccc672aa1971503015b
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 retcode=$?
33 mkdir -p artifacts
34 sccache --show-stats >> artifacts/sccache_stats.txt
36 # If building fails there will be no results files.
37 shopt -s nullglob
38 if command -v buildkite-agent 2>&1 >/dev/null
39 then
40 python "${MONOREPO_ROOT}"/.ci/generate_test_report.py ":windows: Windows x64 Test Results" \
41 "windows-x64-test-results" $retcode "${BUILD_DIR}"/test-results.*.xml
44 trap at-exit EXIT
46 projects="${1}"
47 targets="${2}"
49 echo "--- cmake"
50 pip install -q -r "${MONOREPO_ROOT}"/mlir/python/requirements.txt
51 pip install -q -r "${MONOREPO_ROOT}"/.ci/requirements.txt
53 export CC=cl
54 export CXX=cl
55 export LD=link
57 # The CMAKE_*_LINKER_FLAGS to disable the manifest come from research
58 # on fixing a build reliability issue on the build server, please
59 # see https://github.com/llvm/llvm-project/pull/82393 and
60 # https://discourse.llvm.org/t/rfc-future-of-windows-pre-commit-ci/76840/40
61 # for further information.
62 # We limit the number of parallel compile jobs to 24 control memory
63 # consumption and improve build reliability.
64 cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
65 -D LLVM_ENABLE_PROJECTS="${projects}" \
66 -G Ninja \
67 -D CMAKE_BUILD_TYPE=Release \
68 -D LLVM_ENABLE_ASSERTIONS=ON \
69 -D LLVM_BUILD_EXAMPLES=ON \
70 -D COMPILER_RT_BUILD_LIBFUZZER=OFF \
71 -D LLVM_LIT_ARGS="-v --xunit-xml-output ${BUILD_DIR}/test-results.xml --use-unique-output-file-name --timeout=1200 --time-tests" \
72 -D COMPILER_RT_BUILD_ORC=OFF \
73 -D CMAKE_C_COMPILER_LAUNCHER=sccache \
74 -D CMAKE_CXX_COMPILER_LAUNCHER=sccache \
75 -D MLIR_ENABLE_BINDINGS_PYTHON=ON \
76 -D CMAKE_EXE_LINKER_FLAGS="/MANIFEST:NO" \
77 -D CMAKE_MODULE_LINKER_FLAGS="/MANIFEST:NO" \
78 -D CMAKE_SHARED_LINKER_FLAGS="/MANIFEST:NO" \
79 -D LLVM_PARALLEL_COMPILE_JOBS=${MAX_PARALLEL_COMPILE_JOBS} \
80 -D LLVM_PARALLEL_LINK_JOBS=${MAX_PARALLEL_LINK_JOBS}
82 echo "--- ninja"
83 # Targets are not escaped as they are passed as separate arguments.
84 ninja -C "${BUILD_DIR}" -k 0 ${targets}