From 428fae33e94a12d40fcbc961e460c930f8f9ebab Mon Sep 17 00:00:00 2001 From: Mikhail Goncharov Date: Mon, 11 Sep 2023 11:59:39 +0200 Subject: [PATCH] update buildkite pipeline generation - fixed build for linux (clang was missing) - removed /monolithic-.. from build directory - it does not add anything and makes path longer for windows which is not great; - added env-based configuration to control cache and agent targeting; - print (s)ccache stats to file not to pullute normal log. --- .ci/generate-buildkite-pipeline-premerge | 8 ++-- .ci/generate-buildkite-pipeline-scheduled | 46 ++++++++++++++--------- .ci/monolithic-linux.sh | 13 +++++-- .ci/monolithic-windows.sh | 12 ++++-- 4 files changed, 51 insertions(+), 28 deletions(-) diff --git a/.ci/generate-buildkite-pipeline-premerge b/.ci/generate-buildkite-pipeline-premerge index c0071dcc7f312..7d14aed355d42 100755 --- a/.ci/generate-buildkite-pipeline-premerge +++ b/.ci/generate-buildkite-pipeline-premerge @@ -239,8 +239,8 @@ if [[ "${linux_projects}" != "" ]]; then - label: ':linux: Linux x64' artifact_paths: - artifacts/**/* - - '*_result.json' - - 'build/monolithic-linux/test-results.xml' + - *_result.json + - build/test-results.xml agents: ${LINUX_AGENTS} retry: automatic: @@ -262,8 +262,8 @@ if [[ "${windows_projects}" != "" ]]; then - label: ':windows: Windows x64' artifact_paths: - artifacts/**/* - - '*_result.json' - - 'build/monolithic-windows/test-results.xml' + - *_result.json + - build/test-results.xml agents: ${WINDOWS_AGENTS} retry: automatic: diff --git a/.ci/generate-buildkite-pipeline-scheduled b/.ci/generate-buildkite-pipeline-scheduled index 06607ce617941..6ad26aeb6e385 100755 --- a/.ci/generate-buildkite-pipeline-scheduled +++ b/.ci/generate-buildkite-pipeline-scheduled @@ -14,6 +14,18 @@ # See https://buildkite.com/docs/agent/v3/cli-pipeline#pipeline-format. # +set -eu +set -o pipefail + +# Filter rules for generic windows tests +: ${WINDOWS_AGENTS:='{"queue": "windows"}'} +# Filter rules for generic linux tests +: ${LINUX_AGENTS:='{"queue": "linux"}'} +# Set by buildkite +: ${BUILDKITE_MESSAGE:=} +: ${BUILDKITE_COMMIT:=} +: ${BUILDKITE_BRANCH:=} + cat < artifacts/ccache_stats.txt } trap show-stats EXIT diff --git a/.ci/monolithic-windows.sh b/.ci/monolithic-windows.sh index da15f7c192390..83be9d04b9927 100755 --- a/.ci/monolithic-windows.sh +++ b/.ci/monolithic-windows.sh @@ -17,13 +17,19 @@ set -ex set -o pipefail MONOREPO_ROOT="${MONOREPO_ROOT:="$(git rev-parse --show-toplevel)"}" -BUILD_DIR="${BUILD_DIR:=${MONOREPO_ROOT}/build/monolithic-windows}" +BUILD_DIR="${BUILD_DIR:=${MONOREPO_ROOT}/build}" rm -rf ${BUILD_DIR} +if [[ -n "${CLEAR_CACHE:-}" ]]; then + echo "clearing sccache" + rm -rf "$SCCACHE_DIR" +fi + sccache --zero-stats function show-stats { - sccache --show-stats + mkdir -p artifacts + sccache --show-stats >> artifacts/sccache_stats.txt } trap show-stats EXIT @@ -45,4 +51,4 @@ cmake -S ${MONOREPO_ROOT}/llvm -B ${BUILD_DIR} \ -D CMAKE_CXX_COMPILER_LAUNCHER=sccache echo "--- ninja" -ninja -C ${BUILD_DIR} ${targets} +ninja -C "${BUILD_DIR}" "${targets}"