Skip to content

Only download prebuilt DXC releases on Windows - #8783

Merged
Damyan Pepper (damyanp) merged 1 commit into
microsoft:mainfrom
bmwiedemann:nodownload
Aug 17, 2026
Merged

Only download prebuilt DXC releases on Windows#8783
Damyan Pepper (damyanp) merged 1 commit into
microsoft:mainfrom
bmwiedemann:nodownload

Conversation

@bmwiedemann

Copy link
Copy Markdown
Contributor

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_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.

Copilot AI balanced review requested due to automatic review settings August 17, 2026 01:39
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 a WIN32 guard.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tools/clang/test/CMakeLists.txt Outdated
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.
Copilot AI review requested due to automatic review settings August 17, 2026 01:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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_end becomes -1 when DXC_RELEASES is empty (or DXC_RELEASES_LENGTH is 0), which can cause an invalid foreach(RANGE ...) in some CMake versions/configurations. Add a guard before computing loop_end/entering the loop (e.g., only run the foreach when num_pairs is greater than 0) 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})

@bmwiedemann

Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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_RELEASES contains at least one complete (name, version) pair and that its length is even. If DXC_RELEASES is empty (or accidentally edited to an odd length), loop_end can become negative and/or list(GET ...) can go out of range, failing CMake configuration. Consider guarding with a if(num_pairs GREATER 0) (or if(DXC_RELEASES_LENGTH GREATER_EQUAL 2)) and optionally emitting a clear message(FATAL_ERROR ...) when DXC_RELEASES_LENGTH is 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 name and version in 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})

@damyanp

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@damyanp

Copy link
Copy Markdown
Member

Bernhard M. Wiedemann (@bmwiedemann) - thank you for your contribution!

@damyanp
Damyan Pepper (damyanp) merged commit 45f6491 into microsoft:main Aug 17, 2026
13 checks passed
@github-project-automation github-project-automation Bot moved this from New to Done in HLSL Roadmap Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants