microsoft / DirectXShaderCompiler

This repo hosts the source for the DirectX Shader Compiler which is based on LLVM/Clang.
Other
2.98k stars 665 forks source link

Disable the clang-format checks when building DXC #6728

Open Ravbug opened 4 days ago

Ravbug commented 4 days ago

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

llvm-beanz commented 3 days ago

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.

Ravbug commented 3 days ago

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