From 22f218c9b0aab17c94f9b5cc155dfd52f1fb1498 Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Sat, 6 Jan 2024 18:12:52 +0100 Subject: [PATCH 01/44] gettext: 0.21.1 -> 0.22.4 --- pkgs/development/libraries/gettext/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/gettext/default.nix b/pkgs/development/libraries/gettext/default.nix index 2a69b5702172..bd3070d82efe 100644 --- a/pkgs/development/libraries/gettext/default.nix +++ b/pkgs/development/libraries/gettext/default.nix @@ -8,11 +8,11 @@ stdenv.mkDerivation rec { pname = "gettext"; - version = "0.21.1"; + version = "0.22.4"; src = fetchurl { url = "mirror://gnu/gettext/${pname}-${version}.tar.gz"; - sha256 = "sha256-6MNlDh2M7odcTzVWQjgsHfgwWL1aEe6FVcDPJ21kbUU="; + hash = "sha256-weC7KkQnqQJDkMZizVMtZkxLNrj/RE7V5UsRX9t6Guo="; }; patches = [ ./absolute-paths.diff From 28f966f9e0a4fc025ffce96d37f00f5cf33f7a5d Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Sat, 6 Jan 2024 21:03:44 +0100 Subject: [PATCH 02/44] stdenv: rebuild gettext with working iconv --- pkgs/stdenv/linux/default.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix index b8111f34e30a..e5a225f15838 100644 --- a/pkgs/stdenv/linux/default.nix +++ b/pkgs/stdenv/linux/default.nix @@ -385,6 +385,9 @@ in configureFlags = (a.configureFlags or []) ++ [ "--with-native-system-header-dir=/include" "--with-build-sysroot=${lib.getDev self.stdenv.cc.libc}" + # Don't assume that `gettext` was built with iconv support, since we don't have + # our own `glibc` yet. + "--disable-nls" ]; # This is a separate phase because gcc assembles its phase scripts @@ -507,7 +510,7 @@ in overrides = self: super: rec { inherit (prevStage) ccWrapperStdenv - binutils coreutils gnugrep gettext + binutils coreutils gnugrep perl patchelf linuxHeaders gnum4 bison libidn2 libunistring libxcrypt; # We build a special copy of libgmp which doesn't use libstdc++, because # xgcc++'s libstdc++ references the bootstrap-files (which is what From 4631c517a387a767c2829af0f2ca7ee1bb161a1a Mon Sep 17 00:00:00 2001 From: Emily Date: Sun, 6 Oct 2024 18:33:01 +0100 Subject: [PATCH 03/44] wasilibc: 21 -> 22-unstable-2024-10-16 Contains fixes for LLVM 19. --- pkgs/development/libraries/wasilibc/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/wasilibc/default.nix b/pkgs/development/libraries/wasilibc/default.nix index c0714a78556a..82df25395f82 100644 --- a/pkgs/development/libraries/wasilibc/default.nix +++ b/pkgs/development/libraries/wasilibc/default.nix @@ -8,7 +8,7 @@ let pname = "wasilibc"; - version = "21"; + version = "22-unstable-2024-10-16"; in stdenv.mkDerivation { inherit pname version; @@ -16,8 +16,8 @@ stdenv.mkDerivation { src = buildPackages.fetchFromGitHub { owner = "WebAssembly"; repo = "wasi-libc"; - rev = "refs/tags/wasi-sdk-${version}"; - hash = "sha256-1LsMpO29y79twVrUsuM/JvC7hK8O6Yey4Ard/S3Mvvc="; + rev = "98897e29fcfc81e2b12e487e4154ac99188330c4"; + hash = "sha256-NFKhMJj/quvN3mR7lmxzA9w46KhX92iG0rQA9qDeS8I="; fetchSubmodules = true; }; From ec34370267929fe21c5ebb861a320bde811e4523 Mon Sep 17 00:00:00 2001 From: Emily Date: Thu, 7 Nov 2024 01:27:51 +0000 Subject: [PATCH 04/44] rust: use LLVM 19 --- pkgs/development/compilers/rust/1_82.nix | 20 ++++++++++---------- pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/pkgs/development/compilers/rust/1_82.nix b/pkgs/development/compilers/rust/1_82.nix index 9d1281352ee1..45734f893dca 100644 --- a/pkgs/development/compilers/rust/1_82.nix +++ b/pkgs/development/compilers/rust/1_82.nix @@ -24,8 +24,8 @@ pkgsTargetTarget, makeRustPlatform, wrapRustcWith, - llvmPackages_18, - llvm_18, + llvmPackages_19, + llvm_19, wrapCCWith, overrideCC, fetchpatch, @@ -33,7 +33,7 @@ let llvmSharedFor = pkgSet: - pkgSet.llvmPackages_18.libllvm.override ( + pkgSet.llvmPackages_19.libllvm.override ( { enableSharedLibraries = true; } @@ -41,7 +41,7 @@ let # Force LLVM to compile using clang + LLVM libs when targeting pkgsLLVM stdenv = pkgSet.stdenv.override { allowedRequisites = null; - cc = pkgSet.pkgsBuildHost.llvmPackages_18.clangUseLLVM; + cc = pkgSet.pkgsBuildHost.llvmPackages_19.clangUseLLVM; }; } ); @@ -68,14 +68,14 @@ import ./default.nix bootBintools ? if stdenv.targetPlatform.linker == "lld" then null else pkgs.bintools, }: let - llvmPackages = llvmPackages_18; + llvmPackages = llvmPackages_19; setStdenv = pkg: pkg.override { stdenv = stdenv.override { allowedRequisites = null; - cc = pkgsBuildHost.llvmPackages_18.clangUseLLVM; + cc = pkgsBuildHost.llvmPackages_19.clangUseLLVM; }; }; in @@ -88,7 +88,7 @@ import ./default.nix libcxx = llvmPackages.libcxx.override { stdenv = stdenv.override { allowedRequisites = null; - cc = pkgsBuildHost.llvmPackages_18.clangNoLibcxx; + cc = pkgsBuildHost.llvmPackages_19.clangNoLibcxx; hostPlatform = stdenv.hostPlatform // { useLLVM = !stdenv.hostPlatform.isDarwin; }; @@ -102,7 +102,7 @@ import ./default.nix } ) { } else - llvmPackages_18; + llvmPackages_19; # Note: the version MUST be the same version that we are building. Upstream # ensures that each released compiler can compile itself: @@ -139,8 +139,8 @@ import ./default.nix ( builtins.removeAttrs args [ - "llvmPackages_18" - "llvm_18" + "llvmPackages_19" + "llvm_19" "wrapCCWith" "overrideCC" "fetchpatch" diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index a374b8c86779..c4dbf3800cea 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6912,7 +6912,7 @@ with pkgs; rust_1_82 = callPackage ../development/compilers/rust/1_82.nix { inherit (darwin.apple_sdk.frameworks) CoreFoundation Security SystemConfiguration; - llvm_18 = llvmPackages_18.libllvm; + llvm_19 = llvmPackages_19.libllvm; }; rust = rust_1_82; From 8c25817ccd14d84801c9eb073e33b713dbcbc277 Mon Sep 17 00:00:00 2001 From: Emily Date: Thu, 31 Oct 2024 20:11:16 +0000 Subject: [PATCH 05/44] llvmPackages: llvmPackages_{16,18} -> llvmPackages_19 --- pkgs/top-level/all-packages.nix | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index dbb7879616fc..a374b8c86779 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6743,18 +6743,7 @@ with pkgs; libllvm = llvmPackages.libllvm; llvm-manpages = llvmPackages.llvm-manpages; - # Please remove all this logic when bumping to LLVM 19 and make this - # a simple alias. - llvmPackages = let - # This returns the minimum supported version for the platform. The - # assumption is that or any later version is good. - choose = platform: if platform.isDarwin then 16 else 18; - # We take the "max of the mins". Why? Since those are lower bounds of the - # supported version set, this is like intersecting those sets and then - # taking the min bound of that. - minSupported = toString (lib.trivial.max (choose stdenv.hostPlatform) (choose - stdenv.targetPlatform)); - in pkgs.${"llvmPackages_${minSupported}"}; + llvmPackages = llvmPackages_19; inherit (rec { llvmPackagesSet = recurseIntoAttrs (callPackages ../development/compilers/llvm { }); From 227075c83ec9bf3311f86da7c7c1b376c01fbccd Mon Sep 17 00:00:00 2001 From: Randy Eckenrode Date: Sun, 19 May 2024 17:36:09 -0400 Subject: [PATCH 06/44] gettext: implement clang 18 on Darwin workaround --- .../development/libraries/gettext/default.nix | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/pkgs/development/libraries/gettext/default.nix b/pkgs/development/libraries/gettext/default.nix index bd3070d82efe..c5ca4a932fe6 100644 --- a/pkgs/development/libraries/gettext/default.nix +++ b/pkgs/development/libraries/gettext/default.nix @@ -47,10 +47,25 @@ stdenv.mkDerivation rec { ]; postPatch = '' - substituteAllInPlace gettext-runtime/src/gettext.sh.in - substituteInPlace gettext-tools/projects/KDE/trigger --replace "/bin/pwd" pwd - substituteInPlace gettext-tools/projects/GNOME/trigger --replace "/bin/pwd" pwd - substituteInPlace gettext-tools/src/project-id --replace "/bin/pwd" pwd + # Older versions of gettext come with a copy of `extern-inline.m4` that is not compatible with clang 18. + # When a project uses gettext + autoreconfPhase, autoreconfPhase will invoke `autopoint -f`, which will + # replace whatever (probably compatible) version of `extern-inline.m4` with one that probalby won’t work + # because `autopoint` will copy the autoconf macros from the project’s required version of gettext. + # Fixing this requires replacing all the older copies of the problematic file with a new one. + # + # This is ugly, but it avoids requiring workarounds in every package using gettext and autoreconfPhase. + declare -a oldFiles=($(tar tf gettext-tools/misc/archive.dir.tar | grep '^gettext-0\.[19].*/extern-inline.m4')) + oldFilesDir=$(mktemp -d) + for oldFile in "''${oldFiles[@]}"; do + mkdir -p "$oldFilesDir/$(dirname "$oldFile")" + cp gettext-tools/gnulib-m4/extern-inline.m4 "$oldFilesDir/$oldFile" + done + tar uf gettext-tools/misc/archive.dir.tar -C "$oldFilesDir" "''${oldFiles[@]}" + + substituteAllInPlace gettext-runtime/src/gettext.sh.in + substituteInPlace gettext-tools/projects/KDE/trigger --replace "/bin/pwd" pwd + substituteInPlace gettext-tools/projects/GNOME/trigger --replace "/bin/pwd" pwd + substituteInPlace gettext-tools/src/project-id --replace "/bin/pwd" pwd '' + lib.optionalString stdenv.hostPlatform.isCygwin '' sed -i -e "s/\(cldr_plurals_LDADD = \)/\\1..\/gnulib-lib\/libxml_rpl.la /" gettext-tools/src/Makefile.in sed -i -e "s/\(libgettextsrc_la_LDFLAGS = \)/\\1..\/gnulib-lib\/libxml_rpl.la /" gettext-tools/src/Makefile.in From 1e700c2bfaccef30ca0b7acb55e73ece823b84f9 Mon Sep 17 00:00:00 2001 From: Emily Date: Thu, 7 Nov 2024 01:20:18 +0000 Subject: [PATCH 07/44] buildMozillaMach: apply upstream WASI SDK workaround for LLVM 19 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I have no idea why this is necessary for us and why the upstream patch doesn’t work, but this gets the Mozilla packages building on LLVM 19 in the meantime while we try to figure that out. Closes: #352724 --- .../networking/browsers/firefox/common.nix | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/pkgs/applications/networking/browsers/firefox/common.nix b/pkgs/applications/networking/browsers/firefox/common.nix index dc52606f24b7..be1a1fbadb97 100644 --- a/pkgs/applications/networking/browsers/firefox/common.nix +++ b/pkgs/applications/networking/browsers/firefox/common.nix @@ -254,6 +254,25 @@ buildStdenv.mkDerivation { hash = "sha256-2IpdSyye3VT4VB95WurnyRFtdN1lfVtYpgEiUVhfNjw="; }) ] + ++ [ + # LLVM 19 turned on WASM reference types by default, exposing a bug + # that broke the Mozilla WASI build. Supposedly, it has been fixed + # upstream in LLVM, but the build fails in the same way for us even + # with LLVM 19 versions that contain the upstream patch. + # + # Apply the temporary patch Mozilla used to work around this bug + # for now until someone can investigate what’s going on here. + # + # TODO: Please someone figure out what’s up with this. + # + # See: + # See: + (fetchpatch { + name = "wasi-sdk-disable-reference-types.patch"; + url = "https://hg.mozilla.org/integration/autoland/raw-rev/23a9f6555c7c"; + hash = "sha256-CRywalJlRMFVLITEYXxpSq3jLPbUlWKNRHuKLwXqQfU="; + }) + ] ++ extraPatches; postPatch = '' From b39c998560ef3f1785ee0217c09094ad7dba9cb2 Mon Sep 17 00:00:00 2001 From: Randy Eckenrode Date: Mon, 20 May 2024 19:51:30 -0400 Subject: [PATCH 08/44] fontforge: fix translations for compatibility with gettext 0.22 --- pkgs/tools/misc/fontforge/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/tools/misc/fontforge/default.nix b/pkgs/tools/misc/fontforge/default.nix index 495a3dad8330..1eca97e7d7c7 100644 --- a/pkgs/tools/misc/fontforge/default.nix +++ b/pkgs/tools/misc/fontforge/default.nix @@ -29,6 +29,11 @@ stdenv.mkDerivation rec { url = "https://github.com/fontforge/fontforge/commit/216eb14b558df344b206bf82e2bdaf03a1f2f429.patch"; hash = "sha256-aRnir09FSQMT50keoB7z6AyhWAVBxjSQsTRvBzeBuHU="; }) + # Fixes translation compatibility with gettext 0.22 + (fetchpatch { + url = "https://github.com/fontforge/fontforge/commit/55d58f87ab1440f628f2071a6f6cc7ef9626c641.patch"; + hash = "sha256-rkYnKPXA8Ztvh9g0zjG2yTUCPd3lE1uqwvBuEd8+Oyw="; + }) # https://github.com/fontforge/fontforge/pull/5423 ./replace-distutils.patch From b4ccd4a123ac7e8d252c819e88fa7c757f644471 Mon Sep 17 00:00:00 2001 From: Reno Dakota Date: Tue, 5 Nov 2024 22:00:19 -0800 Subject: [PATCH 09/44] llvmPackages_{13,14,15,16,17}.compiler-rt: reorder cfi_startproc after label fixes building with llvm_18+ --- pkgs/development/compilers/llvm/common/default.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/development/compilers/llvm/common/default.nix b/pkgs/development/compilers/llvm/common/default.nix index 33e4d3c998dd..fae0f963e905 100644 --- a/pkgs/development/compilers/llvm/common/default.nix +++ b/pkgs/development/compilers/llvm/common/default.nix @@ -974,6 +974,15 @@ let lib.versionAtLeast metadata.release_version "14" && lib.versionOlder metadata.release_version "18" ) ) (metadata.getVersionFile "compiler-rt/gnu-install-dirs.patch") + ++ + lib.optional + (lib.versionAtLeast metadata.release_version "13" && lib.versionOlder metadata.release_version "18") + (fetchpatch { + name = "cfi_startproc-after-label.patch"; + url = "https://github.com/llvm/llvm-project/commit/7939ce39dac0078fef7183d6198598b99c652c88.patch"; + stripLen = 1; + hash = "sha256-tGqXsYvUllFrPa/r/dsKVlwx5IrcJGccuR1WAtUg7/o="; + }) ++ [ # ld-wrapper dislikes `-rpath-link //nix/store`, so we normalize away the # extra `/`. From 425d5fbd0165d02d68d03e1bc6c3f1f5f2916173 Mon Sep 17 00:00:00 2001 From: Reno Dakota Date: Sat, 9 Nov 2024 18:38:59 -0800 Subject: [PATCH 10/44] darwin.file_cmds: add libmd for install clang-19 defines `TARGET_OS_OSX` which results in the install build require various digests. Using libmd fixes the build. --- .../darwin/apple-source-releases/file_cmds/meson.build.in | 3 ++- .../darwin/apple-source-releases/file_cmds/package.nix | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/os-specific/darwin/apple-source-releases/file_cmds/meson.build.in b/pkgs/os-specific/darwin/apple-source-releases/file_cmds/meson.build.in index 7fc7ed7d901f..638742f978c2 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/file_cmds/meson.build.in +++ b/pkgs/os-specific/darwin/apple-source-releases/file_cmds/meson.build.in @@ -15,6 +15,7 @@ core_foundation = dependency('appleframeworks', modules : 'CoreFoundation') bzip2 = dependency('bzip2') xz = dependency('liblzma') +libmd = dependency('libmd') libxo = dependency('libxo') zlib = dependency('zlib') @@ -173,7 +174,7 @@ install_symlink( executable( 'install-bin', # Meson reserves the name “install”, so use a different name and rename in install phase. - dependencies : [ copyfile ], + dependencies : [ copyfile, libmd ], install : true, sources: [ 'install/xinstall.c', diff --git a/pkgs/os-specific/darwin/apple-source-releases/file_cmds/package.nix b/pkgs/os-specific/darwin/apple-source-releases/file_cmds/package.nix index 93b578b1c008..584d2a312a60 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/file_cmds/package.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/file_cmds/package.nix @@ -4,6 +4,7 @@ bzip2, copyfile, less, + libmd, libutil, libxo, mkAppleDerivation, @@ -104,6 +105,7 @@ mkAppleDerivation { buildInputs = [ bzip2 copyfile + libmd libutil libxo removefile From a6ebc2e1f21ca0191a7cc36f124f5bd0e26cdfab Mon Sep 17 00:00:00 2001 From: Reno Dakota Date: Sat, 9 Nov 2024 19:46:41 -0800 Subject: [PATCH 11/44] xsimd: reduce precision to fix asin test `asin` test fails on darwin with clang-19. reduce the test precision epsilon to 1e-7 fixes the test --- pkgs/by-name/xs/xsimd/package.nix | 3 +++ pkgs/by-name/xs/xsimd/relax-asin-precision.diff | 14 ++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 pkgs/by-name/xs/xsimd/relax-asin-precision.diff diff --git a/pkgs/by-name/xs/xsimd/package.nix b/pkgs/by-name/xs/xsimd/package.nix index 622f11f400bc..ad806a6a7d46 100644 --- a/pkgs/by-name/xs/xsimd/package.nix +++ b/pkgs/by-name/xs/xsimd/package.nix @@ -26,6 +26,9 @@ stdenv.mkDerivation (finalAttrs: { ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ # https://github.com/xtensor-stack/xsimd/issues/1030 ./disable-test_error_gamma.patch + + # https://github.com/xtensor-stack/xsimd/issues/1063 + ./relax-asin-precision.diff ]; # strictDeps raises the chance that xsimd will be able to be cross compiled diff --git a/pkgs/by-name/xs/xsimd/relax-asin-precision.diff b/pkgs/by-name/xs/xsimd/relax-asin-precision.diff new file mode 100644 index 000000000000..7623f6e81e4a --- /dev/null +++ b/pkgs/by-name/xs/xsimd/relax-asin-precision.diff @@ -0,0 +1,14 @@ +diff --git a/test/test_xsimd_api.cpp b/test/test_xsimd_api.cpp +index f416ae9..1f8253e 100644 +--- a/test/test_xsimd_api.cpp ++++ b/test/test_xsimd_api.cpp +@@ -468,7 +468,8 @@ struct xsimd_api_float_types_functions + void test_asin() + { + value_type val(1); +- CHECK_EQ(extract(xsimd::asin(T(val))), std::asin(val)); ++ CHECK(extract(xsimd::asin(T(val))) ++ == doctest::Approx(std::asin(val)).epsilon(1e-7)); + } + void test_asinh() + { From 90805a436c4766be35c1fcf38bdde6206643e3a1 Mon Sep 17 00:00:00 2001 From: Reno Dakota Date: Sat, 9 Nov 2024 15:03:14 -0800 Subject: [PATCH 12/44] gss: use autoreconfHook the provided configure script will break the build by using invalid c attributes on clang-19. using autoreconfHook fixes this. --- pkgs/by-name/gs/gss/package.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/by-name/gs/gss/package.nix b/pkgs/by-name/gs/gss/package.nix index 1271c52a4a8c..18020cf425f9 100644 --- a/pkgs/by-name/gs/gss/package.nix +++ b/pkgs/by-name/gs/gss/package.nix @@ -1,6 +1,8 @@ { lib , stdenv , fetchurl +, autoreconfHook +, gtk-doc , withShishi ? !stdenv.hostPlatform.isDarwin , shishi }: @@ -20,6 +22,8 @@ stdenv.mkDerivation rec { rm tests/krb5context.c ''; + nativeBuildInputs = [ autoreconfHook gtk-doc ]; + buildInputs = lib.optional withShishi shishi; # ./stdint.h:89:5: error: expected value in expression From 028069d767cca4ef0b8a469289e30f1aecacd945 Mon Sep 17 00:00:00 2001 From: Reno Dakota Date: Thu, 7 Nov 2024 22:23:22 -0800 Subject: [PATCH 13/44] darwin: remove -arch from cc/ld wrapper `-arch` in the cc/ld wrapper causes problems when specifying different `--target` options, which would succeed except for the conflicting `-arch` specifier. Reverts fc0456bed1372ccff51fc6fd578e5d2a09d64534 and b26e0bac8dab068e54b0c8ee1bf8fd5fe5683b39 --- pkgs/build-support/bintools-wrapper/default.nix | 4 ---- pkgs/build-support/cc-wrapper/default.nix | 4 ---- 2 files changed, 8 deletions(-) diff --git a/pkgs/build-support/bintools-wrapper/default.nix b/pkgs/build-support/bintools-wrapper/default.nix index 736494b5ee55..1d907aa31f48 100644 --- a/pkgs/build-support/bintools-wrapper/default.nix +++ b/pkgs/build-support/bintools-wrapper/default.nix @@ -343,10 +343,6 @@ stdenvNoCC.mkDerivation { done '' - + optionalString targetPlatform.isDarwin '' - echo "-arch ${targetPlatform.darwinArch}" >> $out/nix-support/libc-ldflags - '' - ## ## GNU specific extra strip flags ## diff --git a/pkgs/build-support/cc-wrapper/default.nix b/pkgs/build-support/cc-wrapper/default.nix index 6caf5103325a..d9174df31a2a 100644 --- a/pkgs/build-support/cc-wrapper/default.nix +++ b/pkgs/build-support/cc-wrapper/default.nix @@ -696,10 +696,6 @@ stdenvNoCC.mkDerivation { done '' - + optionalString targetPlatform.isDarwin '' - echo "-arch ${targetPlatform.darwinArch}" >> $out/nix-support/cc-cflags - '' - + optionalString targetPlatform.isAndroid '' echo "-D__ANDROID_API__=${targetPlatform.androidSdkVersion}" >> $out/nix-support/cc-cflags '' From 2bba9edd41ab5edd3093015b901ca39a48ec436b Mon Sep 17 00:00:00 2001 From: Reno Dakota Date: Sun, 10 Nov 2024 13:50:52 -0800 Subject: [PATCH 14/44] doxygen: 1.10.0 -> 1.12.0 https://github.com/doxygen/doxygen/releases/tag/Release_1_12_0 https://github.com/doxygen/doxygen/compare/Release_1_10_0...Release_1_12_0 --- .../tools/documentation/doxygen/default.nix | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/pkgs/development/tools/documentation/doxygen/default.nix b/pkgs/development/tools/documentation/doxygen/default.nix index 455f18ba0a3d..eccfd06e2889 100644 --- a/pkgs/development/tools/documentation/doxygen/default.nix +++ b/pkgs/development/tools/documentation/doxygen/default.nix @@ -15,23 +15,15 @@ stdenv.mkDerivation rec { pname = "doxygen"; - version = "1.10.0"; + version = "1.12.0"; src = fetchFromGitHub { owner = "doxygen"; repo = "doxygen"; rev = "Release_${lib.replaceStrings [ "." ] [ "_" ] version}"; - sha256 = "sha256-FPI5ICdn9Tne/g9SP6jAQS813AAyoDNooDR/Hyvq6R4="; + hash = "sha256-4zSaM49TjOaZvrUChM4dNJLondCsQPSArOXZnTHS4yI="; }; - patches = [ - (fetchpatch { - name = "sys-spdlog-fix.patch"; - url = "https://github.com/doxygen/doxygen/commit/0df6da616f01057d28b11c8bee28443c102dd424.patch"; - hash = "sha256-7efkCQFYGslwqhIuPsLYTEiA1rq+mO0DuyQBMt0O+m0="; - }) - ]; - nativeBuildInputs = [ cmake python3 @@ -49,9 +41,6 @@ stdenv.mkDerivation rec { "-Duse_sys_sqlite3=ON" ] ++ lib.optional (qt5 != null) "-Dbuild_wizard=YES"; - env.NIX_CFLAGS_COMPILE = - lib.optionalString stdenv.hostPlatform.isDarwin "-mmacosx-version-min=10.9"; - # put examples in an output so people/tools can test against them outputs = [ "out" "examples" ]; postInstall = '' From 99386b3957b8a5efbd780d8a1ed9ff8522222e9e Mon Sep 17 00:00:00 2001 From: Reno Dakota Date: Sun, 10 Nov 2024 16:17:22 -0800 Subject: [PATCH 15/44] poppler: fix clang-19 with upstream patch https://gitlab.freedesktop.org/poppler/poppler/-/commit/b4ac7d9af7cb5edfcfcbda035ed8b8c218ba8564 --- pkgs/development/libraries/poppler/default.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/development/libraries/poppler/default.nix b/pkgs/development/libraries/poppler/default.nix index 368c5a06a463..6ef6aca4b147 100644 --- a/pkgs/development/libraries/poppler/default.nix +++ b/pkgs/development/libraries/poppler/default.nix @@ -69,6 +69,14 @@ stdenv.mkDerivation (finalAttrs: rec { url = "https://gitlab.freedesktop.org/poppler/poppler/-/commit/0554731052d1a97745cb179ab0d45620589dd9c4.patch"; hash = "sha256-I78wJ4l1DSh+x/e00ZL8uvrGdBH+ufp+EDm0A1XWyCU="; }) + + (fetchpatch { + # fixes build on clang-19 + # https://gitlab.freedesktop.org/poppler/poppler/-/merge_requests/1526 + name = "char16_t-not-short.patch"; + url = "https://gitlab.freedesktop.org/poppler/poppler/-/commit/b4ac7d9af7cb5edfcfcbda035ed8b8c218ba8564.patch"; + hash = "sha256-2aEq3VDITJabvB/+bcdULBXbqVbDdL0xJr2TWLiWqX8="; + }) ]; nativeBuildInputs = [ From f7fa39509bc283313337d02ed2869013dfb79273 Mon Sep 17 00:00:00 2001 From: Reno Dakota Date: Sun, 10 Nov 2024 13:32:03 -0800 Subject: [PATCH 16/44] ctest_2_3: disable warn as error the development build is enabled for tests but also enables warn as error which creates an error when building the tests on clang-19. --- pkgs/development/libraries/catch2/3.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/libraries/catch2/3.nix b/pkgs/development/libraries/catch2/3.nix index b005dc3f8116..fe83ce36bf0b 100644 --- a/pkgs/development/libraries/catch2/3.nix +++ b/pkgs/development/libraries/catch2/3.nix @@ -25,6 +25,7 @@ stdenv.mkDerivation rec { cmakeFlags = [ "-DCATCH_DEVELOPMENT_BUILD=ON" "-DCATCH_BUILD_TESTING=${if doCheck then "ON" else "OFF"}" + "-DCATCH_ENABLE_WERROR=OFF" ] ++ lib.optionals (stdenv.hostPlatform.isDarwin && doCheck) [ # test has a faulty path normalization technique that won't work in # our darwin build environment https://github.com/catchorg/Catch2/issues/1691 From 68440b41d960f30d50d1ad769eb64be3b1eebdbf Mon Sep 17 00:00:00 2001 From: Reno Dakota Date: Sun, 10 Nov 2024 13:52:54 -0800 Subject: [PATCH 17/44] doxygen: fix build with clang-19 --- .../tools/documentation/doxygen/default.nix | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/pkgs/development/tools/documentation/doxygen/default.nix b/pkgs/development/tools/documentation/doxygen/default.nix index eccfd06e2889..e3a0f9609c0e 100644 --- a/pkgs/development/tools/documentation/doxygen/default.nix +++ b/pkgs/development/tools/documentation/doxygen/default.nix @@ -24,6 +24,24 @@ stdenv.mkDerivation rec { hash = "sha256-4zSaM49TjOaZvrUChM4dNJLondCsQPSArOXZnTHS4yI="; }; + patches = [ + # fix clang-19 build. can drop on next update + # https://github.com/doxygen/doxygen/pull/11064 + (fetchpatch { + name = "fix-clang-19-build.patch"; + url = "https://github.com/doxygen/doxygen/commit/cff64a87dea7596fd506a85521d4df4616dc845f.patch"; + hash = "sha256-TtkVfV9Ep8/+VGbTjP4NOP8K3p1+A78M+voAIQ+lzOk="; + }) + ]; + + # https://github.com/doxygen/doxygen/issues/10928#issuecomment-2179320509 + postPatch = '' + substituteInPlace CMakeLists.txt \ + --replace-fail 'JAVACC_CHAR_TYPE=\"unsigned char\"' \ + 'JAVACC_CHAR_TYPE=\"char8_t\"' \ + --replace-fail "CMAKE_CXX_STANDARD 17" "CMAKE_CXX_STANDARD 20" + ''; + nativeBuildInputs = [ cmake python3 From 085b1bbd394fd4df8e2f587d33dbdbe2c79821ca Mon Sep 17 00:00:00 2001 From: Reno Dakota Date: Mon, 11 Nov 2024 12:13:06 -0800 Subject: [PATCH 18/44] rav1e: fix clang-19 using system libgit2 / zlib update the unnecessary `built` package so we can use the system libgit2 and zlib which fixes the clang-19 build --- pkgs/by-name/ra/rav1e/package.nix | 24 +++++++-------- pkgs/by-name/ra/rav1e/update-built.diff | 40 +++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 13 deletions(-) create mode 100644 pkgs/by-name/ra/rav1e/update-built.diff diff --git a/pkgs/by-name/ra/rav1e/package.nix b/pkgs/by-name/ra/rav1e/package.nix index e8834ac131e4..dccb2d01a6b9 100644 --- a/pkgs/by-name/ra/rav1e/package.nix +++ b/pkgs/by-name/ra/rav1e/package.nix @@ -6,13 +6,11 @@ fetchCrate, pkg-config, cargo-c, - darwin, - libgit2, - libiconv, nasm, + libgit2, + zlib, nix-update-script, testers, - zlib, rav1e, }: @@ -25,22 +23,22 @@ rustPlatform.buildRustPackage rec { hash = "sha256-Db7qb7HBAy6lniIiN07iEzURmbfNtuhmgJRv7OUagUM="; }; - cargoHash = "sha256-VyQ6n2kIJ7OjK6Xlf0T0GNsBvgESRETzKZDZzAn8ZuY="; + # update built to be able to use the system libgit2 + cargoPatches = [ ./update-built.diff ]; + cargoHash = "sha256-Ud9Vw31y8nLo0aC3j7XY1+mN/pRvH9gJ0uIq73hKy3Y="; - depsBuildBuild = [ pkg-config ]; + depsBuildBuild = [ + pkg-config + libgit2 + zlib + ]; nativeBuildInputs = [ cargo-c - libgit2 nasm ]; - buildInputs = - [ zlib ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - libiconv - darwin.apple_sdk.frameworks.Security - ]; + env.LIBGIT2_NO_VENDOR = 1; # Darwin uses `llvm-strip`, which results in link errors when using `-x` to strip the asm library # and linking it with cctools ld64. diff --git a/pkgs/by-name/ra/rav1e/update-built.diff b/pkgs/by-name/ra/rav1e/update-built.diff new file mode 100644 index 000000000000..3b2a027545d9 --- /dev/null +++ b/pkgs/by-name/ra/rav1e/update-built.diff @@ -0,0 +1,40 @@ +diff --git a/Cargo.lock b/Cargo.lock +index 6825377..8512eba 100644 +--- a/Cargo.lock ++++ b/Cargo.lock +@@ -242,9 +242,9 @@ dependencies = [ + + [[package]] + name = "built" +-version = "0.7.1" ++version = "0.7.5" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "38d17f4d6e4dc36d1a02fbedc2753a096848e7c1b0772f7654eab8e2c927dd53" ++checksum = "c360505aed52b7ec96a3636c3f039d99103c37d1d9b4f7a8c743d3ea9ffcd03b" + dependencies = [ + "git2", + ] +@@ -633,9 +633,9 @@ checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" + + [[package]] + name = "git2" +-version = "0.18.1" ++version = "0.19.0" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "fbf97ba92db08df386e10c8ede66a2a0369bd277090afd8710e19e38de9ec0cd" ++checksum = "b903b73e45dc0c6c596f2d37eccece7c1c8bb6e4407b001096387c63d0d93724" + dependencies = [ + "bitflags 2.4.1", + "libc", +@@ -845,9 +845,9 @@ dependencies = [ + + [[package]] + name = "libgit2-sys" +-version = "0.16.1+1.7.1" ++version = "0.17.0+1.8.1" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "f2a2bb3680b094add03bb3732ec520ece34da31a8cd2d633d1389d0f0fb60d0c" ++checksum = "10472326a8a6477c3c20a64547b0059e4b0d086869eee31e6d7da728a8eb7224" + dependencies = [ + "cc", + "libc", From 2115c501c47d545ec7570474b3259ef2cca87a2f Mon Sep 17 00:00:00 2001 From: Reno Dakota Date: Sun, 10 Nov 2024 18:12:47 -0800 Subject: [PATCH 19/44] fmt_11: add patch to fix clang build --- pkgs/development/libraries/fmt/default.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/fmt/default.nix b/pkgs/development/libraries/fmt/default.nix index e2dcaadf5206..01b2b6828611 100644 --- a/pkgs/development/libraries/fmt/default.nix +++ b/pkgs/development/libraries/fmt/default.nix @@ -2,6 +2,7 @@ lib, stdenv, fetchFromGitHub, + fetchpatch, cmake, enableShared ? !stdenv.hostPlatform.isStatic, @@ -39,7 +40,7 @@ let nativeBuildInputs = [ cmake ]; - cmakeFlags = [ "-DBUILD_SHARED_LIBS=${if enableShared then "ON" else "OFF"}" ]; + cmakeFlags = [ (lib.cmakeBool "BUILD_SHARED_LIBS" enableShared) ]; doCheck = true; @@ -86,5 +87,12 @@ in fmt_11 = generic { version = "11.0.2"; hash = "sha256-IKNt4xUoVi750zBti5iJJcCk3zivTt7nU12RIf8pM+0="; + patches = [ + (fetchpatch { + name = "get-rid-of-std-copy-fix-clang.patch"; + url = "https://github.com/fmtlib/fmt/commit/6e462b89aa22fd5f737ed162d0150e145ccb1914.patch"; + hash = "sha256-tRU1y1VCxtQ5J2yvFmwUx+YNcQs8izzLImD37KBiCFk="; + }) + ]; }; } From 9460529b21618f648bef184aede27cf89c63e8d7 Mon Sep 17 00:00:00 2001 From: Reno Dakota Date: Tue, 12 Nov 2024 05:23:41 -0800 Subject: [PATCH 20/44] aspell: fix clang-19 with upstream patch https://github.com/GNUAspell/aspell/commit/ee6cbb12ff36a1e6618d7388a78dd4e0a2b44041 --- pkgs/development/libraries/aspell/default.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/aspell/default.nix b/pkgs/development/libraries/aspell/default.nix index 8c152d32ef6c..c5ac805f6be5 100644 --- a/pkgs/development/libraries/aspell/default.nix +++ b/pkgs/development/libraries/aspell/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, fetchzip, perl, ncurses +{ lib, stdenv, fetchpatch, fetchurl, fetchzip, perl, ncurses # for tests , aspell, glibc, runCommand @@ -27,7 +27,14 @@ stdenv.mkDerivation rec { hash = "sha256-1toSs01C1Ff6YE5DWtSEp0su/80SD/QKzWuz+yiH0hs="; }; - patches = lib.optional searchNixProfiles ./data-dirs-from-nix-profiles.patch; + patches = [ + # fix gcc-15 / clang-19 build. can remove on next update + (fetchpatch { + name = "fix-gcc-15-build.patch"; + url = "https://github.com/GNUAspell/aspell/commit/ee6cbb12ff36a1e6618d7388a78dd4e0a2b44041.patch"; + hash = "sha256-rW1FcfARdtT4wX+zGd2x/1K8zRp9JZhdR/zRd8RwPZA="; + }) + ] ++ lib.optional searchNixProfiles ./data-dirs-from-nix-profiles.patch; postPatch = '' patch interfaces/cc/aspell.h < ${./clang.patch} From 95dbbb4994a2cadce9addaf574a91ac939c54630 Mon Sep 17 00:00:00 2001 From: Reno Dakota Date: Mon, 11 Nov 2024 09:20:47 -0800 Subject: [PATCH 21/44] qt6.qtquick3d: fix clang-19 with upstream patch https://github.com/qt/qtquick3d/commit/636a5558470ba0e0a4db1ca23dc72d96dfabeccf --- pkgs/development/libraries/qt-6/modules/qtquick3d.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/development/libraries/qt-6/modules/qtquick3d.nix b/pkgs/development/libraries/qt-6/modules/qtquick3d.nix index 1c84856c0c12..fc40a408f4cc 100644 --- a/pkgs/development/libraries/qt-6/modules/qtquick3d.nix +++ b/pkgs/development/libraries/qt-6/modules/qtquick3d.nix @@ -2,10 +2,19 @@ , qtbase , qtdeclarative , openssl +, fetchpatch }: qtModule { pname = "qtquick3d"; propagatedBuildInputs = [ qtbase qtdeclarative ]; buildInputs = [ openssl ]; + patches = [ + # should be able to remove on next update + (fetchpatch { + name = "fix-clang-19-build.patch"; + url = "https://github.com/qt/qtquick3d/commit/636a5558470ba0e0a4db1ca23dc72d96dfabeccf.patch"; + hash = "sha256-xBzOoVWDWvpxbSHKWeeWY1ZVldsjoUeJqFcfpvjEWAg="; + }) + ]; } From 3c76f37753a5c86e6af01047bfdd69453cec3bf8 Mon Sep 17 00:00:00 2001 From: Reno Dakota Date: Wed, 13 Nov 2024 00:02:43 -0800 Subject: [PATCH 22/44] zxing-cpp: c++20 for char8_t build fails on clang-19 due to using c++ 17 and having char8_t typedefed to an uint8_t, which is not supported by std::char_traits. Using c++20 fixes this as the code will use a char8_t. Used a substituteInPlace so the override can be removed once c++20 is the default in the cmake file. --- pkgs/by-name/zx/zxing-cpp/package.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/by-name/zx/zxing-cpp/package.nix b/pkgs/by-name/zx/zxing-cpp/package.nix index affac873f2cd..e162d3c40673 100644 --- a/pkgs/by-name/zx/zxing-cpp/package.nix +++ b/pkgs/by-name/zx/zxing-cpp/package.nix @@ -18,6 +18,12 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-teFspdATn9M7Z1vSr/7PdJx/xAv+TVai8rIekxqpBZk="; }; + # c++ 20 needed for char8_t or clang-19 build fails + postPatch = '' + substituteInPlace CMakeLists.txt \ + --replace-fail "CMAKE_CXX_STANDARD 17" "CMAKE_CXX_STANDARD 20" + ''; + nativeBuildInputs = [ cmake pkg-config From 8169aae6986dd9dc71e7537892a7b7d54f7d5e4e Mon Sep 17 00:00:00 2001 From: Reno Dakota Date: Sat, 9 Nov 2024 15:02:34 -0800 Subject: [PATCH 23/44] nlohmann_json: fix tests to compile with clang-19 https://releases.llvm.org/19.1.0/projects/libcxx/docs/ReleaseNotes.html > The base template for std::char_traits has been removed in LLVM 19. If > you are using std::char_traits with types other than char, wchar_t, > char8_t, char16_t, char32_t or a custom character type for which you > specialized std::char_traits, your code will stop working. --- .../make-tests-build-clang-19.diff | 98 +++++++++++++++++++ pkgs/by-name/nl/nlohmann_json/package.nix | 6 ++ 2 files changed, 104 insertions(+) create mode 100644 pkgs/by-name/nl/nlohmann_json/make-tests-build-clang-19.diff diff --git a/pkgs/by-name/nl/nlohmann_json/make-tests-build-clang-19.diff b/pkgs/by-name/nl/nlohmann_json/make-tests-build-clang-19.diff new file mode 100644 index 000000000000..ceb869251469 --- /dev/null +++ b/pkgs/by-name/nl/nlohmann_json/make-tests-build-clang-19.diff @@ -0,0 +1,98 @@ +diff --git a/tests/src/unit-bson.cpp b/tests/src/unit-bson.cpp +index 13216f2..fdfc350 100644 +--- a/tests/src/unit-bson.cpp ++++ b/tests/src/unit-bson.cpp +@@ -621,7 +621,7 @@ TEST_CASE("BSON input/output_adapters") + { + SECTION("std::ostringstream") + { +- std::basic_ostringstream ss; ++ std::basic_ostringstream ss; + json::to_bson(json_representation, ss); + json j3 = json::from_bson(ss.str()); + CHECK(json_representation == j3); +diff --git a/tests/src/unit-cbor.cpp b/tests/src/unit-cbor.cpp +index be94d2f..2b396b7 100644 +--- a/tests/src/unit-cbor.cpp ++++ b/tests/src/unit-cbor.cpp +@@ -1881,7 +1881,7 @@ TEST_CASE("single CBOR roundtrip") + { + SECTION("std::ostringstream") + { +- std::basic_ostringstream ss; ++ std::basic_ostringstream ss; + json::to_cbor(j1, ss); + json j3 = json::from_cbor(ss.str()); + CHECK(j1 == j3); +diff --git a/tests/src/unit-deserialization.cpp b/tests/src/unit-deserialization.cpp +index 3bc161f..e4918b0 100644 +--- a/tests/src/unit-deserialization.cpp ++++ b/tests/src/unit-deserialization.cpp +@@ -1131,13 +1131,11 @@ TEST_CASE("deserialization") + } + } + ++ + TEST_CASE_TEMPLATE("deserialization of different character types (ASCII)", T, +- char, unsigned char, signed char, ++ char, + wchar_t, +- char16_t, char32_t, +- std::uint8_t, std::int8_t, +- std::int16_t, std::uint16_t, +- std::int32_t, std::uint32_t) ++ char16_t, char32_t) + { + std::vector const v = {'t', 'r', 'u', 'e'}; + CHECK(json::parse(v) == json(true)); +@@ -1163,7 +1161,7 @@ TEST_CASE_TEMPLATE("deserialization of different character types (UTF-8)", T, + } + + TEST_CASE_TEMPLATE("deserialization of different character types (UTF-16)", T, +- char16_t, std::uint16_t) ++ char16_t) + { + // a star emoji + std::vector const v = {static_cast('"'), static_cast(0x2b50), static_cast(0xfe0f), static_cast('"')}; +@@ -1176,7 +1174,7 @@ TEST_CASE_TEMPLATE("deserialization of different character types (UTF-16)", T, + } + + TEST_CASE_TEMPLATE("deserialization of different character types (UTF-32)", T, +- char32_t, std::uint32_t) ++ char32_t) + { + // a star emoji + std::vector const v = {static_cast('"'), static_cast(0x2b50), static_cast(0xfe0f), static_cast('"')}; +diff --git a/tests/src/unit-msgpack.cpp b/tests/src/unit-msgpack.cpp +index 61162af..cfbb1fa 100644 +--- a/tests/src/unit-msgpack.cpp ++++ b/tests/src/unit-msgpack.cpp +@@ -1604,7 +1604,7 @@ TEST_CASE("single MessagePack roundtrip") + { + SECTION("std::ostringstream") + { +- std::basic_ostringstream ss; ++ std::basic_ostringstream ss; + json::to_msgpack(j1, ss); + json j3 = json::from_msgpack(ss.str()); + CHECK(j1 == j3); +diff --git a/tests/src/unit-regression2.cpp b/tests/src/unit-regression2.cpp +index fab9aae..98947c5 100644 +--- a/tests/src/unit-regression2.cpp ++++ b/tests/src/unit-regression2.cpp +@@ -674,6 +674,7 @@ TEST_CASE("regression tests 2") + CHECK(j.dump() == "{}"); + } + ++#if 0 + #ifdef JSON_HAS_CPP_20 + #if __has_include() + SECTION("issue #2546 - parsing containers of std::byte") +@@ -684,6 +685,7 @@ TEST_CASE("regression tests 2") + CHECK(j.dump() == "\"Hello, world!\""); + } + #endif ++#endif + #endif + + SECTION("issue #2574 - Deserialization to std::array, std::pair, and std::tuple with non-default constructable types fails") diff --git a/pkgs/by-name/nl/nlohmann_json/package.nix b/pkgs/by-name/nl/nlohmann_json/package.nix index d690cc45b2f9..8acc3d2d27ec 100644 --- a/pkgs/by-name/nl/nlohmann_json/package.nix +++ b/pkgs/by-name/nl/nlohmann_json/package.nix @@ -21,6 +21,12 @@ in stdenv.mkDerivation (finalAttrs: { hash = "sha256-7F0Jon+1oWL7uqet5i1IgHX0fUw/+z0QwEcA3zs5xHg="; }; + patches = lib.optionals stdenv.cc.isClang [ + # tests fail to compile on clang-19 + # https://github.com/nlohmann/json/issues/4490 + ./make-tests-build-clang-19.diff + ]; + nativeBuildInputs = [ cmake ]; cmakeFlags = [ From 71e3992d77c11199cd388c27b0806be93cbedd88 Mon Sep 17 00:00:00 2001 From: Reno Dakota Date: Sun, 10 Nov 2024 18:13:19 -0800 Subject: [PATCH 24/44] mariadb: use fmt_11 for 10.11 & greater https://github.com/MariaDB/server/blob/mariadb-10.11.10/cmake/libfmt.cmake uses fmt 11.0.2 --- pkgs/servers/sql/mariadb/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/servers/sql/mariadb/default.nix b/pkgs/servers/sql/mariadb/default.nix index 76ce8d6b6dc9..a178e1fa28e4 100644 --- a/pkgs/servers/sql/mariadb/default.nix +++ b/pkgs/servers/sql/mariadb/default.nix @@ -14,7 +14,7 @@ let , bzip2, lz4, lzo, snappy, xz, zlib, zstd , cracklib, judy, libevent, libxml2 , linux-pam, numactl - , fmt_8 + , fmt_11 , withStorageMroonga ? true, kytea, libsodium, msgpack, zeromq , withStorageRocks ? true , withEmbedded ? false @@ -149,7 +149,7 @@ let ]; buildInputs = common.buildInputs - ++ lib.optionals (lib.versionAtLeast common.version "10.7") [ fmt_8 ]; + ++ lib.optionals (lib.versionAtLeast common.version "10.11") [ fmt_11 ]; cmakeFlags = common.cmakeFlags ++ [ "-DPLUGIN_AUTH_PAM=NO" @@ -179,7 +179,7 @@ let ++ lib.optionals stdenv.hostPlatform.isLinux [ linux-pam ] ++ lib.optional (!stdenv.hostPlatform.isDarwin) mytopEnv ++ lib.optionals withStorageMroonga [ kytea libsodium msgpack zeromq ] - ++ lib.optionals (lib.versionAtLeast common.version "10.7") [ fmt_8 ]; + ++ lib.optionals (lib.versionAtLeast common.version "10.11") [ fmt_11 ]; propagatedBuildInputs = lib.optional withNuma numactl; From 8f5c55067c4e6477a05c98e22ae0d326075b375d Mon Sep 17 00:00:00 2001 From: Reno Dakota Date: Wed, 13 Nov 2024 01:08:35 -0800 Subject: [PATCH 25/44] rapidjson: disable tests which fail to compile disable two tests which fail to compile on clang-19 due to trying to use an unsigned type for which a std::char_traits does not exits. --- .../char_traits-clang-19-errors.diff | 22 +++++++++++++++++++ pkgs/by-name/ra/rapidjson/package.nix | 4 ++++ 2 files changed, 26 insertions(+) create mode 100644 pkgs/by-name/ra/rapidjson/char_traits-clang-19-errors.diff diff --git a/pkgs/by-name/ra/rapidjson/char_traits-clang-19-errors.diff b/pkgs/by-name/ra/rapidjson/char_traits-clang-19-errors.diff new file mode 100644 index 000000000000..c057b3c1ec6a --- /dev/null +++ b/pkgs/by-name/ra/rapidjson/char_traits-clang-19-errors.diff @@ -0,0 +1,22 @@ +diff --git a/test/unittest/writertest.cpp b/test/unittest/writertest.cpp +index 4c24121..66c9087 100644 +--- a/test/unittest/writertest.cpp ++++ b/test/unittest/writertest.cpp +@@ -386,6 +386,9 @@ TEST(Writer, InvalidEncoding) { + writer.EndArray(); + } + ++ ++ // does not compile on clang-19 ++#if 0 + // Fail in encoding + { + StringBuffer buffer; +@@ -401,6 +404,7 @@ TEST(Writer, InvalidEncoding) { + static const UTF32<>::Ch s[] = { 0x110000, 0 }; // Out of U+0000 to U+10FFFF + EXPECT_FALSE(writer.String(s)); + } ++#endif + } + + TEST(Writer, ValidateEncoding) { diff --git a/pkgs/by-name/ra/rapidjson/package.nix b/pkgs/by-name/ra/rapidjson/package.nix index 09707dc75b9a..887beaa63051 100644 --- a/pkgs/by-name/ra/rapidjson/package.nix +++ b/pkgs/by-name/ra/rapidjson/package.nix @@ -29,6 +29,10 @@ stdenv.mkDerivation (finalAttrs: { ./use-nixpkgs-gtest.patch # https://github.com/Tencent/rapidjson/issues/2214 ./suppress-valgrind-failures.patch + + # disable tests which don't build on clang-19 + # https://github.com/Tencent/rapidjson/issues/2318 + ./char_traits-clang-19-errors.diff ]; postPatch = '' From 462534f9bf3479c7536f4497d15dfed4dbd12356 Mon Sep 17 00:00:00 2001 From: Reno Dakota Date: Wed, 13 Nov 2024 00:19:20 -0800 Subject: [PATCH 26/44] mjpegtools: fix clang-19 by removing dead code clang-19 errors out due to some unused debugging functions which access undefined class members. Deleting the code fixes the build. --- pkgs/by-name/mj/mjpegtools/package.nix | 12 +- .../remove-subtract-and-union-debug.diff | 347 ++++++++++++++++++ 2 files changed, 356 insertions(+), 3 deletions(-) create mode 100644 pkgs/by-name/mj/mjpegtools/remove-subtract-and-union-debug.diff diff --git a/pkgs/by-name/mj/mjpegtools/package.nix b/pkgs/by-name/mj/mjpegtools/package.nix index 147c30fed4c5..ba500f04385c 100644 --- a/pkgs/by-name/mj/mjpegtools/package.nix +++ b/pkgs/by-name/mj/mjpegtools/package.nix @@ -16,9 +16,15 @@ stdenv.mkDerivation rec { sha256 = "sha256-sYBTbX2ZYLBeACOhl7ANyxAJKaSaq3HRnVX0obIQ9Jo="; }; - # Clang 16 defaults to C++17. `std::auto_ptr` has been removed from C++17, and the - # `register` type class specifier is no longer allowed. - patches = [ ./c++-17-fixes.patch ]; + patches = [ + # Clang 16 defaults to C++17. `std::auto_ptr` has been removed from C++17, + # and the `register` type class specifier is no longer allowed. + ./c++-17-fixes.patch + + # Clang-19 errors out for dead code (in header) which accesses undefined + # class members + ./remove-subtract-and-union-debug.diff + ]; hardeningDisable = [ "format" ]; diff --git a/pkgs/by-name/mj/mjpegtools/remove-subtract-and-union-debug.diff b/pkgs/by-name/mj/mjpegtools/remove-subtract-and-union-debug.diff new file mode 100644 index 000000000000..1d1ff88afcae --- /dev/null +++ b/pkgs/by-name/mj/mjpegtools/remove-subtract-and-union-debug.diff @@ -0,0 +1,347 @@ +diff --git a/y4mdenoise/Region2D.hh b/y4mdenoise/Region2D.hh +index b44e93f..ebc2821 100644 +--- a/y4mdenoise/Region2D.hh ++++ b/y4mdenoise/Region2D.hh +@@ -97,35 +97,11 @@ public: + // Add the given horizontal extent to the region. Note that + // a_tnXEnd is technically one past the end of the extent. + +- template +- void UnionDebug (Status_t &a_reStatus, INDEX a_tnY, +- INDEX a_tnXStart, INDEX a_tnXEnd, REGION_TEMP &a_rTemp); +- // Add the given horizontal extent to the region. Note that +- // a_tnXEnd is technically one past the end of the extent. +- // Exhaustively (i.e. slowly) verifies the results, using a +- // much simpler algorithm. +- // Requires the use of a temporary region, usually of the +- // final subclass' type, in order to work. (Since that can't +- // be known at this level, a template parameter is included for +- // it.) +- + template + void Union (Status_t &a_reStatus, const REGION &a_rOther); + // Make the current region represent the union between itself + // and the other given region. + +- template +- void UnionDebug (Status_t &a_reStatus, +- REGION_O &a_rOther, REGION_TEMP &a_rTemp); +- // Make the current region represent the union between itself +- // and the other given region. +- // Exhaustively (i.e. slowly) verifies the results, using a +- // much simpler algorithm. +- // Requires the use of a temporary region, usually of the +- // final subclass' type, in order to work. (Since that can't +- // be known at this level, a template parameter is included for +- // it.) +- + //void Merge (Status_t &a_reStatus, INDEX a_tnY, INDEX a_tnXStart, + // INDEX a_tnXEnd); + // Merge this extent into the current region. +@@ -166,37 +142,12 @@ public: + // Subtract the given horizontal extent from the region. Note + // that a_tnXEnd is technically one past the end of the extent. + +- template +- void SubtractDebug (Status_t &a_reStatus, INDEX a_tnY, +- INDEX a_tnXStart, INDEX a_tnXEnd, REGION_TEMP &a_rTemp); +- // Subtract the given horizontal extent from the region. Note +- // that a_tnXEnd is technically one past the end of the extent. +- // Exhaustively (i.e. slowly) verifies the results, using a +- // much simpler algorithm. +- // Requires the use of a temporary region, usually of the +- // final subclass' type, in order to work. (Since that can't +- // be known at this level, a template parameter is included for +- // it.) +- + template + void Subtract (Status_t &a_reStatus, const REGION &a_rOther); + // Subtract the other region from the current region, i.e. + // remove from the current region any extents that exist in the + // other region. + +- template +- void SubtractDebug (Status_t &a_reStatus, REGION_O &a_rOther, +- REGION_TEMP &a_rTemp); +- // Subtract the other region from the current region, i.e. +- // remove from the current region any extents that exist in the +- // other region. +- // Exhaustively (i.e. slowly) verifies the results, using a +- // much simpler algorithm. +- // Requires the use of a temporary region, usually of the +- // final subclass' type, in order to work. (Since that can't +- // be known at this level, a template parameter is included for +- // it.) +- + //typedef ... ConstIterator; + //ConstIterator Begin (void) const { return m_setExtents.Begin(); } + //ConstIterator End (void) const { return m_setExtents.End(); } +@@ -404,85 +355,6 @@ Region2D::~Region2D() + + + +-// Add the given horizontal extent to the region. +-template +-template +-void +-Region2D::UnionDebug (Status_t &a_reStatus, INDEX a_tnY, +- INDEX a_tnXStart, INDEX a_tnXEnd, REGION_TEMP &a_rTemp) +-{ +- typename REGION::ConstIterator itHere; +- typename REGION_TEMP::ConstIterator itHereO; +- INDEX tnX; +- // Used to loop through points. +- +- // Make sure they didn't start us off with an error. +- assert (a_reStatus == g_kNoError); +- +- // Calculate the union. +- a_rTemp.Assign (a_reStatus, *this); +- if (a_reStatus != g_kNoError) +- return; +- a_rTemp.Union (a_reStatus, a_tnY, a_tnXStart, a_tnXEnd); +- if (a_reStatus != g_kNoError) +- return; +- +- // Loop through every point in the result, make sure it's in +- // one of the two input regions. +- for (itHereO = a_rTemp.Begin(); itHereO != a_rTemp.End(); ++itHereO) +- { +- const Extent &rHere = *itHereO; +- for (tnX = rHere.m_tnXStart; tnX < rHere.m_tnXEnd; ++tnX) +- { +- if (!((rHere.m_tnY == a_tnY +- && (tnX >= a_tnXStart && tnX < a_tnXEnd)) +- || this->DoesContainPoint (rHere.m_tnY, tnX))) +- goto error; +- } +- } +- +- // Loop through every point in the original region, make sure +- // it's in the result. +- for (itHere = this->Begin(); itHere != this->End(); ++itHere) +- { +- const Extent &rHere = *itHere; +- for (tnX = rHere.m_tnXStart; tnX < rHere.m_tnXEnd; ++tnX) +- { +- if (!a_rTemp.DoesContainPoint (rHere.m_tnY, tnX)) +- goto error; +- } +- } +- +- // Loop through every point in the added extent, make sure it's in +- // the result. +- for (tnX = a_tnXStart; tnX < a_tnXEnd; ++tnX) +- { +- if (!a_rTemp.DoesContainPoint (a_tnY, tnX)) +- goto error; +- } +- +- // The operation succeeded. Commit it. +- Assign (a_reStatus, a_rTemp); +- if (a_reStatus != g_kNoError) +- return; +- +- // All done. +- return; +- +-error: +- // Handle deviations. +- fprintf (stderr, "Region2D::Union() failed\n"); +- fprintf (stderr, "Input region:\n"); +- PrintRegion (*this); +- fprintf (stderr, "Input extent: [%d,%d-%d]\n", +- int (a_tnY), int (a_tnXStart), int (a_tnXEnd)); +- fprintf (stderr, "Result:\n"); +- PrintRegion (a_rTemp); +- assert (false); +-} +- +- +- + // Make the current region represent the union between itself + // and the other given region. + template +@@ -513,182 +385,6 @@ Region2D::Union (Status_t &a_reStatus, + + + +-// Make the current region represent the union between itself +-// and the other given region. +-template +-template +-void +-Region2D::UnionDebug (Status_t &a_reStatus, +- REGION_O &a_rOther, REGION_TEMP &a_rTemp) +-{ +- typename REGION::ConstIterator itHere; +- typename REGION_O::ConstIterator itHereO; +- typename REGION_TEMP::ConstIterator itHereT; +- INDEX tnX; +- // Used to loop through points. +- +- // Make sure they didn't start us off with an error. +- assert (a_reStatus == g_kNoError); +- +- // Calculate the union. +- a_rTemp.Assign (a_reStatus, *this); +- if (a_reStatus != g_kNoError) +- return; +- a_rTemp.Union (a_reStatus, a_rOther); +- if (a_reStatus != g_kNoError) +- return; +- +- // Loop through every point in the result, make sure it's in +- // one of the two input regions. +- for (itHereT = a_rTemp.Begin(); itHereT != a_rTemp.End(); ++itHereT) +- { +- const Extent &rHere = *itHereT; +- for (tnX = rHere.m_tnXStart; tnX < rHere.m_tnXEnd; ++tnX) +- { +- if (!a_rOther.DoesContainPoint (rHere.m_tnY, tnX) +- && !this->DoesContainPoint (rHere.m_tnY, tnX)) +- goto error; +- } +- } +- +- // Loop through every point in the first input region, make sure +- // it's in the result. +- for (itHere = this->Begin(); itHere != this->End(); ++itHere) +- { +- const Extent &rHere = *itHere; +- for (tnX = rHere.m_tnXStart; tnX < rHere.m_tnXEnd; ++tnX) +- { +- if (!a_rTemp.DoesContainPoint (rHere.m_tnY, tnX)) +- goto error; +- } +- } +- +- // Loop through every point in the second input region, make sure +- // it's in the result. +- for (itHereO = a_rOther.Begin(); +- itHereO != a_rOther.End(); +- ++itHereO) +- { +- const Extent &rHere = *itHereO; +- for (tnX = rHere.m_tnXStart; tnX < rHere.m_tnXEnd; ++tnX) +- { +- if (!a_rTemp.DoesContainPoint (rHere.m_tnY, tnX)) +- goto error; +- } +- } +- +- // The operation succeeded. Commit it. +- Assign (a_reStatus, a_rTemp); +- if (a_reStatus != g_kNoError) +- return; +- +- // All done. +- return; +- +-error: +- // Handle deviations. +- fprintf (stderr, "Region2D::Union() failed\n"); +- fprintf (stderr, "First input region:\n"); +- PrintRegion (*this); +- fprintf (stderr, "Second input region:\n"); +- PrintRegion (a_rOther); +- fprintf (stderr, "Result:\n"); +- PrintRegion (a_rTemp); +- assert (false); +-} +- +- +- +-// Subtract the other region from the current region, i.e. +-// remove from the current region any areas that exist in the +-// other region. +-template +-template +-void +-Region2D::SubtractDebug (Status_t &a_reStatus, +- REGION_O &a_rOther, REGION_TEMP &a_rTemp) +-{ +- typename REGION::ConstIterator itHere; +- typename REGION_O::ConstIterator itHereO; +- typename REGION_TEMP::ConstIterator itHereT; +- INDEX tnX; +- // Used to loop through points. +- +- // Make sure they didn't start us off with an error. +- assert (a_reStatus == g_kNoError); +- +- // Calculate the difference. +- a_rTemp.Assign (a_reStatus, *this); +- if (a_reStatus != g_kNoError) +- return; +- a_rTemp.Subtract (a_reStatus, a_rOther); +- if (a_reStatus != g_kNoError) +- return; +- +- // Loop through every point in the result, make sure it's in +- // the first input region but not the second. +- for (itHereT = a_rTemp.Begin(); itHereT != a_rTemp.End(); ++itHereT) +- { +- const Extent &rHere = *itHereT; +- for (tnX = rHere.m_tnXStart; tnX < rHere.m_tnXEnd; ++tnX) +- { +- if (!(this->DoesContainPoint (rHere.m_tnY, tnX) +- && !a_rOther.DoesContainPoint (rHere.m_tnY, tnX))) +- goto error; +- } +- } +- +- // Loop through every point in the first input region, and if it's +- // not in the second input region, make sure it's in the result. +- for (itHere = this->Begin(); itHere != this->End(); ++itHere) +- { +- const Extent &rHere = *itHere; +- for (tnX = rHere.m_tnXStart; tnX < rHere.m_tnXEnd; ++tnX) +- { +- if (!a_rOther.DoesContainPoint (rHere.m_tnY, tnX)) +- { +- if (!a_rTemp.DoesContainPoint (rHere.m_tnY, tnX)) +- goto error; +- } +- } +- } +- +- // Loop through every point in the second input region, make sure +- // it's not in the result. +- for (itHereO = a_rOther.Begin(); +- itHereO != a_rOther.End(); +- ++itHereO) +- { +- const Extent &rHere = *itHere; +- for (tnX = rHere.m_tnXStart; tnX < rHere.m_tnXEnd; ++tnX) +- { +- if (a_rTemp.DoesContainPoint (rHere.m_tnY, tnX)) +- goto error; +- } +- } +- +- // The operation succeeded. Commit it. +- Assign (a_reStatus, a_rTemp); +- if (a_reStatus != g_kNoError) +- return; +- +- // All done. +- return; +- +-error: +- // Handle deviations. +- fprintf (stderr, "Region2D::Subtract() failed\n"); +- fprintf (stderr, "First input region:\n"); +- PrintRegion (*this); +- fprintf (stderr, "Second input region:\n"); +- PrintRegion (a_rOther); +- fprintf (stderr, "Result:\n"); +- PrintRegion (a_rTemp); +- assert (false); +-} +- +- +- + // Flood-fill the current region. + template + template From 07029deebba96c9cdab1729375ae26bfbf496c7f Mon Sep 17 00:00:00 2001 From: Reno Dakota Date: Tue, 12 Nov 2024 13:43:17 -0800 Subject: [PATCH 27/44] haskellPackages.hermes-json: fix vendored simdjson with clang-19 --- .../haskell-modules/configuration-common.nix | 33 +++++++++++++++++-- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix index bd174babd549..c7f935d4288a 100644 --- a/pkgs/development/haskell-modules/configuration-common.nix +++ b/pkgs/development/haskell-modules/configuration-common.nix @@ -2578,9 +2578,36 @@ self: super: { testTarget = "tests"; }) super.conduit-aeson; - # Upper bounds are too strict: - # https://github.com/velveteer/hermes/pull/22 - hermes-json = doJailbreak super.hermes-json; + hermes-json = overrideCabal (drv: { + # Upper bounds are too strict: + # https://github.com/velveteer/hermes/pull/22 + jailbreak = true; + + # vendored simdjson breaks with clang-19. apply patches that work with + # a more recent simdjson so we can un-vendor it + patches = drv.patches or [] ++ [ + (fetchpatch { + url = "https://github.com/velveteer/hermes/commit/6fd9904d93a5c001aadb27c114345a6958904d71.patch"; + hash = "sha256-Pv09XP0/VjUiAFp237Adj06PIZU21mQRh7guTlKksvA="; + excludes = [ + ".github/*" + "hermes-bench/*" + ]; + }) + (fetchpatch { + url = "https://github.com/velveteer/hermes/commit/ca8dddbf52f9d7788460a056fefeb241bcd09190.patch"; + hash = "sha256-tDDGS0QZ3YWe7+SP09wnxx6lIWL986ce5Zhqr7F2sBk="; + excludes = [ + "README.md" + ".github/*" + "hermes-bench/*" + ]; + }) + ]; + postPatch = drv.postPatch or "" + '' + ln -fs ${pkgs.simdjson.src} simdjson + ''; + }) super.hermes-json; # Disabling doctests. regex-tdfa = overrideCabal { From da65c302a18a59c48111bdf219de09cd4b314ce9 Mon Sep 17 00:00:00 2001 From: Reno Dakota Date: Mon, 11 Nov 2024 20:55:56 -0800 Subject: [PATCH 28/44] openjpeg: fix up tests tests were failing with clang-19 due to vendoring an old zlib. However, even with the compile error fixed the tests would report success even with the majority of them failing due to a missing data directory. download the data directory to run the tests and just run tests by cmake. 8% of the tests do fail and are excluded --- pkgs/by-name/op/openjpeg/exclude-tests | 52 +++++++++++++++++++++++++ pkgs/by-name/op/openjpeg/package.nix | 54 ++++++++++++++++---------- 2 files changed, 85 insertions(+), 21 deletions(-) create mode 100644 pkgs/by-name/op/openjpeg/exclude-tests diff --git a/pkgs/by-name/op/openjpeg/exclude-tests b/pkgs/by-name/op/openjpeg/exclude-tests new file mode 100644 index 000000000000..060c48e8fe85 --- /dev/null +++ b/pkgs/by-name/op/openjpeg/exclude-tests @@ -0,0 +1,52 @@ +NR-C1P0-p0_04.j2k-compare2base +NR-C1P0-p0_05.j2k-compare2base +NR-C1P0-p0_06.j2k-compare2base +NR-C1P1-p1_02.j2k-compare2base +NR-C1P1-p1_03.j2k-compare2base +NR-C1P1-p1_04.j2k-compare2base +NR-C1P1-p1_05.j2k-compare2base +NR-JP2-file2.jp2-compare2base +NR-RIC-subsampling_1.jp2-compare2base +NR-RIC-subsampling_2.jp2-compare2base +NR-RIC-zoo1.jp2-compare2base +NR-RIC-zoo2.jp2-compare2base +NR-DEC-_00042.j2k-2-decode-md5 +NR-DEC-buxI.j2k-9-decode-md5 +NR-DEC-CT_Phillips_JPEG2K_Decompr_Problem.j2k-13-decode-md5 +NR-DEC-Marrin.jp2-18-decode-md5 +NR-DEC-kodak_2layers_lrcp.j2c-31-decode-md5 +NR-DEC-kodak_2layers_lrcp.j2c-32-decode-md5 +NR-DEC-file409752.jp2-40-decode-md5 +NR-DEC-issue188_beach_64bitsbox.jp2-41-decode-md5 +NR-DEC-issue206_image-000.jp2-42-decode-md5 +NR-DEC-issue205.jp2-43-decode-md5 +NR-DEC-issue228.j2k-60-decode-md5 +NR-DEC-issue142.j2k-66-decode-md5 +NR-DEC-issue134.jp2-67-decode-md5 +NR-DEC-issue135.j2k-68-decode-md5 +NR-DEC-issue208.jp2-69-decode-md5 +NR-DEC-issue211.jp2-70-decode-md5 +NR-DEC-issue226.j2k-74-decode +NR-DEC-issue226.j2k-74-decode-md5 +NR-DEC-p1_04.j2k-124-decode-md5 +NR-DEC-p1_04.j2k-125-decode-md5 +NR-DEC-p1_04.j2k-126-decode-md5 +NR-DEC-p1_04.j2k-127-decode-md5 +NR-DEC-p1_04.j2k-128-decode-md5 +NR-DEC-p1_04.j2k-129-decode-md5 +NR-DEC-p1_04.j2k-131-decode-md5 +NR-DEC-p1_04.j2k-138-decode-md5 +NR-DEC-p1_04.j2k-140-decode-md5 +NR-DEC-p0_04.j2k-166-decode-md5 +NR-DEC-p0_04.j2k-167-decode-md5 +NR-DEC-p0_04.j2k-168-decode-md5 +NR-DEC-p0_04.j2k-172-decode-md5 +NR-DEC-issue205.jp2-253-decode-md5 +NR-DEC-issue236-ESYCC-CDEF.jp2-254-decode-md5 +NR-DEC-issue559-eci-090-CIELab.jp2-255-decode-md5 +NR-DEC-issue559-eci-091-CIELab.jp2-256-decode-md5 +NR-DEC-db11217111510058.jp2-306-decode-md5 +NR-DEC-tnsot_zero.jp2-307-decode-md5 +NR-DEC-Bretagne1_ht_lossy.j2k-311-decode-md5 +Found-But-No-Test-issue1472-bigloop.j2k +Found-But-No-Test-small_world_non_consecutive_tilepart_tlm.jp2 diff --git a/pkgs/by-name/op/openjpeg/package.nix b/pkgs/by-name/op/openjpeg/package.nix index 0bfa1067a7f7..618a251ce515 100644 --- a/pkgs/by-name/op/openjpeg/package.nix +++ b/pkgs/by-name/op/openjpeg/package.nix @@ -1,5 +1,5 @@ { lib, stdenv, fetchFromGitHub, cmake, pkg-config -, libpng, libtiff, zlib, lcms2, jpylyzer +, libpng, libtiff, zlib, lcms2 , jpipLibSupport ? false # JPIP library & executables , jpipServerSupport ? false, curl, fcgi # JPIP Server , jdk @@ -17,33 +17,42 @@ , vips }: -let - mkFlag = optSet: flag: "-D${flag}=${if optSet then "ON" else "OFF"}"; -in - stdenv.mkDerivation rec { pname = "openjpeg"; version = "2.5.2"; - src = fetchFromGitHub { - owner = "uclouvain"; - repo = "openjpeg"; - rev = "v${version}"; - hash = "sha256-mQ9B3MJY2/bg0yY/7jUJrAXM6ozAHT5fmwES5Q1SGxw="; - }; + srcs = [ + (fetchFromGitHub { + owner = "uclouvain"; + repo = "openjpeg"; + rev = "v${version}"; + hash = "sha256-mQ9B3MJY2/bg0yY/7jUJrAXM6ozAHT5fmwES5Q1SGxw="; + }) + # data for tests. may need to get updated with package + # https://github.com/uclouvain/openjpeg-data + (fetchFromGitHub { + name = "data"; + owner = "uclouvain"; + repo = "openjpeg-data"; + rev = "a428429db695fccfc6d698bd13b6937dffd9d005"; + hash = "sha256-udUi7sPNQJ5uCIAM8SqMGee6vRj1QbF9pLjdpNTQE5k="; + }) + ]; + + sourceRoot = "source"; outputs = [ "out" "dev" ]; cmakeFlags = [ - "-DCMAKE_INSTALL_NAME_DIR=\${CMAKE_INSTALL_PREFIX}/lib" - "-DBUILD_SHARED_LIBS=ON" + (lib.cmakeBool "BUILD_SHARED_LIBS" (!stdenv.hostPlatform.isStatic)) "-DBUILD_CODEC=ON" "-DBUILD_THIRDPARTY=OFF" - (mkFlag jpipLibSupport "BUILD_JPIP") - (mkFlag jpipServerSupport "BUILD_JPIP_SERVER") + (lib.cmakeBool "BUILD_JPIP" jpipLibSupport) + (lib.cmakeBool "BUILD_JPIP_SERVER" jpipServerSupport) "-DBUILD_VIEWER=OFF" "-DBUILD_JAVA=OFF" - (mkFlag doCheck "BUILD_TESTING") + "-DOPJ_DATA_ROOT=../../data" + (lib.cmakeBool "BUILD_TESTING" doCheck) ]; nativeBuildInputs = [ cmake pkg-config ]; @@ -52,12 +61,15 @@ stdenv.mkDerivation rec { ++ lib.optionals jpipServerSupport [ curl fcgi ] ++ lib.optional (jpipLibSupport) jdk; - doCheck = (!stdenv.hostPlatform.isAarch64 && !stdenv.hostPlatform.isPower64); # tests fail on aarch64-linux and powerpc64 - nativeCheckInputs = [ jpylyzer ]; + # tests fail on aarch64-linux and powerpc64 + doCheck = !stdenv.hostPlatform.isPower64 + && stdenv.buildPlatform.canExecute stdenv.hostPlatform; + checkPhase = '' - substituteInPlace ../tools/ctest_scripts/travis-ci.cmake \ - --replace "JPYLYZER_EXECUTABLE=" "JPYLYZER_EXECUTABLE=\"$(command -v jpylyzer)\" # " - OPJ_SOURCE_DIR=.. ctest -S ../tools/ctest_scripts/travis-ci.cmake + runHook preCheck + ctest -j $NIX_BUILD_CORES \ + -E '.*jpylyser' --exclude-from-file ${./exclude-tests} + runHook postCheck ''; passthru = { From 2de1b4b14e17f42ba8b4bf43a29347c91511e008 Mon Sep 17 00:00:00 2001 From: Reno Dakota Date: Sat, 9 Nov 2024 01:28:19 -0800 Subject: [PATCH 29/44] gcc{10,11,12,13,14}: reorder .cfi_startproc with label fixes llvm-18+ builds which require that an asm label precedes the .cfi_startproc pseudo instruction. --- .../cfi_startproc-reorder-label-09-1.diff | 16 +++++++++++++ .../cfi_startproc-reorder-label-14-1.diff | 16 +++++++++++++ .../cfi_startproc-reorder-label-2.diff | 16 +++++++++++++ .../compilers/gcc/patches/default.nix | 23 +++++++++++++------ 4 files changed, 64 insertions(+), 7 deletions(-) create mode 100644 pkgs/development/compilers/gcc/patches/cfi_startproc-reorder-label-09-1.diff create mode 100644 pkgs/development/compilers/gcc/patches/cfi_startproc-reorder-label-14-1.diff create mode 100644 pkgs/development/compilers/gcc/patches/cfi_startproc-reorder-label-2.diff diff --git a/pkgs/development/compilers/gcc/patches/cfi_startproc-reorder-label-09-1.diff b/pkgs/development/compilers/gcc/patches/cfi_startproc-reorder-label-09-1.diff new file mode 100644 index 000000000000..ee27f402956e --- /dev/null +++ b/pkgs/development/compilers/gcc/patches/cfi_startproc-reorder-label-09-1.diff @@ -0,0 +1,16 @@ +this patch fixes build for clang-18+ + +diff --git a/libgcc/config/aarch64/lse.S b/libgcc/config/aarch64/lse.S +index d3235bc33..1a56eb61c 100644 +--- a/libgcc/config/aarch64/lse.S ++++ b/libgcc/config/aarch64/lse.S +@@ -170,8 +170,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + .globl \name + .hidden \name + .type \name, %function +- .cfi_startproc + \name: ++ .cfi_startproc + BTI_C + .endm + diff --git a/pkgs/development/compilers/gcc/patches/cfi_startproc-reorder-label-14-1.diff b/pkgs/development/compilers/gcc/patches/cfi_startproc-reorder-label-14-1.diff new file mode 100644 index 000000000000..ea6dfe9c9b47 --- /dev/null +++ b/pkgs/development/compilers/gcc/patches/cfi_startproc-reorder-label-14-1.diff @@ -0,0 +1,16 @@ +this patch fixes build for clang-18+ + +diff --git a/libgcc/config/aarch64/lse.S b/libgcc/config/aarch64/lse.S +index ecef47086..b478dd4d9 100644 +--- a/libgcc/config/aarch64/lse.S ++++ b/libgcc/config/aarch64/lse.S +@@ -174,8 +174,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + .globl \name + HIDDEN(\name) + SYMBOL_TYPE(\name, %function) +- .cfi_startproc + \name: ++ .cfi_startproc + .endm + + .macro ENDFN name diff --git a/pkgs/development/compilers/gcc/patches/cfi_startproc-reorder-label-2.diff b/pkgs/development/compilers/gcc/patches/cfi_startproc-reorder-label-2.diff new file mode 100644 index 000000000000..83aecff1a0df --- /dev/null +++ b/pkgs/development/compilers/gcc/patches/cfi_startproc-reorder-label-2.diff @@ -0,0 +1,16 @@ +this patch fixes build for clang-18+ + +diff --git a/libgcc/config/aarch64/lse.S b/libgcc/config/aarch64/lse.S +index d3235bc33..1a56eb61c 100644 +--- a/libgcc/config/aarch64/lse.S ++++ b/libgcc/config/aarch64/lse.S +@@ -197,8 +197,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + .text + .balign 16 + .private_extern _\name +- .cfi_startproc + _\name: ++ .cfi_startproc + BTI_C + .endm + diff --git a/pkgs/development/compilers/gcc/patches/default.nix b/pkgs/development/compilers/gcc/patches/default.nix index 4e2518baff9e..0f2e8369eaad 100644 --- a/pkgs/development/compilers/gcc/patches/default.nix +++ b/pkgs/development/compilers/gcc/patches/default.nix @@ -40,6 +40,15 @@ let is9 = majorVersion == "9"; is8 = majorVersion == "8"; is7 = majorVersion == "7"; + + # We only apply these patches when building a native toolchain for + # aarch64-darwin, as it breaks building a foreign one: + # https://github.com/iains/gcc-12-branch/issues/18 + canApplyIainsDarwinPatches = stdenv.hostPlatform.isDarwin + && stdenv.hostPlatform.isAarch64 + && buildPlatform == hostPlatform + && hostPlatform == targetPlatform; + inherit (lib) optionals optional; in @@ -71,6 +80,8 @@ in ++ optional langFortran (if atLeast12 then ./gcc-12-gfortran-driving.patch else ./gfortran-driving.patch) ++ [ ./ppc-musl.patch ] ++ optional (atLeast9 && langD) ./libphobos.patch +++ optional (atLeast9 && !atLeast14) ./cfi_startproc-reorder-label-09-1.diff +++ optional (atLeast14 && !canApplyIainsDarwinPatches) ./cfi_startproc-reorder-label-14-1.diff @@ -135,9 +146,7 @@ in "12" = [ ./gnat-darwin-dylib-install-name.patch ]; }.${majorVersion} or []) -# We only apply this patch when building a native toolchain for aarch64-darwin, as it breaks building -# a foreign one: https://github.com/iains/gcc-12-branch/issues/18 -++ optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64 && buildPlatform == hostPlatform && hostPlatform == targetPlatform) ({ +++ optionals canApplyIainsDarwinPatches ({ "14" = [ (fetchpatch { name = "gcc-14-darwin-aarch64-support.patch"; @@ -159,24 +168,24 @@ in name = "gcc-13-darwin-aarch64-support.patch"; url = "https://raw.githubusercontent.com/Homebrew/formula-patches/bda0faddfbfb392e7b9c9101056b2c5ab2500508/gcc/gcc-13.3.0.diff"; sha256 = "sha256-RBTCBXIveGwuQGJLzMW/UexpUZdDgdXprp/G2NHkmQo="; - }) ]; + }) ./cfi_startproc-reorder-label-2.diff ]; "12" = [ (fetchurl { name = "gcc-12-darwin-aarch64-support.patch"; url = "https://raw.githubusercontent.com/Homebrew/formula-patches/1ed9eaea059f1677d27382c62f21462b476b37fe/gcc/gcc-12.4.0.diff"; sha256 = "sha256-wOjpT79lps4TKG5/E761odhLGCphBIkCbOPiQg/D1Fw="; - }) ]; + }) ./cfi_startproc-reorder-label-2.diff ]; "11" = [ (fetchpatch { # There are no upstream release tags in https://github.com/iains/gcc-11-branch. # 5cc4c42a0d4de08715c2eef8715ad5b2e92a23b6 is the commit from https://github.com/gcc-mirror/gcc/releases/tag/releases%2Fgcc-11.5.0 url = "https://github.com/iains/gcc-11-branch/compare/5cc4c42a0d4de08715c2eef8715ad5b2e92a23b6..gcc-11.5-darwin-r0.diff"; hash = "sha256-7lH+GkgkrE6nOp9PMdIoqlQNWK31s6oW+lDt1LIkadE="; - }) ]; + }) ./cfi_startproc-reorder-label-2.diff ]; "10" = [ (fetchpatch { # There are no upstream release tags in https://github.com/iains/gcc-10-branch. # d04fe55 is the commit from https://github.com/gcc-mirror/gcc/releases/tag/releases%2Fgcc-10.5.0 url = "https://github.com/iains/gcc-10-branch/compare/d04fe5541c53cb16d1ca5c80da044b4c7633dbc6...gcc-10-5Dr0-pre-0.diff"; hash = "sha256-kVUHZKtYqkWIcqxHG7yAOR2B60w4KWLoxzaiFD/FWYk="; - }) ]; + }) ./cfi_startproc-reorder-label-2.diff ]; }.${majorVersion} or []) # Work around newer AvailabilityInternal.h when building older versions of GCC. From 8e3554d3e3fbe6e286c77fbbc1a19b244a6d7c78 Mon Sep 17 00:00:00 2001 From: Emily Date: Tue, 12 Nov 2024 03:44:30 +0000 Subject: [PATCH 30/44] termbench-pro: bump to `fmt_11` --- pkgs/top-level/all-packages.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c4dbf3800cea..aa116a3908ae 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -11081,7 +11081,7 @@ with pkgs; harfbuzz = harfbuzzFull; }; - termbench-pro = callPackage ../development/libraries/termbench-pro { fmt = fmt_8; }; + termbench-pro = callPackage ../development/libraries/termbench-pro { fmt = fmt_11; }; texpresso = callPackage ../tools/typesetting/tex/texpresso { texpresso-tectonic = callPackage ../tools/typesetting/tex/texpresso/tectonic.nix { }; From 693a0eaedefbe9361b53427dfcc0a3652153f074 Mon Sep 17 00:00:00 2001 From: Emily Date: Tue, 12 Nov 2024 15:32:09 +0000 Subject: [PATCH 31/44] torrenttools: patch for `fmt_9` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It’d take more work to get this working with the latest version, and this project seems abandoned, so I didn’t bother for now. --- pkgs/tools/misc/torrenttools/default.nix | 4 ++++ pkgs/tools/misc/torrenttools/fmt-9.patch | 29 ++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 +- 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 pkgs/tools/misc/torrenttools/fmt-9.patch diff --git a/pkgs/tools/misc/torrenttools/default.nix b/pkgs/tools/misc/torrenttools/default.nix index 6daa39dd7e73..3a634ec17373 100644 --- a/pkgs/tools/misc/torrenttools/default.nix +++ b/pkgs/tools/misc/torrenttools/default.nix @@ -54,6 +54,10 @@ stdenv.mkDerivation rec { ]; sourceRoot = "torrenttools"; + patches = [ + ./fmt-9.patch + ]; + postUnpack = '' cp -pr cliprogress torrenttools/external/cliprogress cp -pr dottorrent torrenttools/external/dottorrent diff --git a/pkgs/tools/misc/torrenttools/fmt-9.patch b/pkgs/tools/misc/torrenttools/fmt-9.patch new file mode 100644 index 000000000000..5bdc666d4bd2 --- /dev/null +++ b/pkgs/tools/misc/torrenttools/fmt-9.patch @@ -0,0 +1,29 @@ +diff --git a/include/file_matcher.hpp b/include/file_matcher.hpp +index c10c7be405..b67baec0ef 100644 +--- a/include/file_matcher.hpp ++++ b/include/file_matcher.hpp +@@ -47,7 +47,7 @@ + } + + std::string error; +- std::string pattern = ".*.{}$"_format(extension); ++ std::string pattern = fmt::format(".*.{}$", extension); + file_include_list_.Add(pattern, &error); + file_include_list_empty_ = false; + Ensures(error.empty()); +@@ -62,7 +62,7 @@ + } + + std::string error; +- std::string pattern = ".*\\.{}$"_format(extension); ++ std::string pattern = fmt::format(".*\\.{}$", extension); + file_exclude_list_.Add(pattern, &error); + file_exclude_list_empty_ = false; + Ensures(error.empty()); +@@ -243,4 +243,4 @@ + }; + + +-} // namespace torrenttools +\ No newline at end of file ++} // namespace torrenttools diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index aa116a3908ae..2649ac69fdbe 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -16008,7 +16008,7 @@ with pkgs; }; torrenttools = callPackage ../tools/misc/torrenttools { - fmt = fmt_8; + fmt = fmt_9; }; tony = libsForQt5.callPackage ../applications/audio/tony { }; From 032868bd505b234ed2d19cd29c5ca49bf99a5dcc Mon Sep 17 00:00:00 2001 From: Emily Date: Tue, 12 Nov 2024 23:38:35 +0000 Subject: [PATCH 32/44] spdlog: `#define SPDLOG_FMT_EXTERNAL` This is required for the headers to work properly. --- pkgs/by-name/sp/spdlog/package.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/by-name/sp/spdlog/package.nix b/pkgs/by-name/sp/spdlog/package.nix index 6aa91db83549..0c9777b1ca88 100644 --- a/pkgs/by-name/sp/spdlog/package.nix +++ b/pkgs/by-name/sp/spdlog/package.nix @@ -41,6 +41,11 @@ stdenv.mkDerivation rec { postInstall = '' mkdir -p $out/share/doc/spdlog cp -rv ../example $out/share/doc/spdlog + + substituteInPlace $dev/include/spdlog/tweakme.h \ + --replace-fail \ + '// #define SPDLOG_FMT_EXTERNAL' \ + '#define SPDLOG_FMT_EXTERNAL' ''; doCheck = true; From e8db327d116e43c522a16c05a949cf3bdf00dcfb Mon Sep 17 00:00:00 2001 From: Emily Date: Tue, 12 Nov 2024 02:47:26 +0000 Subject: [PATCH 33/44] kompute: 0.8.1 -> 0.9.0 --- .../development/libraries/kompute/default.nix | 30 ++++++++----------- pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/pkgs/development/libraries/kompute/default.nix b/pkgs/development/libraries/kompute/default.nix index ced30a87dbfa..04b21d9ce026 100644 --- a/pkgs/development/libraries/kompute/default.nix +++ b/pkgs/development/libraries/kompute/default.nix @@ -6,41 +6,37 @@ , vulkan-headers , vulkan-loader , fmt +, spdlog , glslang , ninja }: stdenv.mkDerivation rec { pname = "kompute"; - version = "0.8.1"; + version = "0.9.0"; src = fetchFromGitHub { owner = "KomputeProject"; repo = "kompute"; rev = "v${version}"; - sha256 = "sha256-OkVGYh8QrD7JNqWFBLrDTYlk6IYHdvt4i7UtC4sQTzo="; + hash = "sha256-cf9Ef85R+VKao286+WHLgBWUqgwvuRocgeCzVJOGbdc="; }; - patches = [ - (fetchpatch { - url = "https://github.com/KomputeProject/kompute/commit/9a791b161dd58ca927fe090f65fa2b0e5e85e7ca.diff"; - sha256 = "OtFTN8sgPlyiMmVzUnqzCkVMKj6DWxbCXtYwkRdEprY="; - }) - (fetchpatch { - name = "enum-class-fix-for-fmt-8-x.patch"; - url = "https://github.com/KomputeProject/kompute/commit/f731f2e55c7aaaa804111106c3e469f9a642d4eb.patch"; - sha256 = "sha256-scTCYqkgKQnH27xzuY4FVbiwRuwBvChmLPPU7ZUrrL0="; - }) - ]; - cmakeFlags = [ + "-DKOMPUTE_OPT_USE_SPDLOG=ON" + # Doesn’t work without the vendored `spdlog`, and is redundant. + "-DKOMPUTE_OPT_LOG_LEVEL_DISABLED=ON" + "-DKOMPUTE_OPT_USE_BUILT_IN_SPDLOG=OFF" + "-DKOMPUTE_OPT_USE_BUILT_IN_FMT=OFF" + "-DKOMPUTE_OPT_USE_BUILT_IN_GOOGLE_TEST=OFF" + "-DKOMPUTE_OPT_USE_BUILT_IN_PYBIND11=OFF" + "-DKOMPUTE_OPT_USE_BUILT_IN_VULKAN_HEADER=OFF" + "-DKOMPUTE_OPT_DISABLE_VULKAN_VERSION_CHECK=ON" "-DKOMPUTE_OPT_INSTALL=1" - "-DRELEASE=1" - "-DKOMPUTE_ENABLE_SPDLOG=1" ]; nativeBuildInputs = [ cmake ninja ]; - buildInputs = [ fmt ]; + buildInputs = [ fmt spdlog ]; propagatedBuildInputs = [ glslang vulkan-headers vulkan-loader ]; meta = with lib; { diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 2649ac69fdbe..ea024cc7edca 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18393,7 +18393,7 @@ with pkgs; kmonad = haskellPackages.kmonad.bin; kompute = callPackage ../development/libraries/kompute { - fmt = fmt_8; + fmt = fmt_10; }; # In general we only want keep the last three minor versions around that From cdb8260d7c88cc032e8faba42f7d7f99fd8d7bed Mon Sep 17 00:00:00 2001 From: Emily Date: Tue, 12 Nov 2024 03:08:20 +0000 Subject: [PATCH 34/44] irods{,-icommands}: bump to `fmt_9` --- pkgs/top-level/all-packages.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ea024cc7edca..dd650846aab1 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3895,7 +3895,7 @@ with pkgs; stdenv = llvmPackages_13.libcxxStdenv; libcxx = llvmPackages_13.libcxx; boost = boost178.override { inherit stdenv; }; - fmt = fmt_8.override { inherit stdenv; }; + fmt = fmt_9.override { inherit stdenv; }; nanodbc_llvm = nanodbc.override { inherit stdenv; }; avro-cpp_llvm = avro-cpp.override { inherit stdenv boost; }; spdlog_llvm = spdlog.override { inherit stdenv fmt; }; From e951807e2f7311fad126c54e3e3aa12a8cdfeda2 Mon Sep 17 00:00:00 2001 From: Emily Date: Tue, 12 Nov 2024 03:31:01 +0000 Subject: [PATCH 35/44] fmt_8: drop --- pkgs/development/libraries/fmt/default.nix | 5 ----- pkgs/top-level/aliases.nix | 1 + pkgs/top-level/all-packages.nix | 2 +- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/pkgs/development/libraries/fmt/default.nix b/pkgs/development/libraries/fmt/default.nix index 01b2b6828611..3edf0692e439 100644 --- a/pkgs/development/libraries/fmt/default.nix +++ b/pkgs/development/libraries/fmt/default.nix @@ -69,11 +69,6 @@ let }; in { - fmt_8 = generic { - version = "8.1.1"; - hash = "sha256-leb2800CwdZMJRWF5b1Y9ocK0jXpOX/nwo95icDf308="; - }; - fmt_9 = generic { version = "9.1.0"; hash = "sha256-rP6ymyRc7LnKxUXwPpzhHOQvpJkpnRFOt2ctvUNlYI0="; diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 1446446b7d6c..dd2ad607389f 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -382,6 +382,7 @@ mapAliases { flutter316 = throw "flutter316 has been removed because it isn't updated anymore, and no packages in nixpkgs use it. If you still need it, use flutter.mkFlutter to get a custom version"; # Added 2024-10-05 flutter322 = throw "flutter322 has been removed because it isn't updated anymore, and no packages in nixpkgs use it. If you still need it, use flutter.mkFlutter to get a custom version"; # Added 2024-10-05 flutter323 = throw "flutter323 has been removed because it isn't updated anymore, and no packages in nixpkgs use it. If you still need it, use flutter.mkFlutter to get a custom version"; # Added 2024-10-05 + fmt_8 = throw "fmt_8 has been removed as it is obsolete and was no longer used in the tree"; # Added 2024-11-12 foldingathome = throw "'foldingathome' has been renamed to/replaced by 'fahclient'"; # Converted to throw 2024-10-17 forgejo-actions-runner = forgejo-runner; # Added 2024-04-04 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index dd650846aab1..10b1e3a191c5 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9188,7 +9188,7 @@ with pkgs; fltk = fltk13; fltk-minimal = fltk13-minimal; - inherit (callPackages ../development/libraries/fmt { }) fmt_8 fmt_9 fmt_10 fmt_11; + inherit (callPackages ../development/libraries/fmt { }) fmt_9 fmt_10 fmt_11; fmt = fmt_10; From 164136c9f8157de6c87022cfc3048378df65fe08 Mon Sep 17 00:00:00 2001 From: Emily Date: Tue, 12 Nov 2024 01:46:43 +0000 Subject: [PATCH 36/44] =?UTF-8?q?fmt=5F9:=20add=20patch=20for=20Clang=20?= =?UTF-8?q?=E2=89=A5=2018?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkgs/development/libraries/fmt/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/development/libraries/fmt/default.nix b/pkgs/development/libraries/fmt/default.nix index 01b2b6828611..9977465a50d9 100644 --- a/pkgs/development/libraries/fmt/default.nix +++ b/pkgs/development/libraries/fmt/default.nix @@ -77,6 +77,13 @@ in fmt_9 = generic { version = "9.1.0"; hash = "sha256-rP6ymyRc7LnKxUXwPpzhHOQvpJkpnRFOt2ctvUNlYI0="; + patches = [ + # Fixes the build with Clang ≥ 18. + (fetchpatch { + url = "https://github.com/fmtlib/fmt/commit/c4283ec471bd3efdb114bc1ab30c7c7c5e5e0ee0.patch"; + hash = "sha256-YyB5GY/ZqJQIhhGy0ICMPzfP/OUuyLnciiyv8Nscsec="; + }) + ]; }; fmt_10 = generic { From 8d819b5b0f017a724d2d62a03d0e7d63fe04dbc9 Mon Sep 17 00:00:00 2001 From: Randy Eckenrode Date: Sun, 12 May 2024 15:31:11 -0400 Subject: [PATCH 37/44] qt5.qtbase: use system freetype and libpng These work on Darwin, and using the system libpng avoids an issue trying to build the vendored version of libpng with clang 18. --- pkgs/development/libraries/qt-5/modules/qtbase.nix | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/pkgs/development/libraries/qt-5/modules/qtbase.nix b/pkgs/development/libraries/qt-5/modules/qtbase.nix index c61ce503f4f5..1ed4bfc8b2c2 100644 --- a/pkgs/development/libraries/qt-5/modules/qtbase.nix +++ b/pkgs/development/libraries/qt-5/modules/qtbase.nix @@ -57,7 +57,7 @@ stdenv.mkDerivation (finalAttrs: ({ libxml2 libxslt openssl sqlite zlib # Text rendering - harfbuzz icu + freetype harfbuzz icu # Image formats libjpeg libpng @@ -67,7 +67,7 @@ stdenv.mkDerivation (finalAttrs: ({ dbus glib udev # Text rendering - fontconfig freetype + fontconfig libdrm @@ -323,6 +323,7 @@ stdenv.mkDerivation (finalAttrs: ({ "-system-sqlite" ''-${if mysqlSupport then "plugin" else "no"}-sql-mysql'' ''-${if postgresql != null then "plugin" else "no"}-sql-psql'' + "-system-libpng" "-make libs" "-make tools" @@ -332,8 +333,6 @@ stdenv.mkDerivation (finalAttrs: ({ ++ ( if stdenv.hostPlatform.isDarwin then [ "-no-fontconfig" - "-qt-freetype" - "-qt-libpng" "-no-framework" "-no-rpath" ] else [ @@ -351,8 +350,6 @@ stdenv.mkDerivation (finalAttrs: ({ ''-${lib.optionalString (cups == null) "no-"}cups'' "-dbus-linked" "-glib" - ] ++ [ - "-system-libpng" ] ++ lib.optional withGtk3 "-gtk" ++ lib.optional withLibinput "-libinput" ++ [ From 0406f6c9a75fc1b14913111ad23be8879a7218c0 Mon Sep 17 00:00:00 2001 From: Reno Dakota Date: Fri, 15 Nov 2024 09:48:21 +0000 Subject: [PATCH 38/44] openjpeg: fix eval python3Packages.pylibjpeg-openjpeg tries to access openjpeg.src which was changed to srcs in 1f9a1d01ba8ad00af4bff49c302f2071d35b1ac9. Change it back. --- pkgs/by-name/op/openjpeg/package.nix | 40 +++++++++++++--------------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/pkgs/by-name/op/openjpeg/package.nix b/pkgs/by-name/op/openjpeg/package.nix index 618a251ce515..15296d33b85d 100644 --- a/pkgs/by-name/op/openjpeg/package.nix +++ b/pkgs/by-name/op/openjpeg/package.nix @@ -17,29 +17,26 @@ , vips }: +let + # may need to get updated with package + # https://github.com/uclouvain/openjpeg-data + test-data = fetchFromGitHub { + owner = "uclouvain"; + repo = "openjpeg-data"; + rev = "a428429db695fccfc6d698bd13b6937dffd9d005"; + hash = "sha256-udUi7sPNQJ5uCIAM8SqMGee6vRj1QbF9pLjdpNTQE5k="; + }; +in stdenv.mkDerivation rec { pname = "openjpeg"; version = "2.5.2"; - srcs = [ - (fetchFromGitHub { - owner = "uclouvain"; - repo = "openjpeg"; - rev = "v${version}"; - hash = "sha256-mQ9B3MJY2/bg0yY/7jUJrAXM6ozAHT5fmwES5Q1SGxw="; - }) - # data for tests. may need to get updated with package - # https://github.com/uclouvain/openjpeg-data - (fetchFromGitHub { - name = "data"; - owner = "uclouvain"; - repo = "openjpeg-data"; - rev = "a428429db695fccfc6d698bd13b6937dffd9d005"; - hash = "sha256-udUi7sPNQJ5uCIAM8SqMGee6vRj1QbF9pLjdpNTQE5k="; - }) - ]; - - sourceRoot = "source"; + src = fetchFromGitHub { + owner = "uclouvain"; + repo = "openjpeg"; + rev = "v${version}"; + hash = "sha256-mQ9B3MJY2/bg0yY/7jUJrAXM6ozAHT5fmwES5Q1SGxw="; + }; outputs = [ "out" "dev" ]; @@ -51,9 +48,8 @@ stdenv.mkDerivation rec { (lib.cmakeBool "BUILD_JPIP_SERVER" jpipServerSupport) "-DBUILD_VIEWER=OFF" "-DBUILD_JAVA=OFF" - "-DOPJ_DATA_ROOT=../../data" (lib.cmakeBool "BUILD_TESTING" doCheck) - ]; + ] ++ lib.optional doCheck "-DOPJ_DATA_ROOT=${test-data}"; nativeBuildInputs = [ cmake pkg-config ]; @@ -61,7 +57,7 @@ stdenv.mkDerivation rec { ++ lib.optionals jpipServerSupport [ curl fcgi ] ++ lib.optional (jpipLibSupport) jdk; - # tests fail on aarch64-linux and powerpc64 + # tests did fail on powerpc64 doCheck = !stdenv.hostPlatform.isPower64 && stdenv.buildPlatform.canExecute stdenv.hostPlatform; From 94d28175ff761adc44d6f680b0070d36ba89b628 Mon Sep 17 00:00:00 2001 From: Randy Eckenrode Date: Fri, 24 May 2024 01:41:01 -0400 Subject: [PATCH 39/44] nodejs_{18,20}: fix build with clang 18 on Darwin --- pkgs/development/web/nodejs/v18.nix | 7 +++++++ pkgs/development/web/nodejs/v20.nix | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/pkgs/development/web/nodejs/v18.nix b/pkgs/development/web/nodejs/v18.nix index 6099d100675a..1ab63eac7951 100644 --- a/pkgs/development/web/nodejs/v18.nix +++ b/pkgs/development/web/nodejs/v18.nix @@ -47,5 +47,12 @@ buildNodejs { url = "https://github.com/nodejs/node/commit/d0a6b605fba6cd69a82e6f12ff0363eef8fe1ee9.patch"; hash = "sha256-TfYal/PikRZHL6zpAlC3SmkYXCe+/8Gs83dLX/X/P/k="; }) + # Remove unused `fdopen` in vendored zlib, which causes compilation failures with clang 18 on Darwin. + (fetchpatch2 { + url = "https://github.com/madler/zlib/commit/4bd9a71f3539b5ce47f0c67ab5e01f3196dc8ef9.patch?full_index=1"; + extraPrefix = "deps/v8/third_party/zlib/"; + stripLen = 1; + hash = "sha256-WVxsoEcJu0WBTyelNrVQFTZxJhnekQb1GrueeRBRdnY="; + }) ] ++ gypPatches; } diff --git a/pkgs/development/web/nodejs/v20.nix b/pkgs/development/web/nodejs/v20.nix index 4b0be19dad77..9f0e1cc38b88 100644 --- a/pkgs/development/web/nodejs/v20.nix +++ b/pkgs/development/web/nodejs/v20.nix @@ -48,5 +48,12 @@ buildNodejs { url = "https://github.com/nodejs/node/commit/0f7bdcc17fbc7098b89f238f4bd8ecad9367887b.patch?full_index=1"; hash = "sha256-lXx6QyD2anlY9qAwjNMFM2VcHckBshghUF1NaMoaNl4="; }) + # Remove unused `fdopen` in vendored zlib, which causes compilation failures with clang 18 on Darwin. + (fetchpatch2 { + url = "https://github.com/madler/zlib/commit/4bd9a71f3539b5ce47f0c67ab5e01f3196dc8ef9.patch?full_index=1"; + extraPrefix = "deps/v8/third_party/zlib/"; + stripLen = 1; + hash = "sha256-WVxsoEcJu0WBTyelNrVQFTZxJhnekQb1GrueeRBRdnY="; + }) ] ++ gypPatches; } From 1d23e258fba5a89d164815e1829015fb4839c52f Mon Sep 17 00:00:00 2001 From: Randy Eckenrode Date: Thu, 23 May 2024 20:33:37 -0400 Subject: [PATCH 40/44] qt5.qtlocation: fix build with clang 18 --- pkgs/development/libraries/qt-5/modules/qtlocation.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/development/libraries/qt-5/modules/qtlocation.nix b/pkgs/development/libraries/qt-5/modules/qtlocation.nix index 35627af0c685..617a735baaa3 100644 --- a/pkgs/development/libraries/qt-5/modules/qtlocation.nix +++ b/pkgs/development/libraries/qt-5/modules/qtlocation.nix @@ -4,6 +4,11 @@ qtModule { pname = "qtlocation"; propagatedBuildInputs = [ qtbase qtmultimedia ]; outputs = [ "bin" "out" "dev" ]; + # Clang 18 treats a non-const, narrowing conversion in an initializer list as an error, + # which results in a failure building a 3rd party dependency of qtlocation. Just suppress it. + env = lib.optionalAttrs (stdenv.cc.isClang && (lib.versionAtLeast (lib.getVersion stdenv.cc) "18")) { + NIX_CFLAGS_COMPILE = "-Wno-c++11-narrowing-const-reference"; + }; qmakeFlags = lib.optionals stdenv.hostPlatform.isDarwin [ # boost uses std::auto_ptr which has been disabled in clang with libcxx # This flag re-enables this feature From 5cb1de1b5da8c47ca67ee3f0bebff4276f22e39a Mon Sep 17 00:00:00 2001 From: Emily Date: Sat, 16 Nov 2024 16:16:24 +0000 Subject: [PATCH 41/44] nodejs_{18,20}: apply V8 patches for LLVM 19 --- pkgs/development/web/nodejs/v18.nix | 15 +++++++++++++++ pkgs/development/web/nodejs/v20.nix | 15 +++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/pkgs/development/web/nodejs/v18.nix b/pkgs/development/web/nodejs/v18.nix index 1ab63eac7951..b9a50c718cb2 100644 --- a/pkgs/development/web/nodejs/v18.nix +++ b/pkgs/development/web/nodejs/v18.nix @@ -54,5 +54,20 @@ buildNodejs { stripLen = 1; hash = "sha256-WVxsoEcJu0WBTyelNrVQFTZxJhnekQb1GrueeRBRdnY="; }) + # Backport V8 fixes for LLVM 19. + (fetchpatch2 { + url = "https://chromium.googlesource.com/v8/v8/+/182d9c05e78b1ddb1cb8242cd3628a7855a0336f%5E%21/?format=TEXT"; + decode = "base64 -d"; + extraPrefix = "deps/v8/"; + stripLen = 1; + hash = "sha256-bDTwFbATPn5W4VifWz/SqaiigXYDWHq785C64VezuUE="; + }) + (fetchpatch2 { + url = "https://chromium.googlesource.com/v8/v8/+/1a3ecc2483b2dba6ab9f7e9f8f4b60dbfef504b7%5E%21/?format=TEXT"; + decode = "base64 -d"; + extraPrefix = "deps/v8/"; + stripLen = 1; + hash = "sha256-6y3aEqxNC4iTQEv1oewodJrhOHxjp5xZMq1P1QL94Rg="; + }) ] ++ gypPatches; } diff --git a/pkgs/development/web/nodejs/v20.nix b/pkgs/development/web/nodejs/v20.nix index 9f0e1cc38b88..b147771e6660 100644 --- a/pkgs/development/web/nodejs/v20.nix +++ b/pkgs/development/web/nodejs/v20.nix @@ -55,5 +55,20 @@ buildNodejs { stripLen = 1; hash = "sha256-WVxsoEcJu0WBTyelNrVQFTZxJhnekQb1GrueeRBRdnY="; }) + # Backport V8 fixes for LLVM 19. + (fetchpatch2 { + url = "https://chromium.googlesource.com/v8/v8/+/182d9c05e78b1ddb1cb8242cd3628a7855a0336f%5E%21/?format=TEXT"; + decode = "base64 -d"; + extraPrefix = "deps/v8/"; + stripLen = 1; + hash = "sha256-bDTwFbATPn5W4VifWz/SqaiigXYDWHq785C64VezuUE="; + }) + (fetchpatch2 { + url = "https://chromium.googlesource.com/v8/v8/+/1a3ecc2483b2dba6ab9f7e9f8f4b60dbfef504b7%5E%21/?format=TEXT"; + decode = "base64 -d"; + extraPrefix = "deps/v8/"; + stripLen = 1; + hash = "sha256-6y3aEqxNC4iTQEv1oewodJrhOHxjp5xZMq1P1QL94Rg="; + }) ] ++ gypPatches; } From f9a5549db27b332d5fffc7a475695f6c40d50848 Mon Sep 17 00:00:00 2001 From: Reno Dakota Date: Sat, 16 Nov 2024 11:48:51 -0800 Subject: [PATCH 42/44] llvmPackages{12-git}.clang: don't swallow unsupported option errors when compiling + linking `https://github.com/llvm/llvm-project/issues/116278` make clang report unsupported option errors / warning when compiling + linking in the same command. this works ``` $ clang --target=aarch64 -mpopcnt hello.c clang: error: unsupported option '-mpopcnt' for target aarch64 ``` before change clang swallows the error ``` $ clang --target=aarch64 -mpopcnt hello.c -lc $ echo $? 0 ``` after change error is reported: ``` $ clang --target=aarch64 -mpopcnt hello.c -lc clang: error: unsupported option '-mpopcnt' for target aarch64 ``` --- .../clang/clang-unsupported-option.patch | 75 +++++++++++++++++++ .../compilers/llvm/common/default.nix | 6 ++ 2 files changed, 81 insertions(+) create mode 100644 pkgs/development/compilers/llvm/common/clang/clang-unsupported-option.patch diff --git a/pkgs/development/compilers/llvm/common/clang/clang-unsupported-option.patch b/pkgs/development/compilers/llvm/common/clang/clang-unsupported-option.patch new file mode 100644 index 000000000000..b265e7922c0d --- /dev/null +++ b/pkgs/development/compilers/llvm/common/clang/clang-unsupported-option.patch @@ -0,0 +1,75 @@ +From 7ef5ed98cc6666f64db2f155ded2077ce038e1e4 Mon Sep 17 00:00:00 2001 +From: Reno Dakota +Date: Sat, 16 Nov 2024 05:57:40 +0000 +Subject: [PATCH] [Clang][Driver] report unsupported option error regardless of + argument order + +This change updates clang to report unsupported option errors regardless +of the command line argument order. + +When clang with a source file and without `-c` it will both compile and +link. When an unsupported option is also part of the command line clang +should generated an error. However, if the source file name comes before +an object file, eg: `-lc`, the error is ignored. + +``` +$ clang --target=x86_64 -lc hello.c -mhtm +clang: error: unsupported option '-mhtm' for target 'x86_64' +$ echo $? +1 +``` + +but if `-lc` comes after `hello.c` the error is dropped + +``` +$ clang --target=x86_64 hello.c -mhtm -lc +$ echo $? +0 +``` + +after this change clang will report the error regardless of the command +line argument order. +--- + clang/lib/Driver/Driver.cpp | 13 ++++++------- + clang/test/Driver/unsupported-option.c | 10 ++++++++++ + 2 files changed, 16 insertions(+), 7 deletions(-) + +diff --git a/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp +index 93e85f7dffe35a..8e784a7b130ac3 100644 +--- a/lib/Driver/Driver.cpp ++++ b/lib/Driver/Driver.cpp +@@ -4064,17 +4064,18 @@ void Driver::handleArguments(Compilation &C, DerivedArgList &Args, + YcArg = YuArg = nullptr; + } + +- unsigned LastPLSize = 0; ++ bool LinkOnly = phases::Link == FinalPhase && Inputs.size() > 0; + for (auto &I : Inputs) { + types::ID InputType = I.first; + const Arg *InputArg = I.second; + + auto PL = types::getCompilationPhases(InputType); +- LastPLSize = PL.size(); ++ ++ phases::ID InitialPhase = PL[0]; ++ LinkOnly = LinkOnly && phases::Link == InitialPhase && PL.size() == 1; + + // If the first step comes after the final phase we are doing as part of + // this compilation, warn the user about it. +- phases::ID InitialPhase = PL[0]; + if (InitialPhase > FinalPhase) { + if (InputArg->isClaimed()) + continue; +@@ -4129,10 +4130,8 @@ void Driver::handleArguments(Compilation &C, DerivedArgList &Args, + } + } + +- // If we are linking, claim any options which are obviously only used for +- // compilation. +- // FIXME: Understand why the last Phase List length is used here. +- if (FinalPhase == phases::Link && LastPLSize == 1) { ++ // claim any options which are obviously only used for compilation. ++ if (LinkOnly) { + Args.ClaimAllArgs(options::OPT_CompileOnly_Group); + Args.ClaimAllArgs(options::OPT_cl_compile_Group); + } diff --git a/pkgs/development/compilers/llvm/common/default.nix b/pkgs/development/compilers/llvm/common/default.nix index fae0f963e905..b0d05c454a79 100644 --- a/pkgs/development/compilers/llvm/common/default.nix +++ b/pkgs/development/compilers/llvm/common/default.nix @@ -521,6 +521,12 @@ let (metadata.getVersionFile "clang/purity.patch") # https://reviews.llvm.org/D51899 (metadata.getVersionFile "clang/gnu-install-dirs.patch") + + # https://github.com/llvm/llvm-project/pull/116476 + # prevent clang ignoring warnings / errors for unsuppored + # options when building & linking a source file with trailing + # libraries. eg: `clang -munsupported hello.c -lc` + ./clang/clang-unsupported-option.patch ] ++ lib.optional (lib.versions.major metadata.release_version == "13") # Revert of https://reviews.llvm.org/D100879 From 42ef3589e685ba2ba10a67928341e5a40e225038 Mon Sep 17 00:00:00 2001 From: Emily Date: Sat, 16 Nov 2024 16:36:42 +0000 Subject: [PATCH 43/44] Revert "nodejs_18: fix build with clang 16 mk2" libc++ 19 no longer supports Clang < 17. This reverts commit b034e4cbf12f7c0d749674c102e31e6a47fa2d7f. --- pkgs/development/web/nodejs/v18.nix | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/pkgs/development/web/nodejs/v18.nix b/pkgs/development/web/nodejs/v18.nix index b9a50c718cb2..e8783fc314cd 100644 --- a/pkgs/development/web/nodejs/v18.nix +++ b/pkgs/development/web/nodejs/v18.nix @@ -1,19 +1,8 @@ -{ callPackage, lib, overrideCC, pkgs, buildPackages, openssl, python311, fetchpatch2, enableNpm ? true }: +{ callPackage, lib, openssl, python311, fetchpatch2, enableNpm ? true }: let - # Clang 16+ cannot build Node v18 due to -Wenum-constexpr-conversion errors. - # Use an older version of clang with the current libc++ for compatibility (e.g., with icu). - ensureCompatibleCC = packages: - if packages.stdenv.cc.isClang && lib.versionAtLeast (lib.getVersion packages.stdenv.cc.cc) "16" - then overrideCC packages.llvmPackages_15.stdenv (packages.llvmPackages_15.stdenv.cc.override { - inherit (packages.llvmPackages) libcxx; - }) - else packages.stdenv; - buildNodejs = callPackage ./nodejs.nix { inherit openssl; - stdenv = ensureCompatibleCC pkgs; - buildPackages = buildPackages // { stdenv = ensureCompatibleCC buildPackages; }; python = python311; }; From ab5898375927bd0b63403d35b41c76fb5c49f210 Mon Sep 17 00:00:00 2001 From: Reno Dakota Date: Tue, 19 Nov 2024 21:14:40 -0800 Subject: [PATCH 44/44] xcbuild: const can't desctruct. fix build build failed on clang-19 fixes 82a00b78e4e5b17f163cb9d4587ddd0b12504820 --- .../xc/xcbuild/patches/Use-system-toolchain-for-usr-bin.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/xc/xcbuild/patches/Use-system-toolchain-for-usr-bin.patch b/pkgs/by-name/xc/xcbuild/patches/Use-system-toolchain-for-usr-bin.patch index f1b5a38fbcf0..d617b4206c1b 100644 --- a/pkgs/by-name/xc/xcbuild/patches/Use-system-toolchain-for-usr-bin.patch +++ b/pkgs/by-name/xc/xcbuild/patches/Use-system-toolchain-for-usr-bin.patch @@ -12,7 +12,7 @@ diff -Naur a/Libraries/xcsdk/Tools/xcrun.cpp b/Libraries/xcsdk/Tools/xcrun.cpp using libutil::FSUtil; +namespace { -+ const std::vector kSystemDeveloperDirs = { ++ const std::vector kSystemDeveloperDirs = { + "/private/var/select/developer_dir", + "/private/var/db/xcode_select_link" + };