From 5d5f87eb930c6795adc337daad0c7a6a36f37a76 Mon Sep 17 00:00:00 2001 From: Justin Smith Date: Thu, 30 May 2024 17:04:24 -0400 Subject: [PATCH] Setup LLVM on macos --- .github/workflows/analysis.yml | 1 + .github/workflows/cross.yml | 16 ++++++++++++++ .github/workflows/integration.yml | 19 ++++++++++++++++ .github/workflows/tests.yml | 36 +++++++++++++++++++++++++++++++ 4 files changed, 72 insertions(+) diff --git a/.github/workflows/analysis.yml b/.github/workflows/analysis.yml index 94a5279aaad..b480952213d 100644 --- a/.github/workflows/analysis.yml +++ b/.github/workflows/analysis.yml @@ -246,6 +246,7 @@ jobs: submodules: 'recursive' lfs: true - uses: dtolnay/rust-toolchain@master + id: toolchain with: toolchain: ${{ env.RUST_NIGHTLY_TOOLCHAIN }} - name: Set Rust toolchain override diff --git a/.github/workflows/cross.yml b/.github/workflows/cross.yml index 4674b710ace..d11b2799393 100644 --- a/.github/workflows/cross.yml +++ b/.github/workflows/cross.yml @@ -76,6 +76,14 @@ jobs: - uses: actions/checkout@v3 with: submodules: 'recursive' + - run: | + brew install llvm + echo 'export PATH="/opt/homebrew/opt/llvm/bin:$PATH"' + echo 'export LIBCLANG_PATH=/opt/homebrew/opt/llvm' >> "$GITHUB_ENV" + echo 'export DYLD_LIBRARY_PATH="/opt/homebrew/opt/llvm/lib:$DYLD_LIBRARY_PATH"' >> "$GITHUB_ENV" + echo 'export LDFLAGS="-L/opt/homebrew/opt/llvm/lib $LD_FLAGS"' >> "$GITHUB_ENV" + echo 'export CPPFLAGS="-I/opt/homebrew/opt/llvm/include $CPPFLAGS"' >> "$GITHUB_ENV" + echo 'export CFLAGS="-I/opt/homebrew/opt/llvm/include $CFLAGS"' >> "$GITHUB_ENV" - uses: dtolnay/rust-toolchain@master id: toolchain with: @@ -94,6 +102,14 @@ jobs: - uses: actions/checkout@v3 with: submodules: 'recursive' + - run: | + brew install llvm + echo 'export PATH="/opt/homebrew/opt/llvm/bin:$PATH"' + echo 'export LIBCLANG_PATH=/opt/homebrew/opt/llvm' >> "$GITHUB_ENV" + echo 'export DYLD_LIBRARY_PATH="/opt/homebrew/opt/llvm/lib:$DYLD_LIBRARY_PATH"' >> "$GITHUB_ENV" + echo 'export LDFLAGS="-L/opt/homebrew/opt/llvm/lib $LD_FLAGS"' >> "$GITHUB_ENV" + echo 'export CPPFLAGS="-I/opt/homebrew/opt/llvm/include $CPPFLAGS"' >> "$GITHUB_ENV" + echo 'export CFLAGS="-I/opt/homebrew/opt/llvm/include $CFLAGS"' >> "$GITHUB_ENV" - uses: dtolnay/rust-toolchain@master id: toolchain with: diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index e47d98aadf1..f3e2637e443 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -155,6 +155,25 @@ jobs: submodules: 'recursive' lfs: true + - if: ${{ matrix.os == 'macos-13-xlarge' }} + run: | + brew install llvm + echo 'export PATH="/opt/homebrew/opt/llvm/bin:$PATH"' + echo 'export LIBCLANG_PATH=/opt/homebrew/opt/llvm' >> "$GITHUB_ENV" + echo 'export DYLD_LIBRARY_PATH="/opt/homebrew/opt/llvm/lib:$DYLD_LIBRARY_PATH"' >> "$GITHUB_ENV" + echo 'export LDFLAGS="-L/opt/homebrew/opt/llvm/lib $LD_FLAGS"' >> "$GITHUB_ENV" + echo 'export CPPFLAGS="-I/opt/homebrew/opt/llvm/include $CPPFLAGS"' >> "$GITHUB_ENV" + echo 'export CFLAGS="-I/opt/homebrew/opt/llvm/include $CFLAGS"' >> "$GITHUB_ENV" + - if: ${{ matrix.os == 'macos-12' }} + run: | + brew install llvm + echo 'export PATH="/usr/local/opt/llvm/bin:$PATH"' + echo 'export LIBCLANG_PATH=/usr/local/opt/llvm' >> "$GITHUB_ENV" + echo 'export DYLD_LIBRARY_PATH="/usr/local/opt/llvm/lib:$DYLD_LIBRARY_PATH"' >> "$GITHUB_ENV" + echo 'export LDFLAGS="-L/usr/local/opt/llvm/lib $LD_FLAGS"' >> "$GITHUB_ENV" + echo 'export CPPFLAGS="-I/usr/local/opt/llvm/include $CPPFLAGS"' >> "$GITHUB_ENV" + echo 'export CFLAGS="-I/usr/local/opt/llvm/include $CFLAGS"' >> "$GITHUB_ENV" + - name: Install NASM on Windows if: runner.os == 'Windows' uses: ilammy/setup-nasm@v1 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a561ed56b85..50da42a2273 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -69,6 +69,24 @@ jobs: - uses: actions/checkout@v3 with: submodules: 'recursive' + - if: ${{ matrix.os == 'macos-13-xlarge' }} + run: | + brew install llvm + echo 'export PATH="/opt/homebrew/opt/llvm/bin:$PATH"' + echo 'export LIBCLANG_PATH=/opt/homebrew/opt/llvm' >> "$GITHUB_ENV" + echo 'export DYLD_LIBRARY_PATH="/opt/homebrew/opt/llvm/lib:$DYLD_LIBRARY_PATH"' >> "$GITHUB_ENV" + echo 'export LDFLAGS="-L/opt/homebrew/opt/llvm/lib $LD_FLAGS"' >> "$GITHUB_ENV" + echo 'export CPPFLAGS="-I/opt/homebrew/opt/llvm/include $CPPFLAGS"' >> "$GITHUB_ENV" + echo 'export CFLAGS="-I/opt/homebrew/opt/llvm/include $CFLAGS"' >> "$GITHUB_ENV" + - if: ${{ matrix.os == 'macos-12' }} + run: | + brew install llvm + echo 'export PATH="/usr/local/opt/llvm/bin:$PATH"' + echo 'export LIBCLANG_PATH=/usr/local/opt/llvm' >> "$GITHUB_ENV" + echo 'export DYLD_LIBRARY_PATH="/usr/local/opt/llvm/lib:$DYLD_LIBRARY_PATH"' >> "$GITHUB_ENV" + echo 'export LDFLAGS="-L/usr/local/opt/llvm/lib $LD_FLAGS"' >> "$GITHUB_ENV" + echo 'export CPPFLAGS="-I/usr/local/opt/llvm/include $CPPFLAGS"' >> "$GITHUB_ENV" + echo 'export CFLAGS="-I/usr/local/opt/llvm/include $CFLAGS"' >> "$GITHUB_ENV" - uses: dtolnay/rust-toolchain@master id: toolchain with: @@ -376,6 +394,24 @@ jobs: id: toolchain with: toolchain: ${{ env.RUST_NIGHTLY_TOOLCHAIN }} + - if: ${{ matrix.os == 'macos-13-xlarge' }} + run: | + brew install llvm + echo 'export PATH="/opt/homebrew/opt/llvm/bin:$PATH"' + echo 'export LIBCLANG_PATH=/opt/homebrew/opt/llvm' >> "$GITHUB_ENV" + echo 'export DYLD_LIBRARY_PATH="/opt/homebrew/opt/llvm/lib:$DYLD_LIBRARY_PATH"' >> "$GITHUB_ENV" + echo 'export LDFLAGS="-L/opt/homebrew/opt/llvm/lib $LD_FLAGS"' >> "$GITHUB_ENV" + echo 'export CPPFLAGS="-I/opt/homebrew/opt/llvm/include $CPPFLAGS"' >> "$GITHUB_ENV" + echo 'export CFLAGS="-I/opt/homebrew/opt/llvm/include $CFLAGS"' >> "$GITHUB_ENV" + - if: ${{ matrix.os == 'macos-12' }} + run: | + brew install llvm + echo 'export PATH="/usr/local/opt/llvm/bin:$PATH"' + echo 'export LIBCLANG_PATH=/usr/local/opt/llvm' >> "$GITHUB_ENV" + echo 'export DYLD_LIBRARY_PATH="/usr/local/opt/llvm/lib:$DYLD_LIBRARY_PATH"' >> "$GITHUB_ENV" + echo 'export LDFLAGS="-L/usr/local/opt/llvm/lib $LD_FLAGS"' >> "$GITHUB_ENV" + echo 'export CPPFLAGS="-I/usr/local/opt/llvm/include $CPPFLAGS"' >> "$GITHUB_ENV" + echo 'export CFLAGS="-I/usr/local/opt/llvm/include $CFLAGS"' >> "$GITHUB_ENV" - name: Set Rust toolchain override run: rustup override set ${{ steps.toolchain.outputs.name }} - name: Install cargo-careful