[ci] adding windows configuration for configure project script#857
Conversation
ScottTodd
left a comment
There was a problem hiding this comment.
The structure of this LGTM, but I've tagged a few things to fix.
| package_version: ${{ inputs.package_version }} | ||
| extra_cmake_options: ${{ inputs.extra_cmake_options }} | ||
| build_dir: ${{ env.BUILD_DIR_BASH }} | ||
| vctools_install_dir: ${{ env.VCToolsInstallDir }} |
There was a problem hiding this comment.
Forwarding one environment variable to another doesn't look necessary here.
There was a problem hiding this comment.
i just liked the uniformity of the snake case, but i agree! will update
| vctools_install_dir = os.getenv("vctools_install_dir") | ||
| github_workspace = os.getenv("GITHUB_WORKSPACE") | ||
|
|
||
| platform_options = { | ||
| "linux": ["-DTHEROCK_VERBOSE=ON", "-DBUILD_TESTING=ON"], | ||
| "windows": [ | ||
| f"-DCMAKE_C_COMPILER={vctools_install_dir}/bin/Hostx64/x64/cl.exe", | ||
| f"-DCMAKE_CXX_COMPILER={vctools_install_dir}/bin/Hostx64/x64/cl.exe", | ||
| f"-DCMAKE_LINKER={vctools_install_dir}/bin/Hostx64/x64/link.exe", |
There was a problem hiding this comment.
This script should check that the environment variables are set and provide useful error messages when they are not. Right now this will try to use /bin/Hostx64/x64/cl.exe if vctools_install_dir is unset. That path looks like a Linux path so it would be easy to get confused by in the logs.
| f"-DCMAKE_LINKER={vctools_install_dir}/bin/Hostx64/x64/link.exe", | ||
| "-DTHEROCK_BACKGROUND_BUILD_JOBS=4", | ||
| "-DCMAKE_MSVC_DEBUG_INFORMATION_FORMAT=Embedded", | ||
| f"-DTHEROCK_AMDGPU_WINDOWS_INTEROP_DIR={github_workspace}/amdgpu-windows-interop", |
There was a problem hiding this comment.
For this script to be testable outside of GitHub Actions, this could fallback to omitting the argument if GITHUB_WORKSPACE is undefined or no directory exists at that path. That would use the default CMake behavior:
Line 76 in 34df5ba
There was a problem hiding this comment.
Question: I understand that vctools_install_dir is required (as it needs C, C++ to compile), but is amdgpu-windows-interop optional? I made the update where it is optional but not sure
There was a problem hiding this comment.
It's optional if the directory exists in the default location. I tried to get the checkout action to use that path but found it easier to line up the paths with an explicit argument instead.
That being said... we should just convert from a separate install to something automatically handled by the build system: #693
There was a problem hiding this comment.
So given that we want to simplify anyway, you could keep the existing github_workspace behavior in this script. That will make it easier to just remove a single line when we have the automatic repository fetch.
| github_workspace = os.getenv("GITHUB_WORKSPACE") | ||
|
|
||
| platform_options = { | ||
| "linux": ["-DTHEROCK_VERBOSE=ON", "-DBUILD_TESTING=ON"], |
There was a problem hiding this comment.
These options look useful across both operating systems. Why are they Linux specific?
There was a problem hiding this comment.
Good question:
-
do we still find value in the
-DBUILD_TESTING=ONas default inbuild_windows_packagesCI? I know this was an initial choice as we were still testing windows, but maybe it's in a solid spot and can be default? -
I have no idea why windows doesn't have
-DTHEROCK_VERBOSE=ONflag. for some reason (without proof) in my head, i thought windows was incredibly verbose and we decided to ignore? if my assumption is wrong, i can add it :)
There was a problem hiding this comment.
That -DBUILD_TESTING=ON was leftover from making the workflow build with and without tests in #552. Yes, it can be the default now. Separate from what the default is for that option, extra_cmake_options benefits from having documentation to make using it via workflow_dispatch easy - that can be either via a default value or a description.
The verbose setting is fine to enable. I build locally with it, and we usually want as much information as we can get in CI logs.
| package_version: ${{ inputs.package_version }} | ||
| extra_cmake_options: ${{ inputs.extra_cmake_options }} | ||
| build_dir: build | ||
| BUILD_DIR_BASH: build |
There was a problem hiding this comment.
I'd prefer to just call this build_dir (or BUILD_DIR). We still need to remove the non-bash path handling around here:
TheRock/.github/workflows/build_windows_packages.yml
Lines 42 to 62 in a2dd40a
Could clean that up together with changes to the other windows workflows
There was a problem hiding this comment.
Yes, can we just remove all of that? I'm not sure what is needed or not. Will cmake handle creating that directory properly like linux?
There was a problem hiding this comment.
i'll try ! one way to find out :)
There was a problem hiding this comment.
I think the only load bearing detail there is using the B:/ drive instead of C:/, since the OS partition is too small to fit the build outputs. The powershell/bash split was only needed when we had powershell commands in the workflows, but all of those have been moved to Python scripts that run under bash.
There was a problem hiding this comment.
That code is also copied to
TheRock/.github/workflows/release_windows_packages.yml
Lines 99 to 125 in a2dd40a
I'd prefer to clean that up in a separate PR across both files.
| raise Exception( | ||
| "Environment variable VCToolsInstallDir is not set. Exiting." | ||
| ) |
There was a problem hiding this comment.
This could suggest configuring MSVC: https://github.com/ROCm/TheRock/blob/main/docs/development/windows_support.md#important-tool-settings
(fine to leave as is though)
| """ | ||
| This script runs the Linux build configuration | ||
|
|
||
| Required environment variables: | ||
| - amdgpu_families | ||
| - package_version | ||
| - extra_cmake_options | ||
| """ |
There was a problem hiding this comment.
Please update this docstring (works on both Windows and Linux, then document which env vars are required on each platform)
There was a problem hiding this comment.
unfortunate. let me update this in the next PR
Initially, project configurations were specifically linux. now, this script handles both linux and windows
Working here for rocm-libraries (a note: build is failing for external reasons, but the configure step works)
once this goes through, will update in here: ROCm/rocm-libraries#156