Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 17 additions & 12 deletions .github/workflows/libcxx-build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ jobs:
source .venv/bin/activate
python -m pip install psutil
xcrun bash libcxx/utils/ci/run-buildbot ${{ matrix.config }}
env:
CC: clang
CXX: clang++
- uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
if: always() # Upload artifacts even if the build or test suite fails
with:
Expand All @@ -241,16 +244,16 @@ jobs:
fail-fast: false
matrix:
include:
- { config: clang-cl-dll, mingw: false }
- { config: clang-cl-static, mingw: false }
- { config: clang-cl-no-vcruntime, mingw: false }
- { config: clang-cl-debug, mingw: false }
- { config: clang-cl-static-crt, mingw: false }
- { config: mingw-dll, mingw: true }
- { config: mingw-static, mingw: true }
- { config: mingw-dll-i686, mingw: true }
- { config: mingw-incomplete-sysroot, mingw: true }
- { config: mingw-static, mingw: true, runner: windows-11-arm }
- { config: clang-cl-dll, mingw: false, cc: clang-cl, cxx: clang-cl }
- { config: clang-cl-static, mingw: false, cc: clang-cl, cxx: clang-cl }
- { config: clang-cl-no-vcruntime, mingw: false, cc: clang-cl, cxx: clang-cl }
- { config: clang-cl-debug, mingw: false, cc: clang-cl, cxx: clang-cl }
- { config: clang-cl-static-crt, mingw: false, cc: clang-cl, cxx: clang-cl }
- { config: mingw-dll, mingw: true, cc: clang-cl, cxx: clang-cl }
- { config: mingw-dll, mingw: true, cc: i686-w64-mingw32-clang, cxx: i686-w64-mingw32-clang++ }
- { config: mingw-static, mingw: true, cc: clang-cl, cxx: clang-cl }
- { config: mingw-incomplete-sysroot, mingw: true, cc: clang-cl, cxx: clang-cl }
- { config: mingw-static, mingw: true, cc: clang-cl, cxx: clang-cl, runner: windows-11-arm }
runs-on: ${{ matrix.runner != '' && matrix.runner || 'windows-2022' }}
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
Expand Down Expand Up @@ -286,5 +289,7 @@ jobs:
run: |
echo "c:\Program Files\LLVM\bin" | Out-File -FilePath $Env:GITHUB_PATH -Encoding utf8 -Append
- name: Build and test
run: |
bash libcxx/utils/ci/run-buildbot ${{ matrix.config }}
run: bash libcxx/utils/ci/run-buildbot ${{ matrix.config }}
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
3 changes: 3 additions & 0 deletions .github/workflows/libcxx-check-generated-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ jobs:

- name: Check generated files
run: libcxx/utils/ci/run-buildbot check-generated-output
env:
CC: cc
CXX: c++
3 changes: 3 additions & 0 deletions libcxx/docs/AddingNewCIJobs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ An example of a job definition is:

- label: "C++11"
command: "libcxx/utils/ci/run-buildbot generic-cxx11"
env:
CC: clang
CXX: clang++
artifact_paths:
- "**/test-results.xml"
agents:
Expand Down
30 changes: 30 additions & 0 deletions libcxx/utils/ci/buildkite-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,55 +37,79 @@ steps:
steps:
- label: AArch64
command: libcxx/utils/ci/run-buildbot aarch64
env:
CC: cc
CXX: c++
agents:
queue: libcxx-builders-linaro-arm
arch: aarch64
<<: *common

- label: AArch64 -fno-exceptions
command: libcxx/utils/ci/run-buildbot aarch64-no-exceptions
env:
CC: cc
CXX: c++
agents:
queue: libcxx-builders-linaro-arm
arch: aarch64
<<: *common

- label: Armv8
command: libcxx/utils/ci/run-buildbot armv8
env:
CC: cc
CXX: c++
agents:
queue: libcxx-builders-linaro-arm
arch: armv8l
<<: *common

- label: Armv8 -fno-exceptions
command: libcxx/utils/ci/run-buildbot armv8-no-exceptions
env:
CC: cc
CXX: c++
agents:
queue: libcxx-builders-linaro-arm
arch: armv8l
<<: *common

- label: Armv7
command: libcxx/utils/ci/run-buildbot armv7
env:
CC: cc
CXX: c++
agents:
queue: libcxx-builders-linaro-arm
arch: armv8l
<<: *common

- label: Armv7 -fno-exceptions
command: libcxx/utils/ci/run-buildbot armv7-no-exceptions
env:
CC: cc
CXX: c++
agents:
queue: libcxx-builders-linaro-arm
arch: armv8l
<<: *common

- label: Armv7-M picolibc
command: libcxx/utils/ci/run-buildbot armv7m-picolibc
env:
CC: cc
CXX: c++
agents:
queue: libcxx-builders-linaro-arm
arch: aarch64
<<: *common

- label: Armv7-M picolibc -fno-exceptions
command: libcxx/utils/ci/run-buildbot armv7m-picolibc-no-exceptions
env:
CC: cc
CXX: c++
agents:
queue: libcxx-builders-linaro-arm
arch: aarch64
Expand Down Expand Up @@ -131,13 +155,19 @@ steps:
steps:
- label: Android 5.0, x86 NDK
command: libcxx/utils/ci/run-buildbot android-ndk-21-def-x86
env:
CC: /opt/android/clang/clang-current/bin/clang
CXX: /opt/android/clang/clang-current/bin/clang++
agents:
queue: libcxx-builders
os: android
<<: *common

- label: Android 13, x86_64 NDK
command: libcxx/utils/ci/run-buildbot android-ndk-33-goog-x86_64
env:
CC: /opt/android/clang/clang-current/bin/clang
CXX: /opt/android/clang/clang-current/bin/clang++
agents:
queue: libcxx-builders
os: android
Expand Down
81 changes: 52 additions & 29 deletions libcxx/utils/ci/run-buildbot
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,41 @@ ${PROGNAME} [options] <BUILDER>

Environment variables
CC The C compiler to use, this value is used by CMake. This
variable is optional.
variable is mandatory.

CXX The C++ compiler to use, this value is used by CMake. This
variable is optional.

CLANG_FORMAT The clang-format binary to use when generating the format
ignore list.
variable is mandatory.

CCACHE The ccache binary to use. This variable is optional and is only
used by the bootstrapping build.
EOF
}

function step() {
endstep
set +x
if [[ ! -z ${GITHUB_ACTIONS+x} ]]; then
echo "::group::$1"
export IN_GROUP=1
else
echo "--- $1"
fi
set -x
}

function endstep() {
set +x
if [[ ! -z ${GITHUB_ACTIONS+x} ]] && [[ ! -z ${IN_GROUP+x} ]]; then
echo "::endgroup::"
unset IN_GROUP
fi
set -x
}

function error() {
echo "::error::$1"
}

if [[ $# == 0 ]]; then
usage
exit 0
Expand Down Expand Up @@ -96,6 +120,23 @@ function error() {
echo "::error::$1"
}

if [ -z ${CC+x} ]; then
error "Environment variable CC must be defined"
exit 1
fi

if [ -z ${CXX+x} ]; then
error "Environment variable CXX must be defined"
exit 1
fi

# Print the version of a few tools to aid diagnostics in some cases
step "Diagnose tools in use"
cmake --version
ninja --version
${CC} --version
${CXX} --version

function clean() {
rm -rf "${BUILD_DIR}"
}
Expand Down Expand Up @@ -127,11 +168,7 @@ function generate-cmake() {
}

function generate-cmake-libcxx-win() {
generate-cmake-base \
-DLLVM_ENABLE_RUNTIMES="libcxx" \
-DCMAKE_C_COMPILER=clang-cl \
-DCMAKE_CXX_COMPILER=clang-cl \
"${@}"
generate-cmake-base -DLLVM_ENABLE_RUNTIMES="libcxx" "${@}"
}

function generate-cmake-android() {
Expand Down Expand Up @@ -215,12 +252,6 @@ function test-armv7m-picolibc() {
check-runtimes
}

# Print the version of a few tools to aid diagnostics in some cases
step "Diagnose tools in use"
cmake --version
ninja --version
if [ ! -z "${CXX}" ]; then ${CXX} --version; fi

case "${BUILDER}" in
check-generated-output)
# `! foo` doesn't work properly with `set -e`, use `! foo || false` instead.
Expand Down Expand Up @@ -357,12 +388,16 @@ generic-ubsan)
bootstrapping-build)
clean

if [ ! -z ${CCACHE+x} ]; then
COMPILER_LAUNCHER="-DCMAKE_CXX_COMPILER_LAUNCHER=${CCACHE}"
fi

step "Generating CMake"
cmake \
-S "${MONOREPO_ROOT}/llvm" \
-B "${BUILD_DIR}" \
-GNinja \
-DCMAKE_CXX_COMPILER_LAUNCHER="ccache" \
${COMPILER_LAUNCHER} \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
-DLLVM_ENABLE_PROJECTS="clang;lldb" \
Expand Down Expand Up @@ -689,14 +724,6 @@ mingw-static)
-DLIBUNWIND_ENABLE_SHARED=OFF
check-runtimes
;;
mingw-dll-i686)
clean
generate-cmake \
-DCMAKE_C_COMPILER=i686-w64-mingw32-clang \
-DCMAKE_CXX_COMPILER=i686-w64-mingw32-clang++ \
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/MinGW.cmake"
check-runtimes
;;
mingw-incomplete-sysroot)
# When bringing up a new cross compiler from scratch, we build
# libunwind/libcxx in a setup where the toolchain is incomplete and
Expand Down Expand Up @@ -741,10 +768,6 @@ android-ndk-*)
fi
ARCH=$(arch_of_emu_img ${ANDROID_EMU_IMG})

# Use the Android compiler by default.
export CC=${CC:-/opt/android/clang/clang-current/bin/clang}
export CXX=${CXX:-/opt/android/clang/clang-current/bin/clang++}

# The NDK libc++_shared.so is always built against the oldest supported API
# level. When tests are run against a device with a newer API level, test
# programs can be built for any supported API level, but building for the
Expand Down
Loading