DirectXShaderCompiler icon indicating copy to clipboard operation
DirectXShaderCompiler copied to clipboard

dxc build fails due to narrow strings in long vector execution tests

Open danbrown-amd opened this issue 1 year ago • 7 comments

Multiple errors of the form "cannot convert from 'const char[n] to 'const wchar_t *'" occur during a build (VS 2022, Windows SDK 10.0.26100). I gather that the WexLogger API has changed.

danbrown-amd avatar Nov 06 '25 22:11 danbrown-amd

Can you double check what version of the WDK you're using? Note that the WDK, which is where TAEF comes from, is installed separately from the SDK.

This powershell snippet should tell you what version you have installed:

Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall',
              'HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall' |
  Get-ItemProperty |
  Where-Object { $_.DisplayName -like 'Windows Driver Kit*' } |
  Select-Object -First 1 DisplayName, DisplayVersion

On my machine this outputs:

DisplayName                                  DisplayVersion
-----------                                  --------------
Windows Driver Kit - Windows 10.0.26100.6584 10.1.26100.6584

As old versions of the WDK are no longer published I can't get ahold of an older version to see what may have changed.

damyanp avatar Nov 07 '25 19:11 damyanp

I get "Windows Driver Kit Logger 10.1.26100.4202".

danbrown-amd avatar Nov 07 '25 20:11 danbrown-amd

That's odd - that's just a single component of the WDK, and not the one that contains TAEF. Could you try reinstalling the matching WDK version? I think TAEF has supported narrow strings since 2021.

damyanp avatar Nov 07 '25 21:11 damyanp

If I replace "-First" with "-Last" I get "Windows Driver Kit - Windows 10.0.26100.4202 10.1.26100.4202". I'm relying on what the Visual Studio installer provided.

I note that other strings in LongVectors.cpp used for the same purpose are wide. It seems to me that the change in my PR advances both consistency and robustness. Is there a compelling reason not to adopt it?

danbrown-amd avatar Nov 07 '25 22:11 danbrown-amd

If anything, I want to move these over to narrow strings, rather than the other way around.

When I set up new VM earlier to try and reproduce this, the VS installer didn't install the TAEF libraries even when I told it to install the driver kit. I had to install the WDK separately to get them installed. Is it possible you have some other installation of the TAEF headers that's getting picked up?

damyanp avatar Nov 07 '25 23:11 damyanp

I ran utils\hct\hctgettaef.py at some point. (Actually, I had copy/paste into a python interpreter because of an indentation error, due to the blank line in the except: block.) Perhaps the URL there needs to be updated?

danbrown-amd avatar Nov 07 '25 23:11 danbrown-amd

Thanks - I didn't know that was there. That looks like it's pulling down an unsupported redist of TAEF for 2017. I don't think we should be using that - #7888.

damyanp avatar Nov 08 '25 00:11 damyanp