xref: /aosp_15_r20/external/cronet/third_party/libc++/src/utils/ci/buildkite-pipeline-clang.yml (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1#===----------------------------------------------------------------------===##
2#
3# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4# See https://llvm.org/LICENSE.txt for license information.
5# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6#
7#===----------------------------------------------------------------------===##
8
9#
10# This file describes the various pre-commit CI bots used to test Clang against
11# libc++ under various configurations. Unlike the usual libc++ CI pipeline,
12# which aims to test libc++ itself, this pipeline aims to test Clang by
13# compiling libc++ and running its test suite against the just-built Clang,
14# in various configurations.
15#
16env:
17    # LLVM RELEASE bump version
18    LLVM_HEAD_VERSION: "17"
19steps:
20  - label: "Format"
21    commands:
22      - "! grep -rnI '[[:blank:]]$' clang/lib clang/include clang/docs || false"
23
24    agents:
25      queue: "libcxx-builders"
26      os: "linux"
27    retry:
28      automatic:
29        - exit_status: -1  # Agent was lost
30          limit: 2
31    timeout_in_minutes: 120
32
33  - wait
34
35  - label: "Building clang"
36    commands:
37      - "mkdir install"
38      # We use Release here to avoid including debug information. Otherwise, the clang binary is very large, which
39      # is problematic because we need to upload the artifacts for other jobs to use. This may seem like nothing,
40      # but with the number of jobs we run daily, this can result in thousands of GB of network I/O.
41      - "cmake -S llvm -B build -G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=\"ccache\" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install -DLLVM_ENABLE_PROJECTS=\"clang;compiler-rt\""
42      - "ninja -C build install-clang install-clang-resource-headers"
43      - "ccache -s"
44      - "tar -cJvf install.tar.xz install/"
45      - "buildkite-agent artifact upload --debug install.tar.xz"
46    env:
47        CC: "clang-${LLVM_HEAD_VERSION}"
48        CXX: "clang++-${LLVM_HEAD_VERSION}"
49    agents:
50      queue: "libcxx-builders"
51      os: "linux"
52    retry:
53      automatic:
54        - exit_status: -1  # Agent was lost
55          limit: 2
56    timeout_in_minutes: 120
57
58  - wait
59
60  - label: "C++03"
61    commands:
62      - "buildkite-agent artifact download install.tar.xz ."
63      - "tar -xvf install.tar.xz"
64      - "export CC=$(pwd)/install/bin/clang"
65      - "export CXX=$(pwd)/install/bin/clang++"
66      - "chmod +x install/bin/clang install/bin/clang++"
67      - "libcxx/utils/ci/run-buildbot generic-cxx03"
68    artifact_paths:
69      - "**/test-results.xml"
70      - "**/crash_diagnostics/*"
71    env:
72        LLVM_SYMBOLIZER_PATH: "/usr/bin/llvm-symbolizer-${LLVM_HEAD_VERSION}" # TODO: Should we build that from scratch?
73        CLANG_CRASH_DIAGNOSTICS_DIR: "crash_diagnostics"
74    agents:
75      queue: "libcxx-builders"
76      os: "linux"
77    retry:
78      automatic:
79        - exit_status: -1  # Agent was lost
80          limit: 2
81    timeout_in_minutes: 120
82
83  - label: "C++26"
84    commands:
85      - "buildkite-agent artifact download install.tar.xz ."
86      - "tar -xvf install.tar.xz"
87      - "export CC=$(pwd)/install/bin/clang"
88      - "export CXX=$(pwd)/install/bin/clang++"
89      - "chmod +x install/bin/clang install/bin/clang++"
90      - "libcxx/utils/ci/run-buildbot generic-cxx26"
91    artifact_paths:
92      - "**/test-results.xml"
93      - "**/crash_diagnostics/*"
94    env:
95        LLVM_SYMBOLIZER_PATH: "/usr/bin/llvm-symbolizer-${LLVM_HEAD_VERSION}" # TODO: Should we build that from scratch?
96        CLANG_CRASH_DIAGNOSTICS_DIR: "crash_diagnostics"
97    agents:
98      queue: "libcxx-builders"
99      os: "linux"
100    retry:
101      automatic:
102        - exit_status: -1  # Agent was lost
103          limit: 2
104    timeout_in_minutes: 120
105
106  - label: "Modules"
107    commands:
108      - "buildkite-agent artifact download install.tar.xz ."
109      - "tar -xvf install.tar.xz"
110      - "export CC=$(pwd)/install/bin/clang"
111      - "export CXX=$(pwd)/install/bin/clang++"
112      - "chmod +x install/bin/clang install/bin/clang++"
113      - "libcxx/utils/ci/run-buildbot generic-modules"
114    artifact_paths:
115      - "**/test-results.xml"
116      - "**/crash_diagnostics/*"
117    env:
118        LLVM_SYMBOLIZER_PATH: "/usr/bin/llvm-symbolizer-${LLVM_HEAD_VERSION}" # TODO: Should we build that from scratch?
119        CLANG_CRASH_DIAGNOSTICS_DIR: "crash_diagnostics"
120    agents:
121      queue: "libcxx-builders"
122      os: "linux"
123    retry:
124      automatic:
125        - exit_status: -1  # Agent was lost
126          limit: 2
127    timeout_in_minutes: 120
128