From 86e6f817ed7101f647767da00b09b7865cdb2de7 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Sun, 7 Apr 2024 13:54:30 +0300 Subject: [PATCH] Update GHA config to use libstdc++-11 with clang-13 through 15. clang-12 through 15 do not fully support C++23, so it is not compatible with libstdc++-13 in this mode. GHA config is enabling C++23 only since clang-13, so update clang-13 through 15 jobs to use libstdc++-11. --- .github/workflows/ci.yml | 40 +++++++++++++++++++++++++++++++++++----- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9fae7dd68..67bbd9348 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -108,6 +108,7 @@ jobs: cxxstd: "11,14,17,2a" os: ubuntu-20.04 install: clang-11 + # Note: clang-12 through 15 do not fully support C++23, so it is not compatible with libstdc++-13 in this mode - toolset: clang compiler: clang++-12 cxxstd: "11,14,17,2a" @@ -117,17 +118,26 @@ jobs: compiler: clang++-13 cxxstd: "11,14,17,20,2b" os: ubuntu-22.04 - install: clang-13 + install: + - clang-13 + - g++-11 + gcc_toolchain: 11 - toolset: clang compiler: clang++-14 cxxstd: "11,14,17,20,2b" os: ubuntu-22.04 - install: clang-14 + install: + - clang-14 + - g++-11 + gcc_toolchain: 11 - toolset: clang compiler: clang++-15 cxxstd: "11,14,17,20,2b" os: ubuntu-22.04 - install: clang-15 + install: + - clang-15 + - g++-11 + gcc_toolchain: 11 - toolset: clang compiler: clang++-16 cxxstd: "11,14,17,20,2b" @@ -164,7 +174,19 @@ jobs: if: matrix.install run: | sudo apt-get update - sudo apt-get -y install ${{matrix.install}} + sudo apt-get -y install ${{join(matrix.install, ' ')}} + + - name: Setup GCC Toolchain + if: matrix.gcc_toolchain + run: | + GCC_TOOLCHAIN_ROOT="$HOME/gcc-toolchain" + echo "GCC_TOOLCHAIN_ROOT=\"$GCC_TOOLCHAIN_ROOT\"" >> $GITHUB_ENV + MULTIARCH_TRIPLET="$(dpkg-architecture -qDEB_HOST_MULTIARCH)" + mkdir -p "$GCC_TOOLCHAIN_ROOT" + ln -s /usr/include "$GCC_TOOLCHAIN_ROOT/include" + ln -s /usr/bin "$GCC_TOOLCHAIN_ROOT/bin" + mkdir -p "$GCC_TOOLCHAIN_ROOT/lib/gcc/$MULTIARCH_TRIPLET" + ln -s "/usr/lib/gcc/$MULTIARCH_TRIPLET/${{matrix.gcc_toolchain}}" "$GCC_TOOLCHAIN_ROOT/lib/gcc/$MULTIARCH_TRIPLET/${{matrix.gcc_toolchain}}" - name: Setup Boost run: | @@ -191,7 +213,15 @@ jobs: - name: Create user-config.jam if: matrix.compiler run: | - echo "using ${{matrix.toolset}} : : ${{matrix.compiler}} ;" > ~/user-config.jam + if [ -n "${{matrix.compiler}}" -o -n "$GCC_TOOLCHAIN_ROOT" ] + then + echo -n "using ${{matrix.toolset}} : : ${{matrix.compiler}}" > ~/user-config.jam + if [ -n "$GCC_TOOLCHAIN_ROOT" ] + then + echo -n " : \"--gcc-toolchain=$GCC_TOOLCHAIN_ROOT\" \"--gcc-toolchain=$GCC_TOOLCHAIN_ROOT\"" >> ~/user-config.jam + fi + echo " ;" >> ~/user-config.jam + fi - name: Run tests run: |