Unverified Commit e526bb77 authored by Randy Eckenrode's avatar Randy Eckenrode
Browse files

qt5.qtwebengine: pin clang version to clang 15

The version of Chromium used by Qt WebEngine 5.15.x does not build with
clang 16 due to the following errors:

* -Wenum-constexpr-conversion: This is a downgradable error in clang 16,
  but it is planned to be made into a hard error in a future version of
  clang. Patches are not available for the version of v8 used by
  Chromium in Qt WebEngine, and fixing the code is non-trivial.
* -Wincompatible-function-pointer-types: This is also a downgradable
  error generated starting with clang 16. Patches are available upstream
  that can be backported.

Because the first error is non-trivial to fix and suppressing it risks
future breakage, clang is pinned to clang 15, which also makes fixing
the incompatible function pointer conversion errors unnecessary.

The derivation is also updated to use the `overrideLibcxx` adapter.
Using it links qt5.qtwebengine against the same versions of libc++ and
libc++abi as qt5.qtbase even though they are built with different
versions of clang, avoiding the compatibility problems that can cause.

Also, reenable x86_64-darwin because it builds successfully too.
parent 2ee2d62d
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@ Check for any minor version changes.
, lib, stdenv, fetchurl, fetchgit, fetchpatch, fetchFromGitHub, makeSetupHook, makeWrapper
, bison, cups ? null, harfbuzz, libGL, perl, python3
, gstreamer, gst-plugins-base, gtk3, dconf
, llvmPackages_15, overrideSDK, overrideLibcxx
, darwin

  # options
@@ -288,6 +289,18 @@ let
      qtwayland = callPackage ../modules/qtwayland.nix {};
      qtwebchannel = callPackage ../modules/qtwebchannel.nix {};
      qtwebengine = callPackage ../modules/qtwebengine.nix {
        # The version of Chromium used by Qt WebEngine 5.15.x does not build with clang 16 due
        # to the following errors:
        # * -Wenum-constexpr-conversion: This is a downgradable error in clang 16, but it is planned
        #   to be made into a hard error in a future version of clang. Patches are not available for
        #   the version of v8 used by Chromium in Qt WebEngine, and fixing the code is non-trivial.
        # * -Wincompatible-function-pointer-types: This is also a downgradable error generated
        #   starting with clang 16. Patches are available upstream that can be backported.
        # Because the first error is non-trivial to fix and suppressing it risks future breakage,
        # clang is pinned to clang 15. That also makes fixing the second set of errors unnecessary.
        stdenv =
          let stdenv' = if stdenv.cc.isClang then overrideLibcxx llvmPackages_15.stdenv else stdenv;
          in if stdenv'.isDarwin then overrideSDK stdenv' "11.0" else stdenv';
        inherit (srcs.qtwebengine) version;
        python = python3;
        postPatch = ''
+0 −1
Original line number Diff line number Diff line
@@ -306,7 +306,6 @@ qtModule ({
        isAarch64
        (patternLogicalAnd isMips isLittleEndian)
      ]);
    broken = stdenv.isDarwin && stdenv.isx86_64;

    # This build takes a long time; particularly on slow architectures
    timeout = 24 * 3600;
+1 −0
Original line number Diff line number Diff line
@@ -24694,6 +24694,7 @@ with pkgs;
      inherit (__splicedPackages)
        makeScopeWithSplicing' generateSplicesForMkScope lib fetchurl fetchpatch fetchgit fetchFromGitHub makeSetupHook makeWrapper
        bison cups dconf harfbuzz libGL perl gtk3 python3
        llvmPackages_15 overrideSDK overrideLibcxx
        darwin;
      inherit (__splicedPackages.gst_all_1) gstreamer gst-plugins-base;
      inherit config;