Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup initial workflow for building on Windows. #73

Merged
merged 9 commits into from
Feb 13, 2025
78 changes: 78 additions & 0 deletions .github/workflows/build_windows_packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Build Windows Packages

on:
workflow_dispatch:
inputs:
package_version:
type: string
default: ADHOCBUILD

workflow_call:
inputs:
package_version:
type: string
default: ADHOCBUILD

jobs:
build_windows_packages:
name: Build Windows Packages
runs-on: windows-2022 # TODO(#36): move to cluster of CPU builders like `azure-windows-scale-nod-ai`
defaults:
run:
shell: bash
strategy:
fail-fast: true
steps:
- name: Enabling git symlinks
run: git config --global core.symlinks true
- name: "Checking out repository"
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: "3.12"

- name: Install ninja
run: choco install ninja --yes

- name: Fetch sources
run: |
git config --global user.email "[email protected]"
git config --global user.name "Nobody"
python ./build_tools/fetch_sources.py --depth 1
# TODO(scotttodd): Get symlinks working on CI runners instead of this
- name: Replace symlinks with copies
run: ./build_tools/patch_symlinks_for_windows_ci.sh

- name: Configure MSVC
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0

# TODO: We shouldn't be using a cache on actual release branches, but it
# really helps for iteration time.
- name: Setup ccache
uses: hendrikmuhs/ccache-action@53911442209d5c18de8a31615e0923161e435875 # v1.2.16
with:
key: windows-build-packages-v1

- name: Configure Projects
run: |
# Generate a new build id.
package_version="${{ inputs.package_version }}"
echo "Building package ${package_version}"

# Build.
cmake -B build -GNinja . \
-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DTHEROCK_AMDGPU_FAMILIES=gfx110X-dgpu \
-DTHEROCK_PACKAGE_VERSION="${package_version}" \
-DTHEROCK_ENABLE_CORE=OFF \
-DTHEROCK_ENABLE_COMM_LIBS=OFF \
-DTHEROCK_ENABLE_MATH_LIBS=OFF \
-DTHEROCK_ENABLE_ML_LIBS=OFF

- name: Build Projects
run: cmake --build build
Comment on lines +72 to +73
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Argh, more download flakes: https://github.com/nod-ai/TheRock/actions/runs/13190519640/job/36822474141?pr=73#step:11:765

[53/72] Stage installing sub-project therock-eigen
-- Install configuration: "Release"
[54/72] Performing download step (download, verify and extract) for 'therock-FunctionalPlus-sources'
FAILED: third-party/FunctionalPlus/therock-FunctionalPlus-sources_fetch/src/therock-FunctionalPlus-sources-stamp/therock-FunctionalPlus-sources-download D:/a/TheRock/TheRock/build/third-party/FunctionalPlus/therock-FunctionalPlus-sources_fetch/src/therock-FunctionalPlus-sources-stamp/therock-FunctionalPlus-sources-download 
C:\Windows\system32\cmd.exe /C "cd /D D:\a\TheRock\TheRock\build\third-party\FunctionalPlus && "C:\Program Files\CMake\bin\cmake.exe" -DCMAKE_MESSAGE_LOG_LEVEL=VERBOSE -P D:/a/TheRock/TheRock/build/third-party/FunctionalPlus/therock-FunctionalPlus-sources_fetch/src/therock-FunctionalPlus-sources-stamp/download-therock-FunctionalPlus-sources.cmake && "C:\Program Files\CMake\bin\cmake.exe" -DCMAKE_MESSAGE_LOG_LEVEL=VERBOSE -P D:/a/TheRock/TheRock/build/third-party/FunctionalPlus/therock-FunctionalPlus-sources_fetch/src/therock-FunctionalPlus-sources-stamp/verify-therock-FunctionalPlus-sources.cmake && "C:\Program Files\CMake\bin\cmake.exe" -DCMAKE_MESSAGE_LOG_LEVEL=VERBOSE -P D:/a/TheRock/TheRock/build/third-party/FunctionalPlus/therock-FunctionalPlus-sources_fetch/src/therock-FunctionalPlus-sources-stamp/extract-therock-FunctionalPlus-sources.cmake && "C:\Program Files\CMake\bin\cmake.exe" -E touch D:/a/TheRock/TheRock/build/third-party/FunctionalPlus/therock-FunctionalPlus-sources_fetch/src/therock-FunctionalPlus-sources-stamp/therock-FunctionalPlus-sources-download"
-- Downloading...
   dst='D:/a/TheRock/TheRock/build/third-party/FunctionalPlus/therock-FunctionalPlus-sources_fetch/src/v0.2.25.tar.gz'
   timeout='none'
   inactivity timeout='none'
-- Using src='https://github.com/Dobiasd/FunctionalPlus/archive/refs/tags/v0.2.25.tar.gz'
-- Retrying...
-- Using src='https://github.com/Dobiasd/FunctionalPlus/archive/refs/tags/v0.2.25.tar.gz'
-- Retry after 5 seconds (attempt #2) ...
-- Using src='https://github.com/Dobiasd/FunctionalPlus/archive/refs/tags/v0.2.25.tar.gz'
-- Retry after 5 seconds (attempt #3) ...
-- Using src='https://github.com/Dobiasd/FunctionalPlus/archive/refs/tags/v0.2.25.tar.gz'
-- Retry after 15 seconds (attempt #4) ...
-- Using src='https://github.com/Dobiasd/FunctionalPlus/archive/refs/tags/v0.2.25.tar.gz'
-- Retry after 60 seconds (attempt #5) ...
-- Using src='https://github.com/Dobiasd/FunctionalPlus/archive/refs/tags/v0.2.25.tar.gz'
CMake Error at therock-FunctionalPlus-sources_fetch/src/therock-FunctionalPlus-sources-stamp/download-therock-FunctionalPlus-sources.cmake:163 (message):
  Each download failed!

    error: downloading 'https://github.com/Dobiasd/FunctionalPlus/archive/refs/tags/v0.2.25.tar.gz' failed
          status_code: 35
          status_string: "SSL connect error.  If this is due to https certificate verification failure, one may set environment variable CMAKE_TLS_VERIFY=0 to suppress it."
          log:
          --- LOG BEGIN ---
          timeout on name lookup is not supported

  Host github.com:443 was resolved.


- name: Report
if: ${{ !cancelled() }}
run: |
ls -lh build
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ jobs:
name: Build Linux Packages
uses: ./.github/workflows/build_linux_packages.yml

build_windows_packages:
name: Build Windows Packages
uses: ./.github/workflows/build_windows_packages.yml

# build_python_packages:
# name: Build Python Packages
# uses: ./.github/workflows/build_python_packages.yml
25 changes: 25 additions & 0 deletions build_tools/patch_symlinks_for_windows_ci.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash
# Replaces symlinks for source folders with direct copies of files.
# This helps set up files for Windows CI runners that do not have symlinks
# fully configured. This should usually *NOT* be run on development machines
# since it makes destructive changes.

this_dir="$(cd $(dirname $0) && pwd)"
root_dir="$(cd $this_dir/.. && pwd)"

cd ${root_dir}

# Remove the original symlinks.
rm base/half
rm base/rocm-cmake
rm base/rocm-core

# Delete .git folders which are symlinks too. CI doesn't need them.
rm -rf sources/half/.git
rm -rf sources/rocm-cmake/.git
rm -rf sources/rocm-core/.git

# Copy from sources/ to where the symlinks were.
cp -r sources/half base
cp -r sources/rocm-cmake base
cp -r sources/rocm-core base
3 changes: 1 addition & 2 deletions docs/development/windows_support.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,5 +135,4 @@ Ensure that MSVC is used by looking for lines like these in the logs:
cmake --build build
```

At the moment this should build some dependencies like eigen and boost, as well
as some projects in [`base/`](../../base/).
At the moment this should build some projects in [`base/`](../../base/).