[libcxx] [llvm] [libc++] Move some macOS CI jobs to Github actions (PR #89083)

Louis Dionne via llvm-commits llvm-commits at lists.llvm.org
Tue May 7 07:10:48 PDT 2024


https://github.com/ldionne updated https://github.com/llvm/llvm-project/pull/89083

>From 24334330628816a359e2256f56c80a1ed33271c3 Mon Sep 17 00:00:00 2001
From: Louis Dionne <ldionne.2 at gmail.com>
Date: Wed, 17 Apr 2024 10:29:14 -0400
Subject: [PATCH 1/2] [libc++] Move some macOS CI jobs to Github actions

This is an attempt to decouple macOS CI testing from BuildKite, which
would make the maintenance of macOS CI easier and more accessible to
all contributors. Right now, the macOS CI is running entirely on machines
owned by the LLVM Foundation with only a small set of contributors having
direct access to them.

The story for performing back-deployment testing still needs to be
figured out, so for now we are retaining some jobs under BuildKite.
---
 .github/workflows/libcxx-build-and-test.yaml | 35 +++++++++
 libcxx/utils/ci/buildkite-pipeline.yml       | 75 +++++---------------
 2 files changed, 53 insertions(+), 57 deletions(-)

diff --git a/.github/workflows/libcxx-build-and-test.yaml b/.github/workflows/libcxx-build-and-test.yaml
index 44a3d79c72c0a..bbf09a1786cba 100644
--- a/.github/workflows/libcxx-build-and-test.yaml
+++ b/.github/workflows/libcxx-build-and-test.yaml
@@ -82,6 +82,7 @@ jobs:
             **/CMakeError.log
             **/CMakeOutput.log
             **/crash_diagnostics/*
+
   stage2:
     if: github.repository_owner == 'llvm'
     runs-on: libcxx-runners-8-set
@@ -126,6 +127,7 @@ jobs:
             **/CMakeError.log
             **/CMakeOutput.log
             **/crash_diagnostics/*
+
   stage3:
     if: github.repository_owner == 'llvm'
     needs: [ stage1, stage2 ]
@@ -190,6 +192,39 @@ jobs:
             **/CMakeError.log
             **/CMakeOutput.log
             **/crash_diagnostics/*
+
+  macos:
+    runs-on: macos-14
+    needs: [ stage1 ]
+    strategy:
+      fail-fast: false
+      matrix:
+        config: [
+          generic-cxx03,
+          generic-cxx23,
+          generic-modules,
+          apple-system
+        ]
+    steps:
+      - uses: actions/checkout at v4
+      - uses: maxim-lobanov/setup-xcode at v1
+        with:
+          xcode-version: 'latest-stable'
+      - uses: seanmiddleditch/gha-setup-ninja at master
+      - name: Build and test
+        run: |
+          bash libcxx/utils/ci/run-buildbot ${{ matrix.config }}
+      - uses: actions/upload-artifact at 26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
+        if: always()  # Upload artifacts even if the build or test suite fails
+        with:
+          name: macos-${{ matrix.config }}-results
+          path: |
+            **/test-results.xml
+            **/*.abilist
+            **/CMakeError.log
+            **/CMakeOutput.log
+            **/crash_diagnostics/*
+
   windows:
     runs-on: windows-2022
     needs: [ stage1 ]
diff --git a/libcxx/utils/ci/buildkite-pipeline.yml b/libcxx/utils/ci/buildkite-pipeline.yml
index 4bacdec8f8d6b..0e9a02ad081b1 100644
--- a/libcxx/utils/ci/buildkite-pipeline.yml
+++ b/libcxx/utils/ci/buildkite-pipeline.yml
@@ -56,47 +56,8 @@ environment_definitions:
 
 
 steps:
-- group: ':mac: Apple'
+- group: ':mac: Apple Backdeployment'
   steps:
-  - label: MacOS x86_64
-    command: libcxx/utils/ci/run-buildbot generic-cxx23
-    agents:
-      queue: libcxx-builders
-      os: macos
-      arch: x86_64
-    <<: *common
-
-  - label: MacOS arm64
-    command: libcxx/utils/ci/run-buildbot generic-cxx23
-    agents:
-      queue: libcxx-builders
-      os: macos
-      arch: arm64
-    <<: *common
-
-  - label: MacOS with Modules
-    command: libcxx/utils/ci/run-buildbot generic-modules
-    agents:
-      queue: libcxx-builders
-      os: macos
-    <<: *common
-
-  - label: MacOS with C++03
-    command: libcxx/utils/ci/run-buildbot generic-cxx03
-    agents:
-      queue: libcxx-builders
-      os: macos
-    <<: *common
-
-    # Build with the configuration we use to generate libc++.dylib on Apple platforms
-  - label: Apple system
-    command: libcxx/utils/ci/run-buildbot apple-system
-    agents:
-      queue: libcxx-builders
-      os: macos
-      arch: arm64 # This can technically run on any architecture, but we have more resources on arm64 so we pin this job to arm64
-    <<: *common
-
   - label: Apple back-deployment macosx10.13
     command: libcxx/utils/ci/run-buildbot apple-system-backdeployment-10.13
     agents:
@@ -121,6 +82,23 @@ steps:
       arch: x86_64 # TODO: Remove this once we are able to run back-deployment on arm64 again, since this isn't x86_64 specific
     <<: *common
 
+    # TODO: Re-enable this once we've figured out how to run back-deployment testing on arm64 on recent OSes
+    # - label: "Apple back-deployment macosx11.0 arm64"
+    #   command: "libcxx/utils/ci/run-buildbot apple-system-backdeployment-11.0"
+    #   artifact_paths:
+    #     - "**/test-results.xml"
+    #     - "**/*.abilist"
+    #   agents:
+    #     queue: "libcxx-builders"
+    #     os: "macos"
+    #     arch: "arm64"
+    #   retry:
+    #     automatic:
+    #       - exit_status: -1  # Agent was lost
+    #         limit: 2
+    #   timeout_in_minutes: 120
+
+
 - group: ARM
   steps:
   - label: AArch64
@@ -230,20 +208,3 @@ steps:
       queue: libcxx-builders
       os: android
     <<: *common
-
-
-    # TODO: Re-enable this once we've figured out how to run back-deployment testing on arm64 on recent OSes
-    # - label: "Apple back-deployment macosx11.0 arm64"
-    #   command: "libcxx/utils/ci/run-buildbot apple-system-backdeployment-11.0"
-    #   artifact_paths:
-    #     - "**/test-results.xml"
-    #     - "**/*.abilist"
-    #   agents:
-    #     queue: "libcxx-builders"
-    #     os: "macos"
-    #     arch: "arm64"
-    #   retry:
-    #     automatic:
-    #       - exit_status: -1  # Agent was lost
-    #         limit: 2
-    #   timeout_in_minutes: 120

>From ca9e500b6d8335af95af3a66ddd19b931aa143d5 Mon Sep 17 00:00:00 2001
From: Louis Dionne <ldionne.2 at gmail.com>
Date: Tue, 7 May 2024 10:10:37 -0400
Subject: [PATCH 2/2] Reduce configuration to avoid spamming the bots while we
 are testing

---
 .github/workflows/libcxx-build-and-test.yaml | 306 +++++++++----------
 1 file changed, 150 insertions(+), 156 deletions(-)

diff --git a/.github/workflows/libcxx-build-and-test.yaml b/.github/workflows/libcxx-build-and-test.yaml
index bbf09a1786cba..e9453fa521acd 100644
--- a/.github/workflows/libcxx-build-and-test.yaml
+++ b/.github/workflows/libcxx-build-and-test.yaml
@@ -55,16 +55,10 @@ jobs:
       fail-fast: false
       matrix:
         config: [
-          'generic-cxx03',
           'generic-cxx26',
-          'generic-modules'
         ]
         cc: [  'clang-19' ]
         cxx: [ 'clang++-19' ]
-        include:
-          - config: 'generic-gcc'
-            cc: 'gcc-13'
-            cxx: 'g++-13'
     steps:
       - uses: actions/checkout at v4
       - name: ${{ matrix.config }}.${{ matrix.cxx }}
@@ -83,115 +77,115 @@ jobs:
             **/CMakeOutput.log
             **/crash_diagnostics/*
 
-  stage2:
-    if: github.repository_owner == 'llvm'
-    runs-on: libcxx-runners-8-set
-    needs: [ stage1 ]
-    continue-on-error: false
-    strategy:
-      fail-fast: false
-      matrix:
-        config: [
-          'generic-cxx11',
-          'generic-cxx14',
-          'generic-cxx17',
-          'generic-cxx20',
-          'generic-cxx23'
-        ]
-        cc: [ 'clang-19' ]
-        cxx: [ 'clang++-19' ]
-        include:
-          - config: 'generic-gcc-cxx11'
-            cc: 'gcc-13'
-            cxx: 'g++-13'
-          - config: 'generic-cxx23'
-            cc: 'clang-17'
-            cxx: 'clang++-17'
-          - config: 'generic-cxx26'
-            cc: 'clang-18'
-            cxx: 'clang++-18'
-    steps:
-      - uses: actions/checkout at v4
-      - name: ${{ matrix.config }}
-        run: libcxx/utils/ci/run-buildbot ${{ matrix.config }}
-        env:
-          CC: ${{ matrix.cc }}
-          CXX: ${{ matrix.cxx }}
-      - uses: actions/upload-artifact at 26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
-        if: always()  # Upload artifacts even if the build or test suite fails
-        with:
-          name: ${{ matrix.config }}-${{ matrix.cxx }}-results
-          path: |
-            **/test-results.xml
-            **/*.abilist
-            **/CMakeError.log
-            **/CMakeOutput.log
-            **/crash_diagnostics/*
+  # stage2:
+  #   if: github.repository_owner == 'llvm'
+  #   runs-on: libcxx-runners-8-set
+  #   needs: [ stage1 ]
+  #   continue-on-error: false
+  #   strategy:
+  #     fail-fast: false
+  #     matrix:
+  #       config: [
+  #         'generic-cxx11',
+  #         'generic-cxx14',
+  #         'generic-cxx17',
+  #         'generic-cxx20',
+  #         'generic-cxx23'
+  #       ]
+  #       cc: [ 'clang-19' ]
+  #       cxx: [ 'clang++-19' ]
+  #       include:
+  #         - config: 'generic-gcc-cxx11'
+  #           cc: 'gcc-13'
+  #           cxx: 'g++-13'
+  #         - config: 'generic-cxx23'
+  #           cc: 'clang-17'
+  #           cxx: 'clang++-17'
+  #         - config: 'generic-cxx26'
+  #           cc: 'clang-18'
+  #           cxx: 'clang++-18'
+  #   steps:
+  #     - uses: actions/checkout at v4
+  #     - name: ${{ matrix.config }}
+  #       run: libcxx/utils/ci/run-buildbot ${{ matrix.config }}
+  #       env:
+  #         CC: ${{ matrix.cc }}
+  #         CXX: ${{ matrix.cxx }}
+  #     - uses: actions/upload-artifact at 26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
+  #       if: always()  # Upload artifacts even if the build or test suite fails
+  #       with:
+  #         name: ${{ matrix.config }}-${{ matrix.cxx }}-results
+  #         path: |
+  #           **/test-results.xml
+  #           **/*.abilist
+  #           **/CMakeError.log
+  #           **/CMakeOutput.log
+  #           **/crash_diagnostics/*
 
-  stage3:
-    if: github.repository_owner == 'llvm'
-    needs: [ stage1, stage2 ]
-    continue-on-error: false
-    strategy:
-      fail-fast: false
-      max-parallel: 8
-      matrix:
-        config: [
-          'generic-abi-unstable',
-          'generic-hardening-mode-debug',
-          'generic-hardening-mode-extensive',
-          'generic-hardening-mode-fast',
-          'generic-hardening-mode-fast-with-abi-breaks',
-          'generic-merged',
-          'generic-modules-lsv',
-          'generic-no-exceptions',
-          'generic-no-experimental',
-          'generic-no-filesystem',
-          'generic-no-localization',
-          'generic-no-random_device',
-          'generic-no-threads',
-          'generic-no-tzdb',
-          'generic-no-unicode',
-          'generic-no-wide-characters',
-          'generic-no-rtti',
-          'generic-optimized-speed',
-          'generic-static',
-          # TODO Find a better place for the benchmark and bootstrapping builds to live. They're either very expensive
-          # or don't provide much value since the benchmark run results are too noise on the bots.
-          'benchmarks',
-          'bootstrapping-build'
-        ]
-        machine: [ 'libcxx-runners-8-set' ]
-        include:
-        - config: 'generic-cxx26'
-          machine: libcxx-runners-8-set
-        - config: 'generic-asan'
-          machine: libcxx-runners-8-set
-        - config: 'generic-tsan'
-          machine: libcxx-runners-8-set
-        - config: 'generic-ubsan'
-          machine: libcxx-runners-8-set
-        # Use a larger machine for MSAN to avoid timeout and memory allocation issues.
-        - config: 'generic-msan'
-          machine: libcxx-runners-8-set
-    runs-on: ${{ matrix.machine }}
-    steps:
-      - uses: actions/checkout at v4
-      - name: ${{ matrix.config }}
-        run: libcxx/utils/ci/run-buildbot ${{ matrix.config }}
-        env:
-          CC: clang-19
-          CXX: clang++-19
-      - uses: actions/upload-artifact at 26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
-        if: always()
-        with:
-          name: ${{ matrix.config }}-results
-          path: |
-            **/test-results.xml
-            **/*.abilist
-            **/CMakeError.log
-            **/CMakeOutput.log
-            **/crash_diagnostics/*
+  # stage3:
+  #   if: github.repository_owner == 'llvm'
+  #   needs: [ stage1, stage2 ]
+  #   continue-on-error: false
+  #   strategy:
+  #     fail-fast: false
+  #     max-parallel: 8
+  #     matrix:
+  #       config: [
+  #         'generic-abi-unstable',
+  #         'generic-hardening-mode-debug',
+  #         'generic-hardening-mode-extensive',
+  #         'generic-hardening-mode-fast',
+  #         'generic-hardening-mode-fast-with-abi-breaks',
+  #         'generic-merged',
+  #         'generic-modules-lsv',
+  #         'generic-no-exceptions',
+  #         'generic-no-experimental',
+  #         'generic-no-filesystem',
+  #         'generic-no-localization',
+  #         'generic-no-random_device',
+  #         'generic-no-threads',
+  #         'generic-no-tzdb',
+  #         'generic-no-unicode',
+  #         'generic-no-wide-characters',
+  #         'generic-no-rtti',
+  #         'generic-optimized-speed',
+  #         'generic-static',
+  #         # TODO Find a better place for the benchmark and bootstrapping builds to live. They're either very expensive
+  #         # or don't provide much value since the benchmark run results are too noise on the bots.
+  #         'benchmarks',
+  #         'bootstrapping-build'
+  #       ]
+  #       machine: [ 'libcxx-runners-8-set' ]
+  #       include:
+  #       - config: 'generic-cxx26'
+  #         machine: libcxx-runners-8-set
+  #       - config: 'generic-asan'
+  #         machine: libcxx-runners-8-set
+  #       - config: 'generic-tsan'
+  #         machine: libcxx-runners-8-set
+  #       - config: 'generic-ubsan'
+  #         machine: libcxx-runners-8-set
+  #       # Use a larger machine for MSAN to avoid timeout and memory allocation issues.
+  #       - config: 'generic-msan'
+  #         machine: libcxx-runners-8-set
+  #   runs-on: ${{ matrix.machine }}
+  #   steps:
+  #     - uses: actions/checkout at v4
+  #     - name: ${{ matrix.config }}
+  #       run: libcxx/utils/ci/run-buildbot ${{ matrix.config }}
+  #       env:
+  #         CC: clang-19
+  #         CXX: clang++-19
+  #     - uses: actions/upload-artifact at 26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
+  #       if: always()
+  #       with:
+  #         name: ${{ matrix.config }}-results
+  #         path: |
+  #           **/test-results.xml
+  #           **/*.abilist
+  #           **/CMakeError.log
+  #           **/CMakeOutput.log
+  #           **/crash_diagnostics/*
 
   macos:
     runs-on: macos-14
@@ -225,45 +219,45 @@ jobs:
             **/CMakeOutput.log
             **/crash_diagnostics/*
 
-  windows:
-    runs-on: windows-2022
-    needs: [ stage1 ]
-    strategy:
-      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 }
-    steps:
-      - uses: actions/checkout at v4
-      - name: Install dependencies
-        run: |
-          choco install -y ninja wget
-          pip install psutil
-      - name: Install a current LLVM
-        if: ${{ matrix.mingw != true }}
-        run: |
-          choco install -y llvm --version=17.0.6
-      - name: Install llvm-mingw
-        if: ${{ matrix.mingw == true }}
-        run: |
-          curl -LO https://github.com/mstorsjo/llvm-mingw/releases/download/20231128/llvm-mingw-20231128-ucrt-x86_64.zip
-          powershell Expand-Archive llvm-mingw*.zip -DestinationPath .
-          del llvm-mingw*.zip
-          mv llvm-mingw* c:\llvm-mingw
-          echo "c:\llvm-mingw\bin" | Out-File -FilePath $Env:GITHUB_PATH -Encoding utf8 -Append
-      - name: Add Git Bash to the path
-        run: |
-          echo "c:\Program Files\Git\usr\bin" | Out-File -FilePath $Env:GITHUB_PATH -Encoding utf8 -Append
-      - name: Set up the MSVC dev environment
-        if: ${{ matrix.mingw != true }}
-        uses: ilammy/msvc-dev-cmd at v1
-      - name: Build and test
-        run: |
-          bash libcxx/utils/ci/run-buildbot ${{ matrix.config }}
+  # windows:
+  #   runs-on: windows-2022
+  #   needs: [ stage1 ]
+  #   strategy:
+  #     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 }
+  #   steps:
+  #     - uses: actions/checkout at v4
+  #     - name: Install dependencies
+  #       run: |
+  #         choco install -y ninja wget
+  #         pip install psutil
+  #     - name: Install a current LLVM
+  #       if: ${{ matrix.mingw != true }}
+  #       run: |
+  #         choco install -y llvm --version=17.0.6
+  #     - name: Install llvm-mingw
+  #       if: ${{ matrix.mingw == true }}
+  #       run: |
+  #         curl -LO https://github.com/mstorsjo/llvm-mingw/releases/download/20231128/llvm-mingw-20231128-ucrt-x86_64.zip
+  #         powershell Expand-Archive llvm-mingw*.zip -DestinationPath .
+  #         del llvm-mingw*.zip
+  #         mv llvm-mingw* c:\llvm-mingw
+  #         echo "c:\llvm-mingw\bin" | Out-File -FilePath $Env:GITHUB_PATH -Encoding utf8 -Append
+  #     - name: Add Git Bash to the path
+  #       run: |
+  #         echo "c:\Program Files\Git\usr\bin" | Out-File -FilePath $Env:GITHUB_PATH -Encoding utf8 -Append
+  #     - name: Set up the MSVC dev environment
+  #       if: ${{ matrix.mingw != true }}
+  #       uses: ilammy/msvc-dev-cmd at v1
+  #     - name: Build and test
+  #       run: |
+  #         bash libcxx/utils/ci/run-buildbot ${{ matrix.config }}



More information about the llvm-commits mailing list