DirectXShaderCompiler icon indicating copy to clipboard operation
DirectXShaderCompiler copied to clipboard

Disable the clang-format checks when building DXC

Open Ravbug opened this issue 1 year ago • 2 comments

What is the issue you're encountering? When I build the dxc target from source as a subdirectory of my codebase, I get these errors:

3>Verifying clang-format results... 3>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(254,5): error MSB8066: Custom build for 'build\win\CMakeFiles\88778fe0101fa821569a6b8d53ded241\RDAT_LibraryTypes.inl.stamp.rule;build\win\CMakeFiles\6f5c683015713da5c9349b7bc8142ac1\RDAT_LibraryTypes.rule' exited with code 1.

A few more targets also fail with this same error. It still produces dxc.exe and dxcompiler.dll. Is it possible to turn off the clang-format checks?

Steps to Reproduce (if applicable)

  1. Clone the latest master
  2. Build the dxc target as a subdirectory of another CMake project

Environment

  • DXC version: dxcompiler.dll: 1.8 - 1.8.0.2207 (master, 452045c6f-dirty)
  • Host Operating System: Windows 10 22H2 1904.4529
  • CMake: cmake version 3.28.3-msvc11
  • Compiler: MSVC 19.40.33811.0

Ravbug avatar Jun 26 '24 22:06 Ravbug

We do not currently have an option to disable the clang-format verification for generated sources that get put into the DXC GitHub repository. We have a strict requirement that all code going into DXC be clang-format clean, so we want the build system to also enforce that and behave appropriately with the generated sources.

I don't think we should allow disabling the format check in isolation, but I think we could add an option to disable generating sources that get put into the DXC source tree, and since those are the only ones that get compared for differences that should resolve the build difficulties.

It is important to note that since we have a strict requirement for sources in DXC being clang-format clean, any contributions you make may need to be built with the default build configuration and our pre-merge builds enforce that requirement.

llvm-beanz avatar Jun 27 '24 15:06 llvm-beanz

Thanks for the quick response! The changes in #6730 appear to fix my issue.

Ravbug avatar Jun 28 '24 03:06 Ravbug