-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setup initial workflow for building on Windows. (#73)
Progress on #36. This adds a new workflow, triggered as part of ci.yml, that configures and builds a subset of the project. Future changes will: * Switch to a more powerful self-hosted runner instead of using standard GitHub-hosted runners (we have some runners but they need some configuration to be able to run the `repo` tool without `SSL: CERTIFICATE_VERIFY_FAILED` errors) * Build more subprojects (this will patches or upstream changes to each subproject to improve portability)
- Loading branch information
Showing
4 changed files
with
108 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
||
- name: Report | ||
if: ${{ !cancelled() }} | ||
run: | | ||
ls -lh build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters