From bd500fa580f5f406ef50b870c59316bf448c66f5 Mon Sep 17 00:00:00 2001 From: Sean Young Date: Fri, 8 Dec 2023 08:35:44 +0000 Subject: [PATCH] Move to llvm 16 Signed-off-by: Sean Young --- .github/Dockerfile | 13 +++---- .github/workflows/build-llvm.yml | 62 +++++++++++++++++--------------- .github/workflows/ci-image.yml | 2 +- 3 files changed, 41 insertions(+), 36 deletions(-) diff --git a/.github/Dockerfile b/.github/Dockerfile index 80ca1e8..70f0e6c 100644 --- a/.github/Dockerfile +++ b/.github/Dockerfile @@ -8,19 +8,20 @@ RUN apt-get update -y && \ apt-get upgrade -y && \ apt-get install -y libz-dev pkg-config libssl-dev git cmake ninja-build gcc g++ python3 file -RUN git clone --single-branch --branch solana-rustc/15.0-2022-12-07 \ +RUN git clone --single-branch --branch solana-rustc/16.0-2023-06-05 \ https://github.com/solana-labs/llvm-project.git WORKDIR /llvm-project RUN cmake -G Ninja -DLLVM_ENABLE_ASSERTIONS=On -DLLVM_ENABLE_TERMINFO=Off \ -DLLVM_ENABLE_PROJECTS=clang\;lld \ - -DLLVM_TARGETS_TO_BUILD=WebAssembly\;SBF \ + -DLLVM_TARGETS_TO_BUILD=WebAssembly \ + -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=SBF \ -DLLVM_ENABLE_ZSTD=Off \ - -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=/llvm15.0 llvm + -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=/llvm16.0 llvm RUN cmake --build . --target install && \ - find /llvm15.0/ -type f -executable -exec sh -c "file '{}' | grep -q 'not stripped' " \; -print | xargs strip + find /llvm16.0/ -type f -executable -exec sh -c "file '{}' | grep -q 'not stripped' " \; -print | xargs strip FROM ubuntu:20.04 @@ -33,9 +34,9 @@ RUN apt-get update && \ # Get Rust RUN curl https://sh.rustup.rs -sSf | bash -s -- -y --default-toolchain 1.72.0 --profile minimal -COPY --from=builder /llvm15.0 /llvm15.0/ +COPY --from=builder /llvm16.0 /llvm16.0/ -ENV PATH="/llvm15.0/bin:/root/.cargo/bin:/root/.local/share/solana/install/active_release/bin:${PATH}" +ENV PATH="/llvm16.0/bin:/root/.cargo/bin:/root/.local/share/solana/install/active_release/bin:${PATH}" # Install Solana (x86-64 only, does not work on arm) RUN if test `arch` = x86_64; then \ diff --git a/.github/workflows/build-llvm.yml b/.github/workflows/build-llvm.yml index 18fb822..d92d757 100644 --- a/.github/workflows/build-llvm.yml +++ b/.github/workflows/build-llvm.yml @@ -14,25 +14,26 @@ jobs: uses: actions/checkout@v3.1.0 with: submodules: recursive - - run: git clone --depth 1 --branch solana-rustc/15.0-2022-12-07 https://github.com/solana-labs/llvm-project.git + - run: git clone --depth 1 --branch solana-rustc/16.0-2023-06-05 https://github.com/solana-labs/llvm-project.git - name: Install Ninja uses: llvm/actions/install-ninja@main - run: cmake -G Ninja -DLLVM_ENABLE_ASSERTIONS=On -DLLVM_ENABLE_TERMINFO=Off -DLLVM_ENABLE_LIBXML2=Off -DLLVM_ENABLE_ZLIB=Off -DLLVM_ENABLE_PROJECTS='clang;lld' - -DLLVM_TARGETS_TO_BUILD='WebAssembly;SBF' + -DLLVM_TARGETS_TO_BUILD='WebAssembly' + -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=SBF -DLLVM_ENABLE_ZSTD=Off - -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=../llvm15.0 llvm + -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=../llvm16.0 llvm working-directory: ./llvm-project/ - run: cmake --build . --target install working-directory: ./llvm-project/ - - run: tar Jcf ./llvm15.0-linux-x86-64.tar.xz ./llvm15.0/ + - run: tar Jcf ./llvm16.0-linux-x86-64.tar.xz ./llvm16.0/ - name: Upload llvm uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: llvm15.0-linux-x86-64.tar.xz - asset_name: llvm15.0-linux-x86-64.tar.xz + file: llvm16.0-linux-x86-64.tar.xz + asset_name: llvm16.0-linux-x86-64.tar.xz tag: ${{ github.ref }} linux-arm64: @@ -44,23 +45,24 @@ jobs: uses: actions/checkout@v3.1.0 with: submodules: recursive - - run: git clone --depth 1 --branch solana-rustc/15.0-2022-12-07 https://github.com/solana-labs/llvm-project.git + - run: git clone --depth 1 --branch solana-rustc/16.0-2023-06-05 https://github.com/solana-labs/llvm-project.git - run: cmake -G Ninja -DLLVM_ENABLE_ASSERTIONS=On -DLLVM_ENABLE_TERMINFO=Off -DLLVM_ENABLE_LIBXML2=Off -DLLVM_ENABLE_ZLIB=Off -DLLVM_ENABLE_PROJECTS='clang;lld' - -DLLVM_TARGETS_TO_BUILD='WebAssembly;SBF' + -DLLVM_TARGETS_TO_BUILD='WebAssembly' + -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=SBF -DLLVM_ENABLE_ZSTD=Off - -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=../llvm15.0 llvm + -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=../llvm16.0 llvm working-directory: ./llvm-project/ - run: cmake --build . --target install working-directory: ./llvm-project/ - - run: tar Jcf ./llvm15.0-linux-arm64.tar.xz ./llvm15.0/ + - run: tar Jcf ./llvm16.0-linux-arm64.tar.xz ./llvm16.0/ - name: Upload llvm uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: llvm15.0-linux-arm64.tar.xz - asset_name: llvm15.0-linux-arm64.tar.xz + file: llvm16.0-linux-arm64.tar.xz + asset_name: llvm16.0-linux-arm64.tar.xz tag: ${{ github.ref }} windows: @@ -72,7 +74,7 @@ jobs: with: submodules: recursive - uses: dtolnay/rust-toolchain@1.64.0 - - run: git clone --depth 1 --branch solana-rustc/15.0-2022-12-07 https://github.com/solana-labs/llvm-project.git + - run: git clone --depth 1 --branch solana-rustc/16.0-2023-06-05 https://github.com/solana-labs/llvm-project.git # We may not have enough space to compile llvm, see https://github.com/actions/virtual-environments/issues/326 working-directory: C:\ - name: Setup Windows @@ -85,17 +87,17 @@ jobs: -DLLVM_ENABLE_LIBXML2=Off -DLLVM_ENABLE_ZLIB=Off -DLLVM_ENABLE_PROJECTS='clang;lld' -DLLVM_ENABLE_ZSTD=Off - -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=C:/llvm15.0 llvm + -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=C:/llvm16.0 llvm working-directory: C:\llvm-project - run: cmake --build . --target install working-directory: C:\llvm-project - - run: Compress-Archive -Path C:\llvm15.0 -DestinationPath C:\llvm15.0-win.zip + - run: Compress-Archive -Path C:\llvm16.0 -DestinationPath C:\llvm16.0-win.zip - name: Upload llvm uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: C:\llvm15.0-win.zip - asset_name: llvm15.0-win.zip + file: C:\llvm16.0-win.zip + asset_name: llvm16.0-win.zip tag: ${{ github.ref }} mac-arm: @@ -107,25 +109,26 @@ jobs: with: submodules: recursive - uses: dtolnay/rust-toolchain@1.64.0 - - run: git clone --depth 1 --branch solana-rustc/15.0-2022-12-07 https://github.com/solana-labs/llvm-project.git + - run: git clone --depth 1 --branch solana-rustc/16.0-2023-06-05 https://github.com/solana-labs/llvm-project.git - name: Install Ninja uses: llvm/actions/install-ninja@main - run: cmake -G Ninja -DLLVM_ENABLE_ASSERTIONS=On -DLLVM_ENABLE_TERMINFO=Off -DLLVM_ENABLE_LIBXML2=Off -DLLVM_ENABLE_ZLIB=Off -DLLVM_ENABLE_PROJECTS='clang;lld' - -DLLVM_TARGETS_TO_BUILD='WebAssembly;SBF' + -DLLVM_TARGETS_TO_BUILD='WebAssembly' + -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=SBF -DLLVM_ENABLE_ZSTD=Off - -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=../llvm15.0 llvm + -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=../llvm16.0 llvm working-directory: ./llvm-project/ - run: cmake --build . --target install working-directory: ./llvm-project/ - - run: tar Jcf ./llvm15.0-mac-arm.tar.xz ./llvm15.0/ + - run: tar Jcf ./llvm16.0-mac-arm.tar.xz ./llvm16.0/ - name: Upload llvm uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: llvm15.0-mac-arm.tar.xz - asset_name: llvm15.0-mac-arm.tar.xz + file: llvm16.0-mac-arm.tar.xz + asset_name: llvm16.0-mac-arm.tar.xz tag: ${{ github.ref }} mac-intel: @@ -140,23 +143,24 @@ jobs: with: submodules: recursive - uses: dtolnay/rust-toolchain@1.64.0 - - run: git clone --depth 1 --branch solana-rustc/15.0-2022-12-07 https://github.com/solana-labs/llvm-project.git + - run: git clone --depth 1 --branch solana-rustc/16.0-2023-06-05 https://github.com/solana-labs/llvm-project.git - name: Install Ninja uses: llvm/actions/install-ninja@main - run: cmake -G Ninja -DLLVM_ENABLE_ASSERTIONS=On -DLLVM_ENABLE_TERMINFO=Off -DLLVM_ENABLE_LIBXML2=Off -DLLVM_ENABLE_ZLIB=Off -DLLVM_ENABLE_PROJECTS='clang;lld' - -DLLVM_TARGETS_TO_BUILD='WebAssembly;SBF' + -DLLVM_TARGETS_TO_BUILD='WebAssembly' + -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=SBF -DLLVM_ENABLE_ZSTD=Off - -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=../llvm15.0 llvm + -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=../llvm16.0 llvm working-directory: ./llvm-project/ - run: cmake --build . --target install working-directory: ./llvm-project/ - - run: tar Jcf ./llvm15.0-mac-intel.tar.xz ./llvm15.0/ + - run: tar Jcf ./llvm16.0-mac-intel.tar.xz ./llvm16.0/ - name: Upload llvm uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: llvm15.0-mac-intel.tar.xz - asset_name: llvm15.0-mac-intel.tar.xz + file: llvm16.0-mac-intel.tar.xz + asset_name: llvm16.0-mac-intel.tar.xz tag: ${{ github.ref }} diff --git a/.github/workflows/ci-image.yml b/.github/workflows/ci-image.yml index 25580dd..df630c1 100644 --- a/.github/workflows/ci-image.yml +++ b/.github/workflows/ci-image.yml @@ -8,4 +8,4 @@ jobs: uses: actions/checkout@v3.1.0 - run: | echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin - docker buildx build --provenance=false --platform linux/amd64,linux/arm64 -t ghcr.io/${GITHUB_REPOSITORY}:ci-6 --push .github + docker buildx build --provenance=false --platform linux/amd64,linux/arm64 -t ghcr.io/${GITHUB_REPOSITORY}:ci-7 --push .github