[memprof] Use a new constructor of IndexedAllocationInfo (NFC) (#116920)
[llvm-project.git] / .ci / monolithic-windows.sh
blob4ead122212f4f04be414e20b0a2f0c34e4f4a6ea
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 python "${MONOREPO_ROOT}"/.ci/generate_test_report.py ":windows: Windows x64 Test Results" \
37 "windows-x64-test-results" "${BUILD_DIR}"/test-results.*.xml
39 trap at-exit EXIT
41 projects="${1}"
42 targets="${2}"
44 echo "--- cmake"
45 pip install -q -r "${MONOREPO_ROOT}"/mlir/python/requirements.txt
46 pip install -q -r "${MONOREPO_ROOT}"/.ci/requirements.txt
48 # The CMAKE_*_LINKER_FLAGS to disable the manifest come from research
49 # on fixing a build reliability issue on the build server, please
50 # see https://github.com/llvm/llvm-project/pull/82393 and
51 # https://discourse.llvm.org/t/rfc-future-of-windows-pre-commit-ci/76840/40
52 # for further information.
53 # We limit the number of parallel compile jobs to 24 control memory
54 # consumption and improve build reliability.
55 cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
56 -D LLVM_ENABLE_PROJECTS="${projects}" \
57 -G Ninja \
58 -D CMAKE_BUILD_TYPE=Release \
59 -D LLVM_ENABLE_ASSERTIONS=ON \
60 -D LLVM_BUILD_EXAMPLES=ON \
61 -D COMPILER_RT_BUILD_LIBFUZZER=OFF \
62 -D LLVM_LIT_ARGS="-v --xunit-xml-output ${BUILD_DIR}/test-results.xml --use-unique-output-file-name --timeout=1200 --time-tests" \
63 -D COMPILER_RT_BUILD_ORC=OFF \
64 -D CMAKE_C_COMPILER_LAUNCHER=sccache \
65 -D CMAKE_CXX_COMPILER_LAUNCHER=sccache \
66 -D MLIR_ENABLE_BINDINGS_PYTHON=ON \
67 -D CMAKE_EXE_LINKER_FLAGS="/MANIFEST:NO" \
68 -D CMAKE_MODULE_LINKER_FLAGS="/MANIFEST:NO" \
69 -D CMAKE_SHARED_LINKER_FLAGS="/MANIFEST:NO" \
70 -D LLVM_PARALLEL_COMPILE_JOBS=16 \
71 -D LLVM_PARALLEL_LINK_JOBS=4
73 echo "--- ninja"
74 # Targets are not escaped as they are passed as separate arguments.
75 ninja -C "${BUILD_DIR}" -k 0 ${targets}