diff --git a/.github/workflows/Ubuntu20Dockerfile b/.github/workflows/Ubuntu20Dockerfile index 37a344e64a5d..fb7c039c83cf 100644 --- a/.github/workflows/Ubuntu20Dockerfile +++ b/.github/workflows/Ubuntu20Dockerfile @@ -35,12 +35,12 @@ RUN apt-get install -y software-properties-common && \ apt-get install -f -y llvm-11 clang-11 # Install the tools for release_13x -RUN apt install -y build-essential manpages-dev \ +RUN apt --fix-missing update && \ + apt install -y build-essential manpages-dev \ libssl-dev zlib1g-dev \ libbz2-dev libreadline-dev libsqlite3-dev libncurses5-dev \ - libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python-openssl && \ - add-apt-repository ppa:ubuntu-toolchain-r/test && \ - apt install -y gcc-11 g++-11 python python3-distutils + apt install -y python3-distutils python3-psutil \ + libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python-openssl RUN cd /opt && \ wget https://github.com/Kitware/CMake/releases/download/v3.20.0/cmake-3.20.0-linux-aarch64.sh && \ diff --git a/.github/workflows/llvm-project-tests.yml b/.github/workflows/llvm-project-tests.yml index 7a4c47740148..d2112935bd68 100644 --- a/.github/workflows/llvm-project-tests.yml +++ b/.github/workflows/llvm-project-tests.yml @@ -27,9 +27,12 @@ jobs: lit-tests: name: Lit Tests runs-on: ${{ matrix.os }} + env: + install_prefix: /usr/local strategy: fail-fast: false matrix: + target: [X86] os: - ubuntu-latest # Use a specific version of macOS to ensure the CPLUS_INCLUDE_PATH workaround works. @@ -49,17 +52,15 @@ jobs: uses: hendrikmuhs/ccache-action@v1 with: key: ${{ matrix.os }} - - name: Build and Test - uses: llvm/actions/build-test-llvm-project@main - with: - cmake_args: '-GNinja -DLLVM_ENABLE_PROJECTS="${{ inputs.projects }}" -DCMAKE_BUILD_TYPE=Release -DLLDB_INCLUDE_TESTS=OFF -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache' - build_target: '${{ inputs.build_target }}' - - - name: Build and Test libclc - if: "!startsWith(matrix.os, 'windows') && contains(inputs.projects, 'libclc')" + - name: Test clang macOS + if: ${{ matrix.os == 'macOS-10.15'}} + run: | + ./build-llvm-project.sh -t X86 -e "clang" -p /usr/local -s -n $(sysctl -n hw.logicalcpu) -i + cd build + make check-all + - name: Test clang ubuntu + if: ${{ matrix.os == 'ubuntu-latest'}} run: | - # Make sure all of LLVM libraries that llvm-config needs are built. - ninja -C build - cmake -G Ninja -S libclc -B libclc-build -DLLVM_CONFIG=`pwd`/build/bin/llvm-config -DLIBCLC_TARGETS_TO_BUILD="amdgcn--;amdgcn--amdhsa;r600--;nvptx--;nvptx64--;nvptx--nvidiacl;nvptx64--nvidiacl" - ninja -C libclc-build - ninja -C libclc-build test + ./build-llvm-project.sh -t X86 -e "${{ inputs.projects }}" -p /usr/local -s -n $(nproc) -i + cd build + make check-all diff --git a/build-llvm-project.sh b/build-llvm-project.sh index ce94bb8eca5d..5fd3525f4aad 100755 --- a/build-llvm-project.sh +++ b/build-llvm-project.sh @@ -9,6 +9,7 @@ DO_INSTALL="0" USE_SUDO="0" C_COMPILER_PATH="/usr/bin/gcc" CXX_COMPILER_PATH="/usr/bin/g++" +LLVM_ENABLE_PROJECTS="clang;openmp" set -e # Exit script on first error. @@ -32,8 +33,9 @@ function print_usage { echo " -s Use sudo to install. Default: 0 - do not use sudo"; echo " -a C compiler path. Default: /usr/bin/gcc"; echo " -b C++ compiler path. Default: /usr/bin/g++"; + echo " -e List of the LLVM sub-projects to build. Default: clang;openmp"; } -while getopts "t:p:n:c?i?s?a:b:" opt; do +while getopts "t:p:n:c?i?s?a:b:e:" opt; do case "$opt" in t) TARGET=$OPTARG;; p) INSTALL_PREFIX=$OPTARG;; @@ -43,6 +45,7 @@ while getopts "t:p:n:c?i?s?a:b:" opt; do s) USE_SUDO="1";; a) C_COMPILER_PATH=$OPTARG;; b) CXX_COMPILER_PATH=$OPTARG;; + e) LLVM_ENABLE_PROJECTS=$OPTARG;; ?) print_usage; exit 0;; esac done @@ -66,7 +69,7 @@ fi # Build and install mkdir -p build && cd build -cmake $CMAKE_OPTIONS -DLLVM_ENABLE_PROJECTS="clang;openmp" ../llvm +cmake $CMAKE_OPTIONS -DLLVM_ENABLE_PROJECTS=$LLVM_ENABLE_PROJECTS ../llvm make -j$NPROC if [ $DO_INSTALL == "1" ]; then if [ $USE_SUDO == "1" ]; then