From b6b54ccd0e17d2656773306cb133c8bd04330482 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Tue, 1 Nov 2022 22:59:31 +0000 Subject: [PATCH] spirv-tools: disable blanket -Werror `-Werror` flag usually causes build failures due to minor changes in compiler versions. They might be useful for developers themselves but are rarely useful for distributions. For example right now `spirv-tools` fails to compile on `gcc-13` due to a `gcc` infelicity: https://gcc.gnu.org/PR107488 While this concrete instance is a compiler bug generally `-Werror` makes users' lives harder. Specific `-Werror=` are better way to prevent certain classes of bugs. The change removes planket `-Werror` with `-DSPIRV_WERROR=OFF` flag. --- pkgs/development/tools/spirv-tools/default.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkgs/development/tools/spirv-tools/default.nix b/pkgs/development/tools/spirv-tools/default.nix index 2ac91924feba..3a64646ded63 100644 --- a/pkgs/development/tools/spirv-tools/default.nix +++ b/pkgs/development/tools/spirv-tools/default.nix @@ -15,7 +15,12 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake python3 ]; - cmakeFlags = [ "-DSPIRV-Headers_SOURCE_DIR=${spirv-headers.src}" ]; + cmakeFlags = [ + "-DSPIRV-Headers_SOURCE_DIR=${spirv-headers.src}" + # Avoid blanket -Werror to evade build failures on less + # tested compilers. + "-DSPIRV_WERROR=OFF" + ]; # https://github.com/KhronosGroup/SPIRV-Tools/issues/3905 postPatch = ''