Skip to content

Commit

Permalink
invidious: fix build with clang 16
Browse files Browse the repository at this point in the history
Suppress warnings that cause build failures with newer clang versions.
  • Loading branch information
reckenrode committed Oct 22, 2023
1 parent b9e9e44 commit fa21ebc
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion pkgs/servers/invidious/lsquic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,20 @@ let
preBuild = preBuild + lib.optionalString stdenv.isLinux ''
sed -e '/^build crypto\/fipsmodule\/CMakeFiles\/fipsmodule\.dir\/bcm\.c\.o:/,/^ *FLAGS =/ s/^ *FLAGS = -Werror/& -Wno-error=stringop-overflow/' \
-i build.ninja
'';
'' + lib.optionalString stdenv.cc.isClang (
# Silence warnings that cause build failures with newer versions of clang.
let
clangVersion = lib.getVersion stdenv.cc;
in
lib.optionalString (lib.versionAtLeast clangVersion "13") ''
sed -e '/^build crypto\/CMakeFiles\/crypto\.dir\/x509\/t_x509\.c\.o:/,/^ *FLAGS =/ s/^ *FLAGS = -Werror/& -Wno-error=unused-but-set-variable/' \
-e '/^build tool\/CMakeFiles\/bssl\.dir\/digest\.cc\.o:/,/^ *FLAGS =/ s/^ *FLAGS = -Werror/& -Wno-error=unused-but-set-variable/' \
-i build.ninja
'' + lib.optionalString (lib.versionAtLeast clangVersion "16") ''
sed -e '/^build crypto\/CMakeFiles\/crypto\.dir\/trust_token\/trust_token\.c\.o:/,/^ *FLAGS =/ s/^ *FLAGS = -Werror/& -Wno-error=single-bit-bitfield-constant-conversion/' \
-i build.ninja
''
);
});
in
stdenv.mkDerivation rec {
Expand Down

0 comments on commit fa21ebc

Please sign in to comment.