DirectXShaderCompiler
DirectXShaderCompiler copied to clipboard
DXC clang tests fail on Linux Mariner
Description Several tests under OptionsTest and RewriterTest are failing on the Linux Mariner distro.
Steps to Reproduce Repros on internal OB build pipeline. Reach out to @hekota for more info.
Actual Behavior
[----------] 16 tests from OptionsTest
/__w/1/s/DXC/tools/clang/unittests/HLSL/OptionsTest.cpp:293: Failure
Expected: true
To be equal to: Unicode::UTF8ToWideString("\xC3\xB1", &wstr)
Which is: false
/__w/1/s/DXC/tools/clang/unittests/HLSL/OptionsTest.cpp:294: Failure
Expected: 0
To be equal to: wcscmp(L"\x00F1", wstr.data())
Which is: 1
[ FAILED ] OptionsTest.ConvertWhenFailThenThrow (0 ms)
[----------] 16 tests from OptionsTest (2 ms total)
[----------] 37 tests from RewriterTest
/__w/1/s/DXC/tools/clang/unittests/HLSL/RewriterTest.cpp:511: Failure
Value of: SUCCEEDED(pRewriter->RewriteUnchanged(source, 0, 0, &pRewriteResult))
Actual: false
Expected: true
Environment
- DXC
main
as of 1/24/2024 - cbl-mariner/build:2.0
I'll take a quick look to see if anything jumps out. Helana, what kind of time constraints does this have?
That is entirely up to you.
Leaving this unfixed means that we ship releases that have known test failures. We should fix this before the next release.
@Coopp - there's a possibility that there may be a....."wider" task here to work through how wide strings work in linux vs windows here.
Capturing some more information on this issue:
Chris did some debugging and noticed that there might be an issue with CPToLocale returning a bad locale value and making incorrect assumptions about the platform. A starting point would be to see how to make this more robust with a bit of a refactor. A quick search on github shows others obtain a locale setting by asking for a locale repeatedly until a valid one is returned. Could be an approach to at least this issue, but not fully settled yet.