diff --git a/.github/workflows/format-check-new.yml b/.github/workflows/format-check-new.yml index 8fbfcf315..a885cd36b 100644 --- a/.github/workflows/format-check-new.yml +++ b/.github/workflows/format-check-new.yml @@ -11,6 +11,18 @@ jobs: - uses: actions/checkout@v3 + - name: Install clang-format 18.1.8 + run: | + # Install dependencies + sudo apt-get update + sudo apt-get install -y libtinfo5 + # Download clang-format 18.1.8 + wget https://github.com/llvm/llvm-project/releases/download/llvmorg-18.1.8/clang%2Bllvm-18.1.8-x86_64-linux-gnu-ubuntu-18.04.tar.xz + tar -xf clang+llvm-18.1.8-x86_64-linux-gnu-ubuntu-18.04.tar.xz + # Use only clang-format from the package + sudo cp clang+llvm-18.1.8-x86_64-linux-gnu-ubuntu-18.04/bin/clang-format /usr/local/bin/clang-format + sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/local/bin/clang-format 100 + - name: Install dotnet uses: actions/setup-dotnet@v3 with: diff --git a/.github/workflows/test-clang-install.yml b/.github/workflows/test-clang-install.yml index dd88fa0b5..9cbdd49b9 100644 --- a/.github/workflows/test-clang-install.yml +++ b/.github/workflows/test-clang-install.yml @@ -14,9 +14,13 @@ jobs: echo "=== System info ===" lsb_release -a echo "" + echo "=== Available libtinfo packages ===" + apt-cache search libtinfo | grep -E "^libtinfo[0-9]* " || true + echo "" echo "=== Installing dependencies ===" sudo apt-get update - sudo apt-get install -y libtinfo5 + # Try libtinfo6 first (newer), fall back to libtinfo5 + sudo apt-get install -y libtinfo6 || sudo apt-get install -y libtinfo5 echo "" echo "=== Downloading clang-format 18.1.8 ===" wget https://github.com/llvm/llvm-project/releases/download/llvmorg-18.1.8/clang%2Bllvm-18.1.8-x86_64-linux-gnu-ubuntu-18.04.tar.xz @@ -25,7 +29,15 @@ jobs: tar -xf clang+llvm-18.1.8-x86_64-linux-gnu-ubuntu-18.04.tar.xz echo "" echo "=== Testing clang-format ===" - ./clang+llvm-18.1.8-x86_64-linux-gnu-ubuntu-18.04/bin/clang-format --version + # First check what libraries it needs + ldd ./clang+llvm-18.1.8-x86_64-linux-gnu-ubuntu-18.04/bin/clang-format || true + echo "" + # Try to run it + ./clang+llvm-18.1.8-x86_64-linux-gnu-ubuntu-18.04/bin/clang-format --version || { + echo "Failed to run, trying with symlink..." + sudo ln -sf /usr/lib/x86_64-linux-gnu/libtinfo.so.6 /usr/lib/x86_64-linux-gnu/libtinfo.so.5 + ./clang+llvm-18.1.8-x86_64-linux-gnu-ubuntu-18.04/bin/clang-format --version + } echo "" echo "=== Testing formatting ===" echo 'class Test { Test() {}; };' | ./clang+llvm-18.1.8-x86_64-linux-gnu-ubuntu-18.04/bin/clang-format @@ -38,9 +50,13 @@ jobs: echo "=== System info ===" lsb_release -a echo "" + echo "=== Available libtinfo packages ===" + apt-cache search libtinfo | grep -E "^libtinfo[0-9]* " || true + echo "" echo "=== Installing dependencies ===" sudo apt-get update - sudo apt-get install -y libtinfo5 + # Try libtinfo6 first (newer), fall back to libtinfo5 + sudo apt-get install -y libtinfo6 || sudo apt-get install -y libtinfo5 echo "" echo "=== Downloading clang-format 18.1.8 ===" wget https://github.com/llvm/llvm-project/releases/download/llvmorg-18.1.8/clang%2Bllvm-18.1.8-x86_64-linux-gnu-ubuntu-18.04.tar.xz @@ -49,7 +65,15 @@ jobs: tar -xf clang+llvm-18.1.8-x86_64-linux-gnu-ubuntu-18.04.tar.xz echo "" echo "=== Testing clang-format ===" - ./clang+llvm-18.1.8-x86_64-linux-gnu-ubuntu-18.04/bin/clang-format --version + # First check what libraries it needs + ldd ./clang+llvm-18.1.8-x86_64-linux-gnu-ubuntu-18.04/bin/clang-format || true + echo "" + # Try to run it + ./clang+llvm-18.1.8-x86_64-linux-gnu-ubuntu-18.04/bin/clang-format --version || { + echo "Failed to run, trying with symlink..." + sudo ln -sf /usr/lib/x86_64-linux-gnu/libtinfo.so.6 /usr/lib/x86_64-linux-gnu/libtinfo.so.5 + ./clang+llvm-18.1.8-x86_64-linux-gnu-ubuntu-18.04/bin/clang-format --version + } echo "" echo "=== Testing formatting ===" echo 'class Test { Test() {}; };' | ./clang+llvm-18.1.8-x86_64-linux-gnu-ubuntu-18.04/bin/clang-format \ No newline at end of file