Only download prebuilt DXC releases on Windows - #8783
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates the Clang test CMake configuration to only register released DXC binaries on Windows hosts.
Changes:
- Moves
add_released_dxc(${name} ${version})under aWIN32guard.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
The DXIL backward compatibility section downloads four release archives from github and then uses them exclusively from inside an if(WIN32) block, because what it wants out of them is bin/<arch>/dxil.dll -- a Windows binary that has no equivalent, and no consumer, on other platforms. The download itself was outside that guard, and ExternalProject_Add adds its download target to ALL, so every Linux and macOS build fetched all four archives for nothing. It also makes an ordinary build depend on network access, which breaks offline and distribution builds. Move the add_released_dxc() call inside the existing if(WIN32), matching what taef_exec/DownloadWarp.cmake already does for the WARP package.
37e70f1 to
d3a4d3c
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Suppressed comments (1)
tools/clang/test/CMakeLists.txt:145
loop_endbecomes-1whenDXC_RELEASESis empty (orDXC_RELEASES_LENGTHis0), which can cause an invalidforeach(RANGE ...)in some CMake versions/configurations. Add a guard before computingloop_end/entering the loop (e.g., only run theforeachwhennum_pairsis greater than0) to make this robust.
list(LENGTH DXC_RELEASES DXC_RELEASES_LENGTH)
math(EXPR num_pairs "${DXC_RELEASES_LENGTH} / 2")
math(EXPR loop_end "${num_pairs} - 1")
foreach(i RANGE 0 ${loop_end})
|
@microsoft-github-policy-service agree |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Suppressed comments (2)
tools/clang/test/CMakeLists.txt:150
- The loop assumes
DXC_RELEASEScontains at least one complete (name, version) pair and that its length is even. IfDXC_RELEASESis empty (or accidentally edited to an odd length),loop_endcan become negative and/orlist(GET ...)can go out of range, failing CMake configuration. Consider guarding with aif(num_pairs GREATER 0)(orif(DXC_RELEASES_LENGTH GREATER_EQUAL 2)) and optionally emitting a clearmessage(FATAL_ERROR ...)whenDXC_RELEASES_LENGTHis odd.
list(LENGTH DXC_RELEASES DXC_RELEASES_LENGTH)
math(EXPR num_pairs "${DXC_RELEASES_LENGTH} / 2")
math(EXPR loop_end "${num_pairs} - 1")
foreach(i RANGE 0 ${loop_end})
math(EXPR idx_name "${i}*2")
math(EXPR idx_version "${i}*2 + 1")
list(GET DXC_RELEASES ${idx_name} name)
list(GET DXC_RELEASES ${idx_version} version)
tools/clang/test/CMakeLists.txt:152
- Using very generic variable names like
nameandversionin directory scope can be confusing and increases the risk of unintended reuse elsewhere in the file. Consider renaming these loop variables to something more specific (e.g.,dxc_release_name/dxc_release_version) to improve clarity.
list(GET DXC_RELEASES ${idx_name} name)
list(GET DXC_RELEASES ${idx_version} version)
add_released_dxc(${name} ${version})
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
Bernhard M. Wiedemann (@bmwiedemann) - thank you for your contribution! |
The DXIL backward compatibility section downloads four release archives from github and then uses them exclusively from inside an
if(WIN32)block, because what it wants out of them is bin//dxil.dll -- a Windows binary that has no equivalent, and no consumer, on other platforms.The download itself was outside that guard, and
ExternalProject_Addadds its download target to ALL, so every Linux and macOS build fetched all four archives for nothing. It also makes an ordinary build depend on network access, which breaks offline and distribution builds.Move the
add_released_dxc()call inside the existing if(WIN32), matching what taef_exec/DownloadWarp.cmake already does for the WARP package.