Skip to content

Use an absolute path for CompileShaders.cmd - #660

Open
bghgary wants to merge 1 commit into
microsoft:mainfrom
bghgary:compileshaders-absolute-path
Open

Use an absolute path for CompileShaders.cmd#660
bghgary wants to merge 1 commit into
microsoft:mainfrom
bghgary:compileshaders-absolute-path

Conversation

@bghgary

@bghgary bghgary commented Jul 31, 2026

Copy link
Copy Markdown

[Created by Copilot on behalf of @bghgary]

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 Src/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 DirectXTK target:

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

The shader step regenerated the .inc files in each passing case.

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, and the
build then fails with "no such file or directory".

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

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 commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator

You could make the same change in two places for DirectXTex if you want:

https://github.com/microsoft/DirectXTex/

as well as DirectX Tool Kit for DX12:

https://github.com/microsoft/DirectXTK12/

@walbourn walbourn self-assigned this Aug 1, 2026
@walbourn walbourn added the cmake Related to CMake build label Aug 1, 2026
@bghgary

bghgary commented Aug 3, 2026

Copy link
Copy Markdown
Author

[Responded by Copilot on behalf of @bghgary]

You could make the same change in two places for DirectXTex if you want

Done: microsoft/DirectXTex#730 and microsoft/DirectXTK12#431.

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