summary refs log tree commit diff
diff options
context:
space:
mode:
authorRandy Eckenrode <randy@largeandhighquality.com>2023-11-04 21:45:07 -0400
committerRandy Eckenrode <randy@largeandhighquality.com>2023-11-05 20:26:28 -0500
commite526bb7756039607e508982ccafe479dbdc19422 (patch)
treeb6ee3aac7d27ca8c20a0f2aebc9daf52dadf9523
parent2ee2d62dce74178c62736fe4a8c784ef40476465 (diff)
downloadnixpkgs-e526bb7756039607e508982ccafe479dbdc19422.tar
nixpkgs-e526bb7756039607e508982ccafe479dbdc19422.tar.gz
nixpkgs-e526bb7756039607e508982ccafe479dbdc19422.tar.bz2
nixpkgs-e526bb7756039607e508982ccafe479dbdc19422.tar.lz
nixpkgs-e526bb7756039607e508982ccafe479dbdc19422.tar.xz
nixpkgs-e526bb7756039607e508982ccafe479dbdc19422.tar.zst
nixpkgs-e526bb7756039607e508982ccafe479dbdc19422.zip
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.
-rw-r--r--pkgs/development/libraries/qt-5/5.15/default.nix13
-rw-r--r--pkgs/development/libraries/qt-5/modules/qtwebengine.nix1
-rw-r--r--pkgs/top-level/all-packages.nix1
3 files changed, 14 insertions, 1 deletions
diff --git a/pkgs/development/libraries/qt-5/5.15/default.nix b/pkgs/development/libraries/qt-5/5.15/default.nix
index fde5716b99e..a2b38046c5a 100644
--- a/pkgs/development/libraries/qt-5/5.15/default.nix
+++ b/pkgs/development/libraries/qt-5/5.15/default.nix
@@ -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 = ''
diff --git a/pkgs/development/libraries/qt-5/modules/qtwebengine.nix b/pkgs/development/libraries/qt-5/modules/qtwebengine.nix
index 58f90763a24..3503067aca7 100644
--- a/pkgs/development/libraries/qt-5/modules/qtwebengine.nix
+++ b/pkgs/development/libraries/qt-5/modules/qtwebengine.nix
@@ -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;
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index f75a7e219bc..4a2f2921e68 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -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;