|
|
@@ -22,22 +22,48 @@ runs:
|
|
|
# to save time.
|
|
|
large-packages: false
|
|
|
|
|
|
- - name: Show system LLVM and Clang installation
|
|
|
- shell: bash
|
|
|
- run: |
|
|
|
- dpkg -l '*clang*' '*llvm*'
|
|
|
+ # Cache and install a recent version of LLVM. This uses the GitHub action
|
|
|
+ # cache to avoid directly downloading on each iteration and improve
|
|
|
+ # reliability.
|
|
|
+ - name: Cache LLVM and Clang installation
|
|
|
+ id: cache-llvm-ubuntu
|
|
|
+ uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
|
|
|
+ with:
|
|
|
+ path: ~/llvm
|
|
|
+ key: LLVM-19.1.7-Cache-ubuntu-${{ runner.arch }}
|
|
|
|
|
|
- # Install a recent version of LLVM. We use LLVM's apt.llvm.org in order to
|
|
|
- # have access to all released versions, instead of the GitHub releases which
|
|
|
- # are often missing binaries for ubuntu x64.
|
|
|
- name: Download LLVM and Clang installation
|
|
|
- env:
|
|
|
- clang_version: 19
|
|
|
+ if: steps.cache-llvm-ubuntu.outputs.cache-hit != 'true'
|
|
|
shell: bash
|
|
|
run: |
|
|
|
- echo '*** Installing upstream clang packages'
|
|
|
- wget https://apt.llvm.org/llvm.sh
|
|
|
- chmod +x llvm.sh
|
|
|
- sudo ./llvm.sh ${clang_version} all
|
|
|
+ cd ~
|
|
|
+ LLVM_RELEASE=19.1.7
|
|
|
+ LLVM_TARBALL_NAME=LLVM-$LLVM_RELEASE-Linux-X64
|
|
|
+ LLVM_PATH=~/llvm
|
|
|
+ echo "*** Downloading $LLVM_RELEASE"
|
|
|
+ wget --show-progress=off "https://github.com/llvm/llvm-project/releases/download/llvmorg-$LLVM_RELEASE/$LLVM_TARBALL_NAME.tar.xz"
|
|
|
+ echo "*** Extracting $LLVM_TARBALL_NAME.tar.xz"
|
|
|
+ mkdir $LLVM_PATH
|
|
|
+ tar -xJf $LLVM_TARBALL_NAME.tar.xz --strip-components=1 -C $LLVM_PATH
|
|
|
+ echo "*** Deleting $LLVM_TARBALL_NAME.tar.xz"
|
|
|
+ rm $LLVM_TARBALL_NAME.tar.xz
|
|
|
+ echo "*** Testing `clang++ --version`"
|
|
|
+ $LLVM_PATH/bin/clang++ --version
|
|
|
+ # The installation contains *huge* parts of LLVM we don't need for the
|
|
|
+ # toolchain. Prune them here to keep our cache small.
|
|
|
+ echo "*** Cleaning the 'llvm' directory"
|
|
|
+ rm $LLVM_PATH/lib/{*.a,*.so,*.so.*}
|
|
|
+ rm $LLVM_PATH/bin/{flang-*,mlir-*,clang-{scan-deps,check,repl},*-test,llvm-{lto*,reduce,bolt*,exegesis,jitlink},bugpoint,opt,llc}
|
|
|
+ echo "*** Size of the 'llvm' directory"
|
|
|
+ du -hs $LLVM_PATH
|
|
|
|
|
|
- echo "/lib/llvm-19/bin" >> "$GITHUB_PATH"
|
|
|
+ - name: Setup LLVM and Clang paths
|
|
|
+ shell: bash
|
|
|
+ run: |
|
|
|
+ LLVM_PATH=~/llvm
|
|
|
+ echo "Using ${LLVM_PATH}"
|
|
|
+ echo "${LLVM_PATH}/bin" >> $GITHUB_PATH
|
|
|
+ echo '*** ls "${LLVM_PATH}"'
|
|
|
+ ls "${LLVM_PATH}"
|
|
|
+ echo '*** ls "${LLVM_PATH}/bin"'
|
|
|
+ ls "${LLVM_PATH}/bin"
|