Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[libc++][CI] Upgrade compiler HEAD version to Clang-20 #108761

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

robincaloudis
Copy link
Contributor

@robincaloudis robincaloudis commented Sep 15, 2024

Why

The release branch for LLVM 19.x is created (release/19.x) as anounced here. As a result, the version on main is now 20.0.0git. Therefore, we no longer officially support Clang-17, but instead Clang-{18,19,20}.

What

Upgrade HEAD version to Clang-20 in CI configs. Adjustments for libc++ tests and implementations will be done in follow-up patches.

Copy link

github-actions bot commented Sep 15, 2024

✅ With the latest revision this PR passed the Python code formatter.

@robincaloudis robincaloudis force-pushed the rc-ci-clang-20 branch 2 times, most recently from 2fa7cdb to 7c9c19a Compare September 15, 2024 15:35
@robincaloudis robincaloudis changed the title [libc++][CI] Update to Clang-20 [libc++][CI] Upgrade HEAD version to Clang-20 Sep 15, 2024
philnik777 pushed a commit that referenced this pull request Sep 15, 2024
Before changing the compiler version in
#108761, we first of all need
to upgrade the HEAD version to `Clang-20` in the Docker files and push
new builder images to the CI.
@robincaloudis robincaloudis changed the title [libc++][CI] Upgrade HEAD version to Clang-20 [libc++][CI] Upgrade compiler HEAD version to Clang-20 Sep 15, 2024
@robincaloudis robincaloudis force-pushed the rc-ci-clang-20 branch 2 times, most recently from 3e9a7ab to ed34e6d Compare September 15, 2024 18:43
@robincaloudis robincaloudis force-pushed the rc-ci-clang-20 branch 2 times, most recently from 594ee7d to 7161e41 Compare September 19, 2024 19:57
Let's adjust tests and implementation
in a seperate PR.
@robincaloudis robincaloudis marked this pull request as ready for review September 25, 2024 18:19
@robincaloudis robincaloudis requested a review from a team as a code owner September 25, 2024 18:19
@llvmbot llvmbot added libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. github:workflow labels Sep 25, 2024
@llvmbot
Copy link

llvmbot commented Sep 25, 2024

@llvm/pr-subscribers-github-workflow

@llvm/pr-subscribers-libcxx

Author: Robin Caloudis (robincaloudis)

Changes

Why

The release branch for LLVM 19.x is created (release/19.x) as anounced here. As a result, the version on main is now 20.0.0git. Therefore, we no longer officially support Clang-17, but instead Clang-{18,19,20}.

What

Upgrade HEAD version to Clang-20 in CI configs. Adjustments for libc++ tests and implementations will be done in follow-up patches.


Full diff: https://github.com/llvm/llvm-project/pull/108761.diff

4 Files Affected:

  • (modified) .github/workflows/libcxx-build-and-test.yaml (+13-13)
  • (modified) libcxx/docs/index.rst (+1-1)
  • (modified) libcxx/include/__configuration/compiler.h (+2-2)
  • (modified) libcxx/test/libcxx/clang_tidy.gen.py (+4-2)
diff --git a/.github/workflows/libcxx-build-and-test.yaml b/.github/workflows/libcxx-build-and-test.yaml
index b5e60781e00064..426c40cc2f248c 100644
--- a/.github/workflows/libcxx-build-and-test.yaml
+++ b/.github/workflows/libcxx-build-and-test.yaml
@@ -38,11 +38,11 @@ env:
   # LLVM POST-BRANCH bump version
   # LLVM POST-BRANCH add compiler test for ToT - 1, e.g. "Clang 17"
   # LLVM RELEASE bump remove compiler ToT - 3, e.g. "Clang 15"
-  LLVM_HEAD_VERSION: "19"   # Used compiler, update POST-BRANCH.
-  LLVM_PREVIOUS_VERSION: "18"
-  LLVM_OLDEST_VERSION: "17"
+  LLVM_HEAD_VERSION: "20"   # Used compiler, update POST-BRANCH.
+  LLVM_PREVIOUS_VERSION: "19"
+  LLVM_OLDEST_VERSION: "18"
   GCC_STABLE_VERSION: "13"
-  LLVM_SYMBOLIZER_PATH: "/usr/bin/llvm-symbolizer-19"
+  LLVM_SYMBOLIZER_PATH: "/usr/bin/llvm-symbolizer-20"
   CLANG_CRASH_DIAGNOSTICS_DIR: "crash_diagnostics"
 
 
@@ -59,8 +59,8 @@ jobs:
           'generic-cxx26',
           'generic-modules'
         ]
-        cc: [  'clang-19' ]
-        cxx: [ 'clang++-19' ]
+        cc: [  'clang-20' ]
+        cxx: [ 'clang++-20' ]
         include:
           - config: 'generic-gcc'
             cc: 'gcc-14'
@@ -97,18 +97,18 @@ jobs:
           'generic-cxx20',
           'generic-cxx23'
         ]
-        cc: [ 'clang-19' ]
-        cxx: [ 'clang++-19' ]
+        cc: [ 'clang-20' ]
+        cxx: [ 'clang++-20' ]
         include:
           - config: 'generic-gcc-cxx11'
             cc: 'gcc-14'
             cxx: 'g++-14'
-          - config: 'generic-cxx23'
-            cc: 'clang-17'
-            cxx: 'clang++-17'
           - config: 'generic-cxx26'
             cc: 'clang-18'
             cxx: 'clang++-18'
+          - config: 'generic-cxx26'
+            cc: 'clang-19'
+            cxx: 'clang++-19'
     steps:
       - uses: actions/checkout@v4
       - name: ${{ matrix.config }}
@@ -179,8 +179,8 @@ jobs:
       - name: ${{ matrix.config }}
         run: libcxx/utils/ci/run-buildbot ${{ matrix.config }}
         env:
-          CC: clang-19
-          CXX: clang++-19
+          CC: clang-20
+          CXX: clang++-20
       - uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
         if: always()
         with:
diff --git a/libcxx/docs/index.rst b/libcxx/docs/index.rst
index a9610cbb4db3a4..8d076928fe9c7f 100644
--- a/libcxx/docs/index.rst
+++ b/libcxx/docs/index.rst
@@ -130,7 +130,7 @@ velocity, libc++ drops support for older compilers as newer ones are released.
 ============ =============== ========================== =====================
 Compiler     Versions        Restrictions               Support policy
 ============ =============== ========================== =====================
-Clang        17, 18, 19-git                             latest two stable releases per `LLVM's release page <https://releases.llvm.org>`_ and the development version
+Clang        18, 19, 20-git                             latest two stable releases per `LLVM's release page <https://releases.llvm.org>`_ and the development version
 AppleClang   15                                         latest stable release per `Xcode's release page <https://developer.apple.com/documentation/xcode-release-notes>`_
 Open XL      17.1 (AIX)                                 latest stable release per `Open XL's documentation page <https://www.ibm.com/docs/en/openxl-c-and-cpp-aix>`_
 GCC          14              In C++11 or later only     latest stable release per `GCC's release page <https://gcc.gnu.org/releases.html>`_
diff --git a/libcxx/include/__configuration/compiler.h b/libcxx/include/__configuration/compiler.h
index 80ece22bb50bd6..cf459a0619b23c 100644
--- a/libcxx/include/__configuration/compiler.h
+++ b/libcxx/include/__configuration/compiler.h
@@ -33,8 +33,8 @@
 // Warn if a compiler version is used that is not supported anymore
 // LLVM RELEASE Update the minimum compiler versions
 #  if defined(_LIBCPP_CLANG_VER)
-#    if _LIBCPP_CLANG_VER < 1700
-#      warning "Libc++ only supports Clang 17 and later"
+#    if _LIBCPP_CLANG_VER < 1800
+#      warning "Libc++ only supports Clang 18 and later"
 #    endif
 #  elif defined(_LIBCPP_APPLE_CLANG_VER)
 #    if _LIBCPP_APPLE_CLANG_VER < 1500
diff --git a/libcxx/test/libcxx/clang_tidy.gen.py b/libcxx/test/libcxx/clang_tidy.gen.py
index 5e84fbbb9913f3..f4f905f579784f 100644
--- a/libcxx/test/libcxx/clang_tidy.gen.py
+++ b/libcxx/test/libcxx/clang_tidy.gen.py
@@ -18,7 +18,8 @@
 from libcxx.header_information import lit_header_restrictions, public_headers
 
 for header in public_headers:
-  print(f"""\
+    print(
+        f"""\
 //--- {header}.sh.cpp
 
 // REQUIRES: has-clang-tidy
@@ -36,4 +37,5 @@
 // RUN: %{{clang-tidy}} %s --warnings-as-errors=* -header-filter=.* --config-file=%{{libcxx-dir}}/.clang-tidy -- -Wweak-vtables %{{compile_flags}} -fno-modules
 
 #include <{header}>
-""")
+"""
+    )

@robincaloudis robincaloudis marked this pull request as draft September 26, 2024 05:36
@Zingam
Copy link
Contributor

Zingam commented Sep 29, 2024

@robincaloudis The failing tests related to span should be fixed in a separate PR. I'm not sure why they are failing in C++20/23 mode with Clang20 suddenly. Here is a blog post detailing the ordeal: https://quuxplusone.github.io/blog/2021/10/03/p2447-span-from-initializer-list/

@ldionne
Copy link
Member

ldionne commented Oct 1, 2024

I'd like to land #110303 before we tackle any kind of upgrade. That PR will make it a lot easier (and safer) to deploy a new image onto the bots.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
github:workflow libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants