Skip to content

Use an absolute path for CompileShaders.cmd - #730

Merged
walbourn merged 1 commit into
microsoft:mainfrom
bghgary:compileshaders-absolute-path
Aug 4, 2026
Merged

Use an absolute path for CompileShaders.cmd#730
walbourn merged 1 commit into
microsoft:mainfrom
bghgary:compileshaders-absolute-path

Conversation

@bghgary

@bghgary bghgary commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

[Created by Copilot on behalf of @bghgary]

Same change as microsoft/DirectXTK#660, suggested by @walbourn there.

The shader build step names the script as a bare CompileShaders.cmd, which only resolves because Windows falls back to searching the current directory when looking up an executable. That fallback is disabled whenever NoDefaultCurrentDirectoryInExePath is present in the environment — its presence alone is enough, the value is irrelevant — so any hardened build or automation environment fails with Generating HLSL shaders... followed by no such file or directory.

WORKING_DIRECTORY already points at DirectXTex/Shaders, so naming the script by absolute path keeps the same intent without relying on current-directory lookup.

Verified on Windows with the Visual Studio 17 2022 generator, building the DirectXTex target:

variable set variable unset
before fails: no such file or directory, error MSB8066 builds
after builds builds

The shader step regenerated all 14 .inc files in each passing case, and produced none in the failing case.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 714b4495-258e-4645-abf7-26c17bc29d5b
@azure-pipelines

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

@walbourn walbourn self-assigned this Aug 4, 2026
@walbourn walbourn added the cmake Related to CMake build label Aug 4, 2026
@walbourn
walbourn merged commit 23a644e into microsoft:main Aug 4, 2026
114 of 121 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cmake Related to CMake build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants