DirectXShaderCompiler icon indicating copy to clipboard operation
DirectXShaderCompiler copied to clipboard

DXC clang tests fail on Linux Mariner

Open hekota opened this issue 1 year ago • 2 comments

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

hekota avatar Jan 24 '24 20:01 hekota

I'll take a quick look to see if anything jumps out. Helana, what kind of time constraints does this have?

pow2clk avatar Jan 25 '24 16:01 pow2clk

That is entirely up to you.

hekota avatar Jan 26 '24 00:01 hekota

Leaving this unfixed means that we ship releases that have known test failures. We should fix this before the next release.

damyanp avatar Mar 21 '24 22:03 damyanp

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

damyanp avatar Mar 25 '24 21:03 damyanp

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.

coopp avatar Mar 26 '24 16:03 coopp