Skip to content

Commit

Permalink
Continued migrating Windows CI/CD to fully use MSYS2
Browse files Browse the repository at this point in the history
  • Loading branch information
IsaacShelton committed Jan 6, 2025
1 parent 7102a8c commit f9752ce
Showing 1 changed file with 16 additions and 55 deletions.
71 changes: 16 additions & 55 deletions .github/workflows/remoteBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,63 +58,19 @@ jobs:
if: matrix.os == 'windows-latest'
shell: msys2 {0}
run: |
echo 'Running in MSYS2!'
./ci-build.sh
- name: Configure to use MinGW-w64 (Windows)
if: matrix.os == 'windows-latest'
shell: bash
run: |
choco upgrade mingw
export CC=C:/ProgramData/mingw64/mingw64/bin/x86_64-w64-mingw32-gcc
export CXX=C:/ProgramData/mingw64/mingw64/bin/x86_64-w64-mingw32-g++
- name: Utilize cached LLVM if available (Windows)
if: matrix.os == 'windows-latest'
uses: actions/cache@v2
id: llvm
with:
path: ${{github.workspace}}/llvm
key: ${{runner.os}}-cache-llvm-project-19.1.6-${{ hashFiles('llvm/**/*.txt') }}
# For some god-forsaken reason, there is no prebuilt version of LLVM for developing on Windows.
# Every version comes with llvm-config, LLVMConfig.cmake, and other files needed, expect Windows!
# Which means we're gonna have to spend an hour or so compiling from scratch (Github willing)
# At least we have ninja
- name: Download LLVM Source Code (Windows)
if: steps.llvm.outputs.cache-hit != 'true' && matrix.os == 'windows-latest'
run: curl -o llvm-source-tree.tar.xz -L https://github.com/llvm/llvm-project/releases/download/llvmorg-19.1.6/llvm-project-19.1.6.src.tar.xz
- name: Extract LLVM Source Code (Windows)
if: steps.llvm.outputs.cache-hit != 'true' && matrix.os == 'windows-latest'
run: |
7z x llvm-source-tree.tar.xz
tar xf llvm-source-tree.tar
mv llvm-project-19.1.6.src llvm
- name: Build LLVM from Source (Windows)
if: steps.llvm.outputs.cache-hit != 'true' && matrix.os == 'windows-latest'
working-directory: ${{github.workspace}}/llvm/llvm
shell: bash
run: |
mkdir build
cmake -B build -DCMAKE_BUILD_TYPE="Release" -G Ninja
cmake --build build
- name: Download and extract libcurl (Windows)
if: ${{ matrix.os == 'windows-latest' }}
shell: bash
run: |
curl -o curl.zip -L https://curl.se/windows/dl-8.2.1_11/curl-8.2.1_11-win64-mingw.zip
unzip curl.zip
mv curl-8.2.1_11-win64-mingw libcurl
- name: Download static zlib libraries (Windows)
if: ${{ matrix.os == 'windows-latest' }}
run: |
C:\msys64\usr\bin\pacman -S mingw-w64-x86_64-zlib --noconfirm
- name: Download zstd library (Windows)
if: ${{ matrix.os == 'windows-latest' }}
run: |
C:\msys64\usr\bin\pacman -S mingw-w64-x86_64-zstd --noconfirm
pacman -S mingw-w64-x86_64-cmake --noconfirm
pacman -S mingw-w64-x86_64-ninja --noconfirm
pacman -S mingw-w64-x86_64-gcc --noconfirm
pacman -S mingw-w64-x86_64-llvm --noconfirm
pacman -S mingw-w64-x86_64-zlib --noconfirm
pacman -S mingw-w64-x86_64-zstd --noconfirm
pacman -S mingw-w64-x86_64-curl --noconfirm
echo 'Dependencies installed successfully'
- name: Configure (Windows)
if: ${{ matrix.os == 'windows-latest' }}
shell: msys2 {0}
run: |
$env:Path = "C:/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin;$env:Path"
cmake -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_PREFIX_PATH="${{github.workspace}}/llvm/llvm/build;C:\msys64\mingw64" -DCMAKE_LIBRARY_PATH=C:\msys64\mingw64\lib -DCURL_LIBRARY=curl -DCURL_LIBRARY_DIRS=${{github.workspace}}/libcurl/lib -DCURL_INCLUDE_DIR=libcurl/include -DADEPT_LINK_LLVM_STATIC=On -B ${{github.workspace}}/build -G Ninja
cmake -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_PREFIX_PATH="${{github.workspace}}/llvm/llvm/build" -DADEPT_LINK_LLVM_STATIC=On -B ${{github.workspace}}/build -G Ninja
env:
LLVM_DIR: ${{github.workspace}}/llvm/llvm/build
zstd_DIR: C:\msys64\mingw64
Expand Down Expand Up @@ -153,7 +109,12 @@ jobs:
env:
LLVM_DIR: /home/linuxbrew/.linuxbrew/opt/llvm
zstd_DIR: /home/linuxbrew/.linuxbrew/opt/zstd
- name: Build
- name: Build (Windows)
shell: msys2 {0}
run: |
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Build (Unix)
if: ${{ matrix.os != 'windows-latest' }}
run: |
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Archive Build Result
Expand Down

0 comments on commit f9752ce

Please sign in to comment.