From 9d6824c5404ba69ec032746b4b709903d67273be Mon Sep 17 00:00:00 2001 From: adelhpour Date: Mon, 29 Apr 2024 19:01:33 -0700 Subject: [PATCH 1/9] CI/CD using GitHub Actions is added. --- .github/workflows/main.yml | 165 +++++++++++++++++++++++++++++++++++++ 1 file changed, 165 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000000000..2fee1d0fbd5076 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,165 @@ +name: BuildLLVM + +on: + push: + branches: + - release/13.x + pull_request: + branches: + - '*' + +jobs: + build_on_OSs: + name: Build on ${{ matrix.platform.name }} + strategy: + fail-fast: false + matrix: + platform: + - name: macos-11-release + os_type: macos + os_name: macos-11 + arch: x86_64 + build_type: Release + - name: macos-11-debug + os_type: macos + os_name: macos-11 + arch: x86_64 + build_type: Debug + - name: ubuntu-latest-release + os_type: ubuntu + os_name: ubuntu-latest + build_type: Release + - name: ubuntu-latest-debug + os_type: ubuntu + os_name: ubuntu-latest + build_type: Debug + - name: windows-latest-release + os_type: windows + os_name: windows-latest + build_type: Release + - name: windows-latest-debug + os_type: windows + os_name: windows-latest + build_type: Debug + - name: manylinux2014-release + os_type: manylinux + os_name: ubuntu-latest + container_image: quay.io/pypa/manylinux2014_x86_64 + build_type: Release + # We don't build on manylinux2014-debug platform because the machine runs out of space while building it + runs-on: ${{ matrix.platform.os_name }} + container: + image: ${{ matrix.platform.container_image || '' }} + + steps: + - name: Free up some space for Debug builds + if : matrix.platform.build_type == 'Debug' + shell: bash + run: | + rm -rf /opt/hostedtoolcache + rm -rf /usr/share/dotnet + rm -rf /usr/local/share/dotnet + + - name: Checkout LLVM + uses: actions/checkout@v3 + + - name: Set MSVC as the default compiler on Windows + if: matrix.platform.os_type == 'windows' + uses: ilammy/msvc-dev-cmd@v1.6.0 + + - name: Setup Ninja + uses: seanmiddleditch/gha-setup-ninja@master + + - name: Install ccache + shell: bash + run: | + cd ${RUNNER_WORKSPACE} + if [ "${{ matrix.platform.os_type }}" == 'macos' ]; then + brew install ccache + elif [ "${{ matrix.platform.os_type }}" == 'ubuntu' ]; then + sudo apt-get update + sudo apt-get install -y ccache + elif [ "${{ matrix.platform.os_type }}" == 'manylinux' ]; then + mkdir -p ccache + cd ccache + curl -L https://github.com/ccache/ccache/releases/download/v4.9.1/ccache-4.9.1.tar.gz > ccache.tar.gz + tar -zxf ccache.tar.gz + rm ccache.tar.gz + mkdir -p build-ccache + mkdir -p install-ccache + cd build-ccache + cmake -DCMAKE_INSTALL_PREFIX="$RUNNER_WORKSPACE/ccache/install-ccache" -DCMAKE_BUILD_TYPE=Release ../ccache-4.9.1 + cmake --build . --target install + echo "$RUNNER_WORKSPACE/ccache/install-ccache/bin" >> $GITHUB_PATH + fi + + - name: Prepare ccache timestamp on non-Windows platforms + if: matrix.platform.os_type != 'windows' + id: ccache_cache_timestamp + shell: cmake -P {0} + run: | + string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC) + message("::set-output name=timestamp::${current_date}") + + - name: Set ccache cache directory on non-Windows + if: matrix.platform.os_type != 'windows' + shell: bash + run: | + cd ${RUNNER_WORKSPACE} + echo "CCACHE_DIR=${RUNNER_WORKSPACE}/.ccache" >> "${GITHUB_ENV}" + echo "COMPILER_LAUNCHER=ccache" >> "${GITHUB_ENV}" + + - name: Cache ccache files on non-Windows + if: matrix.platform.os_type != 'windows' + uses: actions/cache@v3 + with: + path: ${RUNNER_WORKSPACE}/.ccache + key: + ${{ runner.os }}-${{ steps.ccache_cache_timestamp.outputs.timestamp + }} + restore-keys: | + ${{ runner.os }}-${{ steps.ccache_cache_timestamp.outputs.timestamp }} + ${{ runner.os }}- + + - name: Create build directory + shell: bash + run: mkdir -p ${RUNNER_WORKSPACE}/build-llvm + + - name: Configure CMake for LLVM + shell: bash + run: | + cd ${RUNNER_WORKSPACE}/build-llvm + cmake $GITHUB_WORKSPACE/llvm \ + -G "Ninja" \ + -DCMAKE_BUILD_TYPE=${{ matrix.platform.build_type }} \ + -DCMAKE_OSX_ARCHITECTURES=${{ matrix.platform.arch }} \ + -DCMAKE_C_COMPILER_LAUNCHER=${COMPILER_LAUNCHER} \ + -DCMAKE_CXX_COMPILER_LAUNCHER=${COMPILER_LAUNCHER} \ + -DCMAKE_INSTALL_PREFIX="${RUNNER_WORKSPACE}/install-llvm" + + - name: Build and Install LLVM + shell: bash + run: | + cd ${RUNNER_WORKSPACE}/build-llvm + cmake --build . --target install --config ${{ matrix.platform.build_type }} + + - name: Give Execute permissions to the binaries + shell: bash + run: | + cd ${RUNNER_WORKSPACE} + cd install-llvm/bin + chmod a+x llvm-config + + - name: Set artifacts path and name + shell: bash + run: | + cd ${RUNNER_WORKSPACE} + echo "artifacts_name=llvm-${{ matrix.platform.name }}" >> "${GITHUB_ENV}" + # we need to use relative path as actions/upload-artifact@v1 cannot find it on containerized runners + echo "artifacts_path=../install-llvm" >> "${GITHUB_ENV}" + + - name: Upload llvm binaries + uses: actions/upload-artifact@v1 + with: + name: ${{env.artifacts_name}} + path: ${{env.artifacts_path}} \ No newline at end of file From 4d1101aec2c3fd422189bc91d1faacb32a2303a9 Mon Sep 17 00:00:00 2001 From: adelhpour Date: Mon, 29 Apr 2024 19:19:51 -0700 Subject: [PATCH 2/9] CI/CD using GitHub Actions is added. --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2fee1d0fbd5076..a759aa85e92b4a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -6,7 +6,7 @@ on: - release/13.x pull_request: branches: - - '*' + - '**' jobs: build_on_OSs: From 0668ebd8ce2c07d5a9f4e4599e655ef91481511e Mon Sep 17 00:00:00 2001 From: adelhpour Date: Mon, 29 Apr 2024 19:26:14 -0700 Subject: [PATCH 3/9] CI/CD using GitHub Actions is added. --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a759aa85e92b4a..de2006bd3d280c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -46,7 +46,7 @@ jobs: os_name: ubuntu-latest container_image: quay.io/pypa/manylinux2014_x86_64 build_type: Release - # We don't build on manylinux2014-debug platform because the machine runs out of space while building it + # We don't build on manylinux2014-debug platform because the it runs out of space while building it runs-on: ${{ matrix.platform.os_name }} container: image: ${{ matrix.platform.container_image || '' }} From a6c2aea8e748235d0016d252e9435fd3f2778fce Mon Sep 17 00:00:00 2001 From: adelhpour Date: Wed, 1 May 2024 10:10:20 -0700 Subject: [PATCH 4/9] CI/CD using GitHub Actions is updated. --- .github/workflows/main.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index de2006bd3d280c..4aa8cff17587e7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -67,6 +67,15 @@ jobs: if: matrix.platform.os_type == 'windows' uses: ilammy/msvc-dev-cmd@v1.6.0 + - name: Upgrade gcc on ManyLinux + if: matrix.platform.os_type == 'manylinux' + shell: bash + run: | + yum install -y centos-release-scl + yum install -y devtoolset-11 + scl enable devtoolset-11 bash + echo "/opt/rh/devtoolset-11/root/usr/bin" >> $GITHUB_PATH + - name: Setup Ninja uses: seanmiddleditch/gha-setup-ninja@master From 8de8620f9952f62dfce36aee921050f1b08317f9 Mon Sep 17 00:00:00 2001 From: adelhpour Date: Wed, 1 May 2024 10:19:42 -0700 Subject: [PATCH 5/9] CI/CD using GitHub Actions is updated. --- .github/workflows/main.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4aa8cff17587e7..f99448a7de5cb8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,7 +10,7 @@ on: jobs: build_on_OSs: - name: Build on ${{ matrix.platform.name }} + name: Build LLVM on ${{ matrix.platform.name }} strategy: fail-fast: false matrix: @@ -46,7 +46,7 @@ jobs: os_name: ubuntu-latest container_image: quay.io/pypa/manylinux2014_x86_64 build_type: Release - # We don't build on manylinux2014-debug platform because the it runs out of space while building it + # We don't build on manylinux2014-debug platform because the the machine runs out of space while building it runs-on: ${{ matrix.platform.os_name }} container: image: ${{ matrix.platform.container_image || '' }} @@ -140,10 +140,10 @@ jobs: cd ${RUNNER_WORKSPACE}/build-llvm cmake $GITHUB_WORKSPACE/llvm \ -G "Ninja" \ - -DCMAKE_BUILD_TYPE=${{ matrix.platform.build_type }} \ - -DCMAKE_OSX_ARCHITECTURES=${{ matrix.platform.arch }} \ -DCMAKE_C_COMPILER_LAUNCHER=${COMPILER_LAUNCHER} \ -DCMAKE_CXX_COMPILER_LAUNCHER=${COMPILER_LAUNCHER} \ + -DCMAKE_BUILD_TYPE=${{ matrix.platform.build_type }} \ + -DCMAKE_OSX_ARCHITECTURES=${{ matrix.platform.arch }} \ -DCMAKE_INSTALL_PREFIX="${RUNNER_WORKSPACE}/install-llvm" - name: Build and Install LLVM @@ -152,7 +152,7 @@ jobs: cd ${RUNNER_WORKSPACE}/build-llvm cmake --build . --target install --config ${{ matrix.platform.build_type }} - - name: Give Execute permissions to the binaries + - name: Give Execute permissions to llvm binaries shell: bash run: | cd ${RUNNER_WORKSPACE} From 59879d856b23f4fa7ff7ca80f187bfd43d0cd16f Mon Sep 17 00:00:00 2001 From: adelhpour Date: Wed, 1 May 2024 11:00:11 -0700 Subject: [PATCH 6/9] CI/CD using GitHub Actions is updated. --- .github/workflows/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f99448a7de5cb8..a4534db9b23bb9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -146,13 +146,13 @@ jobs: -DCMAKE_OSX_ARCHITECTURES=${{ matrix.platform.arch }} \ -DCMAKE_INSTALL_PREFIX="${RUNNER_WORKSPACE}/install-llvm" - - name: Build and Install LLVM + - name: Build and install LLVM shell: bash run: | cd ${RUNNER_WORKSPACE}/build-llvm cmake --build . --target install --config ${{ matrix.platform.build_type }} - - name: Give Execute permissions to llvm binaries + - name: Give Execute permissions to LLVM binaries shell: bash run: | cd ${RUNNER_WORKSPACE} @@ -167,7 +167,7 @@ jobs: # we need to use relative path as actions/upload-artifact@v1 cannot find it on containerized runners echo "artifacts_path=../install-llvm" >> "${GITHUB_ENV}" - - name: Upload llvm binaries + - name: Upload LLVM binaries uses: actions/upload-artifact@v1 with: name: ${{env.artifacts_name}} From 9f88dac180822761d35237a47952e376c83da3b0 Mon Sep 17 00:00:00 2001 From: adelhpour Date: Fri, 3 May 2024 19:49:39 -0700 Subject: [PATCH 7/9] CI/CD using GitHub Actions is updated. - Original LLVM GitHub Actions workflows are removed - it now runs on macos machines with Apple Silicon chips - gcc is now updated in all linux platforms - Host architecture is no longer provided in the matrix and is extracted internally - artifacts names now provide more info about the machine and the compiler they were built on --- .github/workflows/README.md | 2 +- .github/workflows/main.yml | 64 +++++++++++++++++++++++++++++-------- 2 files changed, 52 insertions(+), 14 deletions(-) diff --git a/.github/workflows/README.md b/.github/workflows/README.md index 2781d9cc0e63d6..6e547deeea6d92 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -1 +1 @@ -Github action workflows should be stored in this directrory. +Original LLVM GitHub Actions workflows are all removed as we didn't want to run them in this repository. \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a4534db9b23bb9..e902165666af36 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,12 +18,18 @@ jobs: - name: macos-11-release os_type: macos os_name: macos-11 - arch: x86_64 build_type: Release - name: macos-11-debug os_type: macos os_name: macos-11 - arch: x86_64 + build_type: Debug + - name: macos-latest-release + os_type: macos + os_name: macos-latest + build_type: Release + - name: macos-latest-debug + os_type: macos + os_name: macos-latest build_type: Debug - name: ubuntu-latest-release os_type: ubuntu @@ -46,7 +52,7 @@ jobs: os_name: ubuntu-latest container_image: quay.io/pypa/manylinux2014_x86_64 build_type: Release - # We don't build on manylinux2014-debug platform because the the machine runs out of space while building it + # We don't build on manylinux2014-debug platform because the machine runs out of space while building it runs-on: ${{ matrix.platform.os_name }} container: image: ${{ matrix.platform.container_image || '' }} @@ -67,14 +73,33 @@ jobs: if: matrix.platform.os_type == 'windows' uses: ilammy/msvc-dev-cmd@v1.6.0 - - name: Upgrade gcc on ManyLinux + - name: Upgrade gcc on Linux if: matrix.platform.os_type == 'manylinux' shell: bash run: | - yum install -y centos-release-scl - yum install -y devtoolset-11 - scl enable devtoolset-11 bash - echo "/opt/rh/devtoolset-11/root/usr/bin" >> $GITHUB_PATH + if [ "${{ matrix.platform.os_type }}" == 'ubuntu' ]; then + apt-get update + apt-get install -y software-properties-common + add-apt-repository -y ppa:ubuntu-toolchain-r/test + apt-get update + apt-get install -y gcc-11 g++-11 + update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 90 + update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 90 + elif [ "${{ matrix.platform.os_type }}" == 'manylinux' ]; then + yum install -y centos-release-scl + yum install -y devtoolset-11 + scl enable devtoolset-11 bash + echo "/opt/rh/devtoolset-11/root/usr/bin" >> "${GITHUB_PATH}" + fi + + - name: Get Host Architecture + shell: bash + run: | + architecture=$(uname -m) + echo "host_architecture=$architecture" >> "${GITHUB_ENV}" + if [ "${{ matrix.platform.os_type }}" == 'macos' ]; then + echo "OSX_ARCHITECTURES=$architecture" >> "${GITHUB_ENV}" + fi - name: Setup Ninja uses: seanmiddleditch/gha-setup-ninja@master @@ -140,13 +165,13 @@ jobs: cd ${RUNNER_WORKSPACE}/build-llvm cmake $GITHUB_WORKSPACE/llvm \ -G "Ninja" \ + -DCMAKE_BUILD_TYPE=${{ matrix.platform.build_type }} \ + -DCMAKE_OSX_ARCHITECTURES=${OSX_ARCHITECTURES} \ -DCMAKE_C_COMPILER_LAUNCHER=${COMPILER_LAUNCHER} \ -DCMAKE_CXX_COMPILER_LAUNCHER=${COMPILER_LAUNCHER} \ - -DCMAKE_BUILD_TYPE=${{ matrix.platform.build_type }} \ - -DCMAKE_OSX_ARCHITECTURES=${{ matrix.platform.arch }} \ -DCMAKE_INSTALL_PREFIX="${RUNNER_WORKSPACE}/install-llvm" - - name: Build and install LLVM + - name: Build and Install LLVM shell: bash run: | cd ${RUNNER_WORKSPACE}/build-llvm @@ -163,8 +188,21 @@ jobs: shell: bash run: | cd ${RUNNER_WORKSPACE} - echo "artifacts_name=llvm-${{ matrix.platform.name }}" >> "${GITHUB_ENV}" - # we need to use relative path as actions/upload-artifact@v1 cannot find it on containerized runners + artifacts_name="" + if [ "${{ matrix.platform.os_type }}" == 'windows' ]; then + compiler_version=$(ls "C:\Program Files\Microsoft Visual Studio") + echo "artifacts_name=llvm-13.x-${{ matrix.platform.os_type }}-msvc$compiler_version-${host_architecture}-${{ matrix.platform.build_type }}" >> "${GITHUB_ENV}" + elif [ "${{ matrix.platform.os_type }}" == 'macos' ]; then + os_version=$(sw_vers -productVersion | cut -d '.' -f 1) + echo "artifacts_name=llvm-13.x-${{ matrix.platform.os_type }}-$os_version-${host_architecture}-${{ matrix.platform.build_type }}" >> "${GITHUB_ENV}" + elif [ "${{ matrix.platform.os_type }}" == 'ubuntu' ]; then + os_version=$(lsb_release -rs | cut -d '.' -f 1) + echo "artifacts_name=llvm-13.x-${{ matrix.platform.os_type }}-$os_version-${host_architecture}-${{ matrix.platform.build_type }}" >> "${GITHUB_ENV}" + elif [ "${{ matrix.platform.os_type }}" == 'manylinux' ]; then + os_name="${{ matrix.platform.os_type }}" + os_name_without_build_type="${os_name%%-*}" + echo "artifacts_name=llvm-13.x-${os_name_without_build_type}-${host_architecture}-${{ matrix.platform.build_type }}" >> "${GITHUB_ENV}" + fi echo "artifacts_path=../install-llvm" >> "${GITHUB_ENV}" - name: Upload LLVM binaries From 40d6f97ed93c7abe1fbf35c9026b4db29811648f Mon Sep 17 00:00:00 2001 From: adelhpour Date: Fri, 3 May 2024 20:37:59 -0700 Subject: [PATCH 8/9] CI/CD using GitHub Actions is updated. - minor bug fixes --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e902165666af36..77a683363fc4e7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -199,7 +199,7 @@ jobs: os_version=$(lsb_release -rs | cut -d '.' -f 1) echo "artifacts_name=llvm-13.x-${{ matrix.platform.os_type }}-$os_version-${host_architecture}-${{ matrix.platform.build_type }}" >> "${GITHUB_ENV}" elif [ "${{ matrix.platform.os_type }}" == 'manylinux' ]; then - os_name="${{ matrix.platform.os_type }}" + os_name="${{ matrix.platform.name }}" os_name_without_build_type="${os_name%%-*}" echo "artifacts_name=llvm-13.x-${os_name_without_build_type}-${host_architecture}-${{ matrix.platform.build_type }}" >> "${GITHUB_ENV}" fi From b1c0153f5341bf6ba4dd2ff19ad953d05d6b1924 Mon Sep 17 00:00:00 2001 From: adelhpour Date: Sat, 4 May 2024 23:22:37 -0700 Subject: [PATCH 9/9] CI/CD using GitHub Actions is updated. - GitHub Actions workflows related to LLVM original project are now removed. --- .github/lockdown.yml | 8 - .github/workflows/clang-tests.yml | 49 ------ .github/workflows/libclang-abi-tests.yml | 158 ------------------- .github/workflows/libclc-tests.yml | 60 -------- .github/workflows/lld-tests.yml | 49 ------ .github/workflows/lldb-tests.yml | 57 ------- .github/workflows/llvm-tests.yml | 185 ----------------------- 7 files changed, 566 deletions(-) delete mode 100644 .github/lockdown.yml delete mode 100644 .github/workflows/clang-tests.yml delete mode 100644 .github/workflows/libclang-abi-tests.yml delete mode 100644 .github/workflows/libclc-tests.yml delete mode 100644 .github/workflows/lld-tests.yml delete mode 100644 .github/workflows/lldb-tests.yml delete mode 100644 .github/workflows/llvm-tests.yml diff --git a/.github/lockdown.yml b/.github/lockdown.yml deleted file mode 100644 index e0ef8504c11714..00000000000000 --- a/.github/lockdown.yml +++ /dev/null @@ -1,8 +0,0 @@ -# Configuration for Repo Lockdown - https://github.com/dessant/repo-lockdown - -skipCreatedBefore: "2020-03-21" - -pulls: - comment: > - This repository does not accept pull requests. - Please follow http://llvm.org/docs/Contributing.html#how-to-submit-a-patch for contribution to LLVM. diff --git a/.github/workflows/clang-tests.yml b/.github/workflows/clang-tests.yml deleted file mode 100644 index 71783e8ba84848..00000000000000 --- a/.github/workflows/clang-tests.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: Clang Tests - -on: - push: - branches: - - 'release/**' - paths: - - 'clang/**' - - 'llvm/**' - - '.github/workflows/clang-tests.yml' - pull_request: - paths: - - 'clang/**' - - 'llvm/**' - - '.github/workflows/clang-tests.yml' - -concurrency: - # Skip intermediate builds: always. - # Cancel intermediate builds: only if it is a pull request build. - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} - -jobs: - build_clang: - name: clang check-all - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: - - ubuntu-latest - - windows-latest - - macOS-latest - steps: - - name: Setup Windows - if: startsWith(matrix.os, 'windows') - uses: llvm/actions/setup-windows@main - with: - arch: amd64 - - name: Install Ninja - uses: llvm/actions/install-ninja@main - - uses: actions/checkout@v1 - with: - fetch-depth: 250 - - name: Test clang - uses: llvm/actions/build-test-llvm-project@main - with: - cmake_args: -G Ninja -DLLVM_ENABLE_PROJECTS="clang" -DCMAKE_BUILD_TYPE=Release - build_target: check-clang diff --git a/.github/workflows/libclang-abi-tests.yml b/.github/workflows/libclang-abi-tests.yml deleted file mode 100644 index c533c2c2fa8e7e..00000000000000 --- a/.github/workflows/libclang-abi-tests.yml +++ /dev/null @@ -1,158 +0,0 @@ -name: libclang ABI Tests - -on: - push: - branches: - - 'release/**' - paths: - - 'clang/**' - - '.github/workflows/libclang-abi-tests.yml' - pull_request: - paths: - - 'clang/**' - - '.github/workflows/libclang-abi-tests.yml' - -concurrency: - # Skip intermediate builds: always. - # Cancel intermediate builds: only if it is a pull request build. - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} - - -jobs: - abi-dump-setup: - runs-on: ubuntu-latest - outputs: - BASELINE_REF: ${{ steps.vars.outputs.BASELINE_REF }} - ABI_HEADERS: ${{ steps.vars.outputs.ABI_HEADERS }} - ABI_LIBS: ${{ steps.vars.outputs.ABI_LIBS }} - BASELINE_VERSION_MAJOR: ${{ steps.vars.outputs.BASELINE_VERSION_MAJOR }} - BASELINE_VERSION_MINOR: ${{ steps.vars.outputs.BASELINE_VERSION_MINOR }} - LLVM_VERSION_MAJOR: ${{ steps.version.outputs.LLVM_VERSION_MAJOR }} - LLVM_VERSION_MINOR: ${{ steps.version.outputs.LLVM_VERSION_MINOR }} - LLVM_VERSION_PATCH: ${{ steps.version.outputs.LLVM_VERSION_PATCH }} - steps: - - name: Checkout source - uses: actions/checkout@v1 - with: - fetch-depth: 250 - - - name: Get LLVM version - id: version - uses: llvm/actions/get-llvm-version@main - - - name: Setup Variables - id: vars - run: | - minor_version=0 - remote_repo='https://github.com/llvm/llvm-project' - if [ ${{ steps.version.outputs.LLVM_VERSION_MINOR }} -ne 0 -o ${{ steps.version.outputs.LLVM_VERSION_PATCH }} -eq 0 ]; then - major_version=$(( ${{ steps.version.outputs.LLVM_VERSION_MAJOR }} - 1)) - baseline_ref="llvmorg-$major_version.0.0" - - # If there is a minor release, we want to use that as the base line. - minor_ref=`git ls-remote --refs -t $remote_repo llvmorg-$major_version.[1-9].[0-9] | tail -n1 | grep -o 'llvmorg-.\+' || true` - if [ -n "$minor_ref" ]; then - baseline_ref=$minor_ref - else - # Check if we have a release candidate - rc_ref=`git ls-remote --refs -t $remote_repo llvmorg-$major_version.[1-9].[0-9]-rc* | tail -n1 | grep -o 'llvmorg-.\+' || true` - if [ -n "$rc_ref" ]; then - baseline_ref=$rc_ref - fi - fi - echo ::set-output name=BASELINE_VERSION_MAJOR::$major_version - echo ::set-output name=BASELINE_REF::$baseline_ref - echo ::set-output name=ABI_HEADERS::clang-c - echo ::set-output name=ABI_LIBS::libclang.so - else - echo ::set-output name=BASELINE_VERSION_MAJOR::${{ steps.version.outputs.LLVM_VERSION_MAJOR }} - echo ::set-output name=BASELINE_REF::llvmorg-${{ steps.version.outputs.LLVM_VERSION_MAJOR }}.0.0 - echo ::set-output name=ABI_HEADERS::. - echo ::set-output name=ABI_LIBS::libclang.so libclang-cpp.so - fi - - - abi-dump: - needs: abi-dump-setup - runs-on: ubuntu-latest - strategy: - matrix: - name: - - build-baseline - - build-latest - include: - - name: build-baseline - llvm_version_major: ${{ needs.abi-dump-setup.outputs.BASELINE_VERSION_MAJOR }} - ref: ${{ needs.abi-dump-setup.outputs.BASELINE_REF }} - repo: llvm/llvm-project - - name: build-latest - llvm_version_major: ${{ needs.abi-dump-setup.outputs.LLVM_VERSION_MAJOR }} - ref: ${{ github.sha }} - repo: ${{ github.repository }} - steps: - - name: Install Ninja - uses: llvm/actions/install-ninja@main - - name: Install abi-compliance-checker - run: | - sudo apt-get install abi-dumper autoconf pkg-config - - name: Install universal-ctags - run: | - git clone https://github.com/universal-ctags/ctags.git - cd ctags - ./autogen.sh - ./configure - sudo make install - - name: Download source code - uses: llvm/actions/get-llvm-project-src@main - with: - ref: ${{ matrix.ref }} - repo: ${{ matrix.repo }} - - name: Configure - run: | - mkdir install - cmake -B build -S llvm -G Ninja -DLLVM_ENABLE_PROJECTS=clang -DCMAKE_BUILD_TYPE=Debug -DLLVM_TARGETS_TO_BUILD="" -DLLVM_BUILD_LLVM_DYLIB=ON -DLLVM_LINK_LLVM_DYLIB=ON -DCMAKE_C_FLAGS_DEBUG="-g1 -Og" -DCMAKE_CXX_FLAGS_DEBUG="-g1 -Og" -DCMAKE_INSTALL_PREFIX=`pwd`/install llvm - - name: Build - run: ninja -C build/ ${{ needs.abi-dump-setup.outputs.ABI_LIBS }} install-clang-headers - - name: Dump ABI - run: | - parallel abi-dumper -lver ${{ matrix.ref }} -skip-cxx -public-headers ./install/include/${{ needs.abi-dump-setup.outputs.ABI_HEADERS }} -o {}-${{ matrix.ref }}.abi ./build/lib/{} ::: ${{ needs.abi-dump-setup.outputs.ABI_LIBS }} - for lib in ${{ needs.abi-dump-setup.outputs.ABI_LIBS }}; do - # Remove symbol versioning from dumps, so we can compare across major versions. - sed -i 's/LLVM_${{ matrix.llvm_version_major }}/LLVM_NOVERSION/' $lib-${{ matrix.ref }}.abi - done - - name: Upload ABI file - uses: actions/upload-artifact@v2 - with: - name: ${{ matrix.name }} - path: "*${{ matrix.ref }}.abi" - - abi-compare: - runs-on: ubuntu-latest - needs: - - abi-dump-setup - - abi-dump - steps: - - name: Download baseline - uses: actions/download-artifact@v1 - with: - name: build-baseline - - name: Download latest - uses: actions/download-artifact@v1 - with: - name: build-latest - - - name: Install abi-compliance-checker - run: sudo apt-get install abi-compliance-checker - - name: Compare ABI - run: | - for lib in ${{ needs.abi-dump-setup.outputs.ABI_LIBS }}; do - abi-compliance-checker -lib $lib -old build-baseline/$lib*.abi -new build-latest/$lib*.abi - done - - name: Upload ABI Comparison - if: always() - uses: actions/upload-artifact@v2 - with: - name: compat-report-${{ github.sha }} - path: compat_reports/ - diff --git a/.github/workflows/libclc-tests.yml b/.github/workflows/libclc-tests.yml deleted file mode 100644 index d4dbbc6bc6a02d..00000000000000 --- a/.github/workflows/libclc-tests.yml +++ /dev/null @@ -1,60 +0,0 @@ -name: libclc Tests - -on: - push: - branches: - - 'release/**' - paths: - - 'clang/**' - - 'llvm/**' - - 'libclc/**' - - '.github/workflows/libclc-tests.yml' - pull_request: - paths: - - 'clang/**' - - 'llvm/**' - - 'libclc/**' - - '.github/workflows/libclc-tests.yml' - -concurrency: - # Skip intermediate builds: always. - # Cancel intermediate builds: only if it is a pull request build. - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} - - -jobs: - build_libclc: - name: libclc test - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: - - ubuntu-latest - # Disable build on windows, because I can't figure out where llvm-config is. - #- windows-latest - - macOS-latest - steps: - - name: Setup Windows - if: startsWith(matrix.os, 'windows') - uses: llvm/actions/setup-windows@main - with: - arch: amd64 - - name: Install Ninja - uses: llvm/actions/install-ninja@main - - uses: actions/checkout@v1 - with: - fetch-depth: 250 - - name: Build clang - uses: llvm/actions/build-test-llvm-project@main - with: - cmake_args: -G Ninja -DLLVM_ENABLE_PROJECTS="clang" -DCMAKE_BUILD_TYPE=Release - build_target: "" - - name: Build and test libclc - # spirv targets require llvm-spirv, so skip building them until we figure out - # how to install this tool. - run: | - 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 diff --git a/.github/workflows/lld-tests.yml b/.github/workflows/lld-tests.yml deleted file mode 100644 index 5cbcfcf515abb1..00000000000000 --- a/.github/workflows/lld-tests.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: LLD Tests - -on: - push: - branches: - - 'release/**' - paths: - - 'lld/**' - - 'llvm/**' - - '.github/workflows/lld-tests.yml' - pull_request: - paths: - - 'lld/**' - - 'llvm/**' - - '.github/workflows/lld-tests.yml' - -concurrency: - # Skip intermediate builds: always. - # Cancel intermediate builds: only if it is a pull request build. - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} - -jobs: - build_lld: - name: lld check-all - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: - - ubuntu-latest - - windows-latest - - macOS-latest - steps: - - name: Setup Windows - if: startsWith(matrix.os, 'windows') - uses: llvm/actions/setup-windows@main - with: - arch: amd64 - - name: Install Ninja - uses: llvm/actions/install-ninja@main - - uses: actions/checkout@v1 - with: - fetch-depth: 250 - - name: Test lld - uses: llvm/actions/build-test-llvm-project@main - with: - cmake_args: -G Ninja -DLLVM_ENABLE_PROJECTS="lld" -DCMAKE_BUILD_TYPE=Release - build_target: check-lld diff --git a/.github/workflows/lldb-tests.yml b/.github/workflows/lldb-tests.yml deleted file mode 100644 index 1b9aaff8ccbe14..00000000000000 --- a/.github/workflows/lldb-tests.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: lldb Tests - -on: - push: - branches: - - 'release/**' - paths: - - 'clang/**' - - 'llvm/**' - - 'lldb/**' - - '.github/workflows/lldb-tests.yml' - pull_request: - paths: - - 'clang/**' - - 'llvm/**' - - 'lldb/**' - - '.github/workflows/lldb-tests.yml' - -concurrency: - # Skip intermediate builds: always. - # Cancel intermediate builds: only if it is a pull request build. - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} - - -jobs: - build_lldb: - name: lldb build - runs-on: ${{ matrix.os }} - # Workaround for build faliure on Mac OS X: llvm.org/PR46190, https://github.com/actions/virtual-environments/issues/2274 - env: - CPLUS_INCLUDE_PATH: /usr/local/opt/llvm/include/c++/v1:/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/include - strategy: - fail-fast: false - matrix: - os: - - ubuntu-latest - - windows-latest - - macOS-latest - steps: - - name: Setup Windows - if: startsWith(matrix.os, 'windows') - uses: llvm/actions/setup-windows@main - with: - arch: amd64 - - name: Install Ninja - uses: llvm/actions/install-ninja@main - - uses: actions/checkout@v1 - with: - fetch-depth: 250 - - name: Build lldb - uses: llvm/actions/build-test-llvm-project@main - with: - # Mac OS requries that libcxx is enabled for lldb tests, so we need to disable them. - cmake_args: -G Ninja -DLLVM_ENABLE_PROJECTS="clang;lldb" -DCMAKE_BUILD_TYPE=Release -DLLDB_INCLUDE_TESTS=OFF - # check-lldb is not consistent, so we only build lldb. - build_target: "" diff --git a/.github/workflows/llvm-tests.yml b/.github/workflows/llvm-tests.yml deleted file mode 100644 index 2fc44e95993674..00000000000000 --- a/.github/workflows/llvm-tests.yml +++ /dev/null @@ -1,185 +0,0 @@ -name: LLVM Tests - -on: - push: - branches: - - 'release/**' - paths: - - 'llvm/**' - - '.github/workflows/llvm-tests.yml' - pull_request: - paths: - - 'llvm/**' - - '.github/workflows/llvm-tests.yml' - -concurrency: - # Skip intermediate builds: always. - # Cancel intermediate builds: only if it is a pull request build. - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} - - -jobs: - build_llvm: - name: llvm check-all - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: - - ubuntu-latest - - windows-latest - - macOS-latest - steps: - - name: Setup Windows - if: startsWith(matrix.os, 'windows') - uses: llvm/actions/setup-windows@main - with: - arch: amd64 - - name: Install Ninja - uses: llvm/actions/install-ninja@main - - uses: actions/checkout@v1 - with: - fetch-depth: 250 - - name: Test llvm - uses: llvm/actions/build-test-llvm-project@main - with: - cmake_args: -G Ninja -DCMAKE_BUILD_TYPE=Release - - abi-dump-setup: - runs-on: ubuntu-latest - outputs: - BASELINE_REF: ${{ steps.vars.outputs.BASELINE_REF }} - ABI_HEADERS: ${{ steps.vars.outputs.ABI_HEADERS }} - BASELINE_VERSION_MAJOR: ${{ steps.vars.outputs.BASELINE_VERSION_MAJOR }} - LLVM_VERSION_MAJOR: ${{ steps.version.outputs.LLVM_VERSION_MAJOR }} - LLVM_VERSION_MINOR: ${{ steps.version.outputs.LLVM_VERSION_MINOR }} - LLVM_VERSION_PATCH: ${{ steps.version.outputs.LLVM_VERSION_PATCH }} - steps: - - name: Checkout source - uses: actions/checkout@v1 - with: - fetch-depth: 250 - - - name: Get LLVM version - id: version - uses: llvm/actions/get-llvm-version@main - - - name: Setup Variables - id: vars - run: | - if [ ${{ steps.version.outputs.LLVM_VERSION_MINOR }} -ne 0 -o ${{ steps.version.outputs.LLVM_VERSION_PATCH }} -eq 0 ]; then - echo ::set-output name=BASELINE_VERSION_MAJOR::$(( ${{ steps.version.outputs.LLVM_VERSION_MAJOR }} - 1)) - echo ::set-output name=ABI_HEADERS::llvm-c - else - echo ::set-output name=BASELINE_VERSION_MAJOR::${{ steps.version.outputs.LLVM_VERSION_MAJOR }} - echo ::set-output name=ABI_HEADERS::. - fi - - abi-dump: - needs: abi-dump-setup - runs-on: ubuntu-latest - strategy: - matrix: - name: - - build-baseline - - build-latest - include: - - name: build-baseline - llvm_version_major: ${{ needs.abi-dump-setup.outputs.BASELINE_VERSION_MAJOR }} - ref: llvmorg-${{ needs.abi-dump-setup.outputs.BASELINE_VERSION_MAJOR }}.0.0 - repo: llvm/llvm-project - - name: build-latest - llvm_version_major: ${{ needs.abi-dump-setup.outputs.LLVM_VERSION_MAJOR }} - ref: ${{ github.sha }} - repo: ${{ github.repository }} - steps: - - name: Install Ninja - uses: llvm/actions/install-ninja@main - - name: Install abi-compliance-checker - run: | - sudo apt-get install abi-dumper autoconf pkg-config - - name: Install universal-ctags - run: | - git clone https://github.com/universal-ctags/ctags.git - cd ctags - ./autogen.sh - ./configure - sudo make install - - name: Download source code - uses: llvm/actions/get-llvm-project-src@main - with: - ref: ${{ matrix.ref }} - repo: ${{ matrix.repo }} - - name: Configure - run: | - mkdir install - cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug -DLLVM_TARGETS_TO_BUILD="" -DLLVM_BUILD_LLVM_DYLIB=ON -DCMAKE_C_FLAGS_DEBUG="-g1 -Og" -DCMAKE_CXX_FLAGS_DEBUG="-g1 -Og" -DCMAKE_INSTALL_PREFIX=`pwd`/install llvm - - name: Build - # Need to run install-LLVM twice to ensure the symlink is installed (this is a bug). - run: | - ninja -C build install-LLVM - ninja -C build install-LLVM - ninja -C build install-llvm-headers - - name: Dump ABI - run: | - if [ "${{ needs.abi-dump-setup.outputs.ABI_HEADERS }}" = "llvm-c" ]; then - nm ./install/lib/libLLVM.so | awk "/T _LLVM/ || /T LLVM/ { print $3 }" | sort -u | sed -e "s/^_//g" | cut -d ' ' -f 3 > llvm.symbols - # Even though the -symbols-list option doesn't seem to filter out the symbols, I believe it speeds up processing, so I'm leaving it in. - export EXTRA_ARGS="-symbols-list llvm.symbols" - else - touch llvm.symbols - fi - abi-dumper $EXTRA_ARGS -lver ${{ matrix.ref }} -skip-cxx -public-headers ./install/include/${{ needs.abi-dump-setup.outputs.ABI_HEADERS }} -o ${{ matrix.ref }}.abi ./install/lib/libLLVM.so - # Remove symbol versioning from dumps, so we can compare across major versions. - sed -i 's/LLVM_${{ matrix.llvm_version_major }}/LLVM_NOVERSION/' ${{ matrix.ref }}.abi - - name: Upload ABI file - uses: actions/upload-artifact@v1 - with: - name: ${{ matrix.name }} - path: ${{ matrix.ref }}.abi - - - name: Upload symbol list file - if: matrix.name == 'build-baseline' - uses: actions/upload-artifact@v1 - with: - name: symbol-list - path: llvm.symbols - - abi-compare: - runs-on: ubuntu-latest - needs: - - abi-dump-setup - - abi-dump - steps: - - name: Download baseline - uses: actions/download-artifact@v1 - with: - name: build-baseline - - name: Download latest - uses: actions/download-artifact@v1 - with: - name: build-latest - - name: Download symbol list - uses: actions/download-artifact@v1 - with: - name: symbol-list - - - name: Install abi-compliance-checker - run: sudo apt-get install abi-compliance-checker - - name: Compare ABI - run: | - if [ -s symbol-list/llvm.symbols ]; then - # This option doesn't seem to work with the ABI dumper, so passing it here. - export EXTRA_ARGS="-symbols-list symbol-list/llvm.symbols" - fi - # FIXME: Reading of gzip'd abi files on the GitHub runners stop - # working some time in March of 2021, likely due to a change in the - # runner's environment. - abi-compliance-checker $EXTRA_ARGS -l libLLVM.so -old build-baseline/*.abi -new build-latest/*.abi || test "${{ needs.abi-dump-setup.outputs.ABI_HEADERS }}" = "llvm-c" - - name: Upload ABI Comparison - if: always() - uses: actions/upload-artifact@v1 - with: - name: compat-report-${{ github.sha }} - path: compat_reports/