diff options
Diffstat (limited to 'pkgs')
64 files changed, 764 insertions, 417 deletions
diff --git a/pkgs/applications/networking/sync/rsync/default.nix b/pkgs/applications/networking/sync/rsync/default.nix index 9df26b6bb84..1baf1c40eb1 100644 --- a/pkgs/applications/networking/sync/rsync/default.nix +++ b/pkgs/applications/networking/sync/rsync/default.nix @@ -30,6 +30,12 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ perl ]; + patches = [ + # https://github.com/WayneD/rsync/issues/511#issuecomment-1774612577 + # original source: https://build.opensuse.org/package/view_file/network/rsync/rsync-fortified-strlcpy-fix.patch?expand=1&rev=3f8dd2f4a404c96c0f69176e60893714 + ./rsync-fortified-strlcpy-fix.patch + ]; + buildInputs = [ libiconv zlib popt ] ++ lib.optional enableACLs acl ++ lib.optional enableZstd zstd diff --git a/pkgs/applications/networking/sync/rsync/rsync-fortified-strlcpy-fix.patch b/pkgs/applications/networking/sync/rsync/rsync-fortified-strlcpy-fix.patch new file mode 100644 index 00000000000..296445b4bb5 --- /dev/null +++ b/pkgs/applications/networking/sync/rsync/rsync-fortified-strlcpy-fix.patch @@ -0,0 +1,49 @@ +From 1f83963f59960150e8c46112daa8411324c1f209 Mon Sep 17 00:00:00 2001 +From: Jiri Slaby <jslaby@suse.cz> +Date: Fri, 18 Aug 2023 08:26:20 +0200 +Subject: [PATCH] exclude: fix crashes with fortified strlcpy() + +Fortified (-D_FORTIFY_SOURCE=2 for gcc) builds make strlcpy() crash when +its third parameter (size) is larger than the buffer: + $ rsync -FFXHav '--filter=merge global-rsync-filter' Align-37-43/ xxx + sending incremental file list + *** buffer overflow detected ***: terminated + +It's in the exclude code in setup_merge_file(): + strlcpy(y, save, MAXPATHLEN); + +Note the 'y' pointer was incremented, so it no longer points to memory +with MAXPATHLEN "owned" bytes. + +Fix it by remembering the number of copied bytes into the 'save' buffer +and use that instead of MAXPATHLEN which is clearly incorrect. + +Fixes #511. +--- + exclude.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/exclude.c b/exclude.c +index ffe55b167..1a5de3b9e 100644 +--- a/exclude.c ++++ b/exclude.c +@@ -720,7 +720,8 @@ static BOOL setup_merge_file(int mergelist_num, filter_rule *ex, + parent_dirscan = True; + while (*y) { + char save[MAXPATHLEN]; +- strlcpy(save, y, MAXPATHLEN); ++ /* copylen is strlen(y) which is < MAXPATHLEN. +1 for \0 */ ++ size_t copylen = strlcpy(save, y, MAXPATHLEN) + 1; + *y = '\0'; + dirbuf_len = y - dirbuf; + strlcpy(x, ex->pattern, MAXPATHLEN - (x - buf)); +@@ -734,7 +735,7 @@ static BOOL setup_merge_file(int mergelist_num, filter_rule *ex, + lp->head = NULL; + } + lp->tail = NULL; +- strlcpy(y, save, MAXPATHLEN); ++ strlcpy(y, save, copylen); + while ((*x++ = *y++) != '/') {} + } + parent_dirscan = False; + diff --git a/pkgs/build-support/setup-hooks/fix-darwin-dylib-names.sh b/pkgs/build-support/setup-hooks/fix-darwin-dylib-names.sh index 55e196e654d..e103fe77d9b 100644 --- a/pkgs/build-support/setup-hooks/fix-darwin-dylib-names.sh +++ b/pkgs/build-support/setup-hooks/fix-darwin-dylib-names.sh @@ -36,5 +36,5 @@ fixDarwinDylibNames() { fixDarwinDylibNamesIn() { local dir="$1" - fixDarwinDylibNames $(find "$dir" -name "*.dylib") + fixDarwinDylibNames $(find "$dir" -name "*.dylib" -o -name "*.so" -o -name "*.so.*") } diff --git a/pkgs/development/tools/build-managers/cmake/001-search-path.diff b/pkgs/by-name/cm/cmake/001-search-path.diff index 04ab0847a70..04ab0847a70 100644 --- a/pkgs/development/tools/build-managers/cmake/001-search-path.diff +++ b/pkgs/by-name/cm/cmake/001-search-path.diff diff --git a/pkgs/development/tools/build-managers/cmake/002-application-services.diff b/pkgs/by-name/cm/cmake/002-application-services.diff index 56f7cd266b7..56f7cd266b7 100644 --- a/pkgs/development/tools/build-managers/cmake/002-application-services.diff +++ b/pkgs/by-name/cm/cmake/002-application-services.diff diff --git a/pkgs/development/tools/build-managers/cmake/003-libuv-application-services.diff b/pkgs/by-name/cm/cmake/003-libuv-application-services.diff index 6607a9c6ed1..6607a9c6ed1 100644 --- a/pkgs/development/tools/build-managers/cmake/003-libuv-application-services.diff +++ b/pkgs/by-name/cm/cmake/003-libuv-application-services.diff diff --git a/pkgs/development/tools/build-managers/cmake/004-cygwin.diff b/pkgs/by-name/cm/cmake/004-cygwin.diff index 982aba17e87..982aba17e87 100644 --- a/pkgs/development/tools/build-managers/cmake/004-cygwin.diff +++ b/pkgs/by-name/cm/cmake/004-cygwin.diff diff --git a/pkgs/development/tools/build-managers/cmake/005-remove-systemconfiguration-dep.diff b/pkgs/by-name/cm/cmake/005-remove-systemconfiguration-dep.diff index 76aa91cff92..ffd3077d301 100644 --- a/pkgs/development/tools/build-managers/cmake/005-remove-systemconfiguration-dep.diff +++ b/pkgs/by-name/cm/cmake/005-remove-systemconfiguration-dep.diff @@ -1,6 +1,7 @@ ---- a/Utilities/cmcurl/CMakeLists.txt -+++ b/Utilities/cmcurl/CMakeLists.txt -@@ -391,13 +391,6 @@ if(ENABLE_IPV6 AND NOT WIN32) +diff -Naur cmake-3.27.7/Utilities/cmcurl/CMakeLists.txt cmake-3.27.7-new/Utilities/cmcurl/CMakeLists.txt +--- cmake-3.27.7/Utilities/cmcurl/CMakeLists.txt 2023-10-06 10:08:35.000000000 -0300 ++++ cmake-3.27.7-new/Utilities/cmcurl/CMakeLists.txt 2023-10-22 21:51:09.231609901 -0300 +@@ -414,13 +414,6 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND NOT ENABLE_ARES) set(use_core_foundation ON) @@ -14,9 +15,10 @@ endif() endif() ---- a/Utilities/cmcurl/lib/curl_setup.h -+++ b/Utilities/cmcurl/lib/curl_setup.h -@@ -257,11 +257,7 @@ +diff -Naur cmake-3.27.7/Utilities/cmcurl/lib/curl_setup.h cmake-3.27.7-new/Utilities/cmcurl/lib/curl_setup.h +--- cmake-3.27.7/Utilities/cmcurl/lib/curl_setup.h 2023-10-06 10:08:35.000000000 -0300 ++++ cmake-3.27.7-new/Utilities/cmcurl/lib/curl_setup.h 2023-10-22 21:52:00.214748294 -0300 +@@ -260,11 +260,7 @@ * performing this task will result in a synthesized IPv6 address. */ #if defined(__APPLE__) && !defined(USE_ARES) @@ -28,9 +30,10 @@ #endif #ifdef USE_LWIPSOCK ---- a/Utilities/cmcurl/lib/hostip.c -+++ b/Utilities/cmcurl/lib/hostip.c -@@ -68,10 +68,6 @@ +diff -Naur cmake-3.27.7/Utilities/cmcurl/lib/hostip.c cmake-3.27.7-new/Utilities/cmcurl/lib/hostip.c +--- cmake-3.27.7/Utilities/cmcurl/lib/hostip.c 2023-10-06 10:08:35.000000000 -0300 ++++ cmake-3.27.7-new/Utilities/cmcurl/lib/hostip.c 2023-10-22 21:53:29.249989934 -0300 +@@ -67,10 +67,6 @@ #include "curl_memory.h" #include "memdebug.h" @@ -38,10 +41,10 @@ -#include <SystemConfiguration/SCDynamicStoreCopySpecific.h> -#endif - - #if defined(CURLRES_SYNCH) && \ - defined(HAVE_ALARM) && defined(SIGALRM) && defined(HAVE_SIGSETJMP) - /* alarm-based timeouts can only be used with all the dependencies satisfied */ -@@ -661,23 +657,6 @@ enum resolve_t Curl_resolv(struct Curl_easy *data, + #if defined(CURLRES_SYNCH) && \ + defined(HAVE_ALARM) && \ + defined(SIGALRM) && \ +@@ -743,23 +739,6 @@ return CURLRESOLV_ERROR; } diff --git a/pkgs/development/tools/build-managers/cmake/006-darwin-always-set-runtime-c-flag.diff b/pkgs/by-name/cm/cmake/006-darwin-always-set-runtime-c-flag.diff index dc10e6b3423..dc10e6b3423 100644 --- a/pkgs/development/tools/build-managers/cmake/006-darwin-always-set-runtime-c-flag.diff +++ b/pkgs/by-name/cm/cmake/006-darwin-always-set-runtime-c-flag.diff diff --git a/pkgs/development/tools/build-managers/cmake/check-pc-files-hook.sh b/pkgs/by-name/cm/cmake/check-pc-files-hook.sh index 94d1b7b5355..94d1b7b5355 100644 --- a/pkgs/development/tools/build-managers/cmake/check-pc-files-hook.sh +++ b/pkgs/by-name/cm/cmake/check-pc-files-hook.sh diff --git a/pkgs/development/tools/build-managers/cmake/default.nix b/pkgs/by-name/cm/cmake/package.nix index 00715130a00..a5731479150 100644 --- a/pkgs/development/tools/build-managers/cmake/default.nix +++ b/pkgs/by-name/cm/cmake/package.nix @@ -16,11 +16,17 @@ , texinfo , xz , zlib -, isBootstrap ? false -, useOpenSSL ? !isBootstrap -, useSharedLibraries ? (!isBootstrap && !stdenv.isCygwin) +, isBootstrap ? null +, isMinimalBuild ? ( + if isBootstrap != null + then lib.warn + "isBootstrap argument is deprecated and will be removed; use isMinimalBuild instead" + isBootstrap + else false) +, useOpenSSL ? !isMinimalBuild +, useSharedLibraries ? (!isMinimalBuild && !stdenv.isCygwin) , uiToolkits ? [] # can contain "ncurses" and/or "qt5" -, buildDocs ? !(isBootstrap || (uiToolkits == [])) +, buildDocs ? !(isMinimalBuild || (uiToolkits == [])) , darwin , libsForQt5 }: @@ -34,17 +40,17 @@ in # Accepts only "ncurses" and "qt5" as possible uiToolkits assert lib.subtractLists [ "ncurses" "qt5" ] uiToolkits == []; # Minimal, bootstrap cmake does not have toolkits -assert isBootstrap -> (uiToolkits == []); +assert isMinimalBuild -> (uiToolkits == []); stdenv.mkDerivation (finalAttrs: { pname = "cmake" - + lib.optionalString isBootstrap "-boot" + + lib.optionalString isMinimalBuild "-minimal" + lib.optionalString cursesUI "-cursesUI" + lib.optionalString qt5UI "-qt5UI"; - version = "3.26.4"; + version = "3.27.7"; src = fetchurl { url = "https://cmake.org/files/v${lib.versions.majorMinor finalAttrs.version}/cmake-${finalAttrs.version}.tar.gz"; - hash = "sha256-MTtogMKRvU/jHAqlHW5iZZKCpSHmlfMNXMDSWrvVwgg="; + hash = "sha256-CPcaEGA2vwUfaSdg75VYwFd8Qqw56Wugl+dmK9QVjY4="; }; patches = [ @@ -57,7 +63,7 @@ stdenv.mkDerivation (finalAttrs: { ] ++ lib.optional stdenv.isCygwin ./004-cygwin.diff # Derived from https://github.com/curl/curl/commit/31f631a142d855f069242f3e0c643beec25d1b51 - ++ lib.optional (stdenv.isDarwin && isBootstrap) ./005-remove-systemconfiguration-dep.diff + ++ lib.optional (stdenv.isDarwin && isMinimalBuild) ./005-remove-systemconfiguration-dep.diff # On Darwin, always set CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG. ++ lib.optional stdenv.isDarwin ./006-darwin-always-set-runtime-c-flag.diff; @@ -90,7 +96,7 @@ stdenv.mkDerivation (finalAttrs: { ++ lib.optional useOpenSSL openssl ++ lib.optional cursesUI ncurses ++ lib.optional qt5UI qtbase - ++ lib.optional (stdenv.isDarwin && !isBootstrap) SystemConfiguration; + ++ lib.optional (stdenv.isDarwin && !isMinimalBuild) SystemConfiguration; propagatedBuildInputs = lib.optional stdenv.isDarwin ps; @@ -104,12 +110,23 @@ stdenv.mkDerivation (finalAttrs: { configureFlags="--parallel=''${NIX_BUILD_CORES:-1} CC=$CC_FOR_BUILD CXX=$CXX_FOR_BUILD $configureFlags" ''; + # The configuration script is not autoconf-based, although being similar; + # triples and other interesting info are passed via CMAKE_* environment + # variables and commandline switches + configurePlatforms = [ ]; + configureFlags = [ "CXXFLAGS=-Wno-elaborated-enum-base" "--docdir=share/doc/${finalAttrs.pname}-${finalAttrs.version}" ] ++ (if useSharedLibraries - then [ "--no-system-jsoncpp" "--system-libs" ] - else [ "--no-system-libs" ]) # FIXME: cleanup + then [ + "--no-system-cppdap" + "--no-system-jsoncpp" + "--system-libs" + ] + else [ + "--no-system-libs" + ]) # FIXME: cleanup ++ lib.optional qt5UI "--qt-gui" ++ lib.optionals buildDocs [ "--sphinx-build=${sphinx}/bin/sphinx-build" @@ -129,15 +146,17 @@ stdenv.mkDerivation (finalAttrs: { # Unfortunately cmake seems to expect absolute paths for ar, ranlib, and # strip. Otherwise they are taken to be relative to the source root of the # package being built. - "-DCMAKE_CXX_COMPILER=${stdenv.cc.targetPrefix}c++" - "-DCMAKE_C_COMPILER=${stdenv.cc.targetPrefix}cc" - "-DCMAKE_AR=${lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}ar" - "-DCMAKE_RANLIB=${lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}ranlib" - "-DCMAKE_STRIP=${lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}strip" - - "-DCMAKE_USE_OPENSSL=${if useOpenSSL then "ON" else "OFF"}" - # Avoid depending on frameworks. - "-DBUILD_CursesDialog=${if cursesUI then "ON" else "OFF"}" + (lib.cmakeFeature "CMAKE_CXX_COMPILER" "${stdenv.cc.targetPrefix}c++") + (lib.cmakeFeature "CMAKE_C_COMPILER" "${stdenv.cc.targetPrefix}cc") + (lib.cmakeFeature "CMAKE_AR" + "${lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}ar") + (lib.cmakeFeature "CMAKE_RANLIB" + "${lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}ranlib") + (lib.cmakeFeature "CMAKE_STRIP" + "${lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}strip") + + (lib.cmakeBool "CMAKE_USE_OPENSSL" useOpenSSL) + (lib.cmakeBool "BUILD_CursesDialog" cursesUI) ]; # make install attempts to use the just-built cmake @@ -148,10 +167,6 @@ stdenv.mkDerivation (finalAttrs: { dontUseCmakeConfigure = true; enableParallelBuilding = true; - # This isn't an autoconf configure script; triples are passed via - # CMAKE_SYSTEM_NAME, etc. - configurePlatforms = [ ]; - doCheck = false; # fails meta = { diff --git a/pkgs/development/tools/build-managers/cmake/setup-hook.sh b/pkgs/by-name/cm/cmake/setup-hook.sh index b28ed42b689..b28ed42b689 100755 --- a/pkgs/development/tools/build-managers/cmake/setup-hook.sh +++ b/pkgs/by-name/cm/cmake/setup-hook.sh diff --git a/pkgs/development/tools/build-managers/meson/fix-rpath.patch b/pkgs/by-name/me/meson/001-fix-rpath.patch index 29bec7903ca..29bec7903ca 100644 --- a/pkgs/development/tools/build-managers/meson/fix-rpath.patch +++ b/pkgs/by-name/me/meson/001-fix-rpath.patch diff --git a/pkgs/development/tools/build-managers/meson/clear-old-rpath.patch b/pkgs/by-name/me/meson/002-clear-old-rpath.patch index f1e3c76e8b5..f1e3c76e8b5 100644 --- a/pkgs/development/tools/build-managers/meson/clear-old-rpath.patch +++ b/pkgs/by-name/me/meson/002-clear-old-rpath.patch diff --git a/pkgs/development/tools/build-managers/meson/more-env-vars.patch b/pkgs/by-name/me/meson/003-more-env-vars.patch index e4ad4355042..e4ad4355042 100644 --- a/pkgs/development/tools/build-managers/meson/more-env-vars.patch +++ b/pkgs/by-name/me/meson/003-more-env-vars.patch diff --git a/pkgs/development/tools/build-managers/meson/gir-fallback-path.patch b/pkgs/by-name/me/meson/004-gir-fallback-path.patch index e6d74026527..e6d74026527 100644 --- a/pkgs/development/tools/build-managers/meson/gir-fallback-path.patch +++ b/pkgs/by-name/me/meson/004-gir-fallback-path.patch diff --git a/pkgs/development/tools/build-managers/meson/boost-Do-not-add-system-paths-on-nix.patch b/pkgs/by-name/me/meson/005-boost-Do-not-add-system-paths-on-nix.patch index 0a2eda9de9a..0a2eda9de9a 100644 --- a/pkgs/development/tools/build-managers/meson/boost-Do-not-add-system-paths-on-nix.patch +++ b/pkgs/by-name/me/meson/005-boost-Do-not-add-system-paths-on-nix.patch diff --git a/pkgs/development/tools/build-managers/meson/disable-bitcode.patch b/pkgs/by-name/me/meson/006-disable-bitcode.patch index a72997c1043..a72997c1043 100644 --- a/pkgs/development/tools/build-managers/meson/disable-bitcode.patch +++ b/pkgs/by-name/me/meson/006-disable-bitcode.patch diff --git a/pkgs/development/tools/build-managers/meson/emulator-hook.sh b/pkgs/by-name/me/meson/emulator-hook.sh index 4f08087cf5f..4f08087cf5f 100644 --- a/pkgs/development/tools/build-managers/meson/emulator-hook.sh +++ b/pkgs/by-name/me/meson/emulator-hook.sh diff --git a/pkgs/development/tools/build-managers/meson/default.nix b/pkgs/by-name/me/meson/package.nix index 6674fbe7819..6239927848a 100644 --- a/pkgs/development/tools/build-managers/meson/default.nix +++ b/pkgs/by-name/me/meson/package.nix @@ -3,19 +3,19 @@ , fetchFromGitHub , fetchpatch , installShellFiles +, coreutils +, darwin +, libxcrypt , ninja , pkg-config , python3 -, zlib -, coreutils , substituteAll -, Foundation -, OpenGL -, AppKit -, Cocoa -, libxcrypt +, zlib }: +let + inherit (darwin.apple_sdk.frameworks) AppKit Cocoa Foundation OpenGL; +in python3.pkgs.buildPythonApplication rec { pname = "meson"; version = "1.2.3"; @@ -28,25 +28,13 @@ python3.pkgs.buildPythonApplication rec { }; patches = [ - # Meson is currently inspecting fewer variables than autoconf does, which - # makes it harder for us to use setup hooks, etc. Taken from - # https://github.com/mesonbuild/meson/pull/6827 - ./more-env-vars.patch - - # Unlike libtool, vanilla Meson does not pass any information - # about the path library will be installed to to g-ir-scanner, - # breaking the GIR when path other than ${!outputLib}/lib is used. - # We patch Meson to add a --fallback-library-path argument with - # library install_dir to g-ir-scanner. - ./gir-fallback-path.patch - - # In common distributions, RPATH is only needed for internal libraries so + # In typical distributions, RPATH is only needed for internal libraries so # meson removes everything else. With Nix, the locations of libraries # are not as predictable, therefore we need to keep them in the RPATH. # At the moment we are keeping the paths starting with /nix/store. # https://github.com/NixOS/nixpkgs/issues/31222#issuecomment-365811634 (substituteAll { - src = ./fix-rpath.patch; + src = ./001-fix-rpath.patch; inherit (builtins) storeDir; }) @@ -56,50 +44,89 @@ python3.pkgs.buildPythonApplication rec { # But this can cause much bigger problem for Nix as it can produce # cut-in-half-by-\0 store path references. # Let’s just clear the whole rpath and hope for the best. - ./clear-old-rpath.patch + ./002-clear-old-rpath.patch + + # Meson is currently inspecting fewer variables than autoconf does, which + # makes it harder for us to use setup hooks, etc. + # https://github.com/mesonbuild/meson/pull/6827 + ./003-more-env-vars.patch + + # Unlike libtool, vanilla Meson does not pass any information about the path + # library will be installed to to g-ir-scanner, breaking the GIR when path + # other than ${!outputLib}/lib is used. + # We patch Meson to add a --fallback-library-path argument with library + # install_dir to g-ir-scanner. + ./004-gir-fallback-path.patch # Patch out default boost search paths to avoid impure builds on # unsandboxed non-NixOS builds, see: # https://github.com/NixOS/nixpkgs/issues/86131#issuecomment-711051774 - ./boost-Do-not-add-system-paths-on-nix.patch + ./005-boost-Do-not-add-system-paths-on-nix.patch # Nixpkgs cctools does not have bitcode support. - ./disable-bitcode.patch + ./006-disable-bitcode.patch # Fix passing multiple --define-variable arguments to pkg-config. # https://github.com/mesonbuild/meson/pull/10670 (fetchpatch { url = "https://github.com/mesonbuild/meson/commit/d5252c5d4cf1c1931fef0c1c98dd66c000891d21.patch"; - sha256 = "GiUNVul1N5Fl8mfqM7vA/r1FdKqImiDYLXMVDt77gvw="; + hash = "sha256-GiUNVul1N5Fl8mfqM7vA/r1FdKqImiDYLXMVDt77gvw="; excludes = [ "docs/yaml/objects/dep.yaml" ]; }) ]; - setupHook = ./setup-hook.sh; + buildInputs = lib.optionals (python3.pythonOlder "3.9") [ + libxcrypt + ]; - nativeCheckInputs = [ ninja pkg-config ]; - checkInputs = [ zlib ] - ++ lib.optionals stdenv.isDarwin [ Foundation OpenGL AppKit Cocoa ]; - checkPhase = '' - runHook preCheck + nativeBuildInputs = [ installShellFiles ]; - patchShebangs 'test cases' - substituteInPlace 'test cases/native/8 external program shebang parsing/script.int.in' \ - --replace /usr/bin/env ${coreutils}/bin/env + nativeCheckInputs = [ + ninja + pkg-config + ]; + + checkInputs = [ + zlib + ] + ++ lib.optionals stdenv.isDarwin [ + AppKit + Cocoa + Foundation + OpenGL + ]; + + checkPhase = lib.concatStringsSep "\n" ([ + "runHook preCheck" + '' + patchShebangs 'test cases' + substituteInPlace \ + 'test cases/native/8 external program shebang parsing/script.int.in' \ + --replace /usr/bin/env ${coreutils}/bin/env + '' + ] + # Remove problematic tests + ++ (builtins.map (f: ''rm -vr "${f}";'') [ # requires git, creating cyclic dependency - rm -r 'test cases/common/66 vcstag' + ''test cases/common/66 vcstag'' # requires glib, creating cyclic dependency - rm -r 'test cases/linuxlike/6 subdir include order' - rm -r 'test cases/linuxlike/9 compiler checks with dependencies' + ''test cases/linuxlike/6 subdir include order'' + ''test cases/linuxlike/9 compiler checks with dependencies'' # requires static zlib, see #66461 - rm -r 'test cases/linuxlike/14 static dynamic linkage' + ''test cases/linuxlike/14 static dynamic linkage'' # Nixpkgs cctools does not have bitcode support. - rm -r 'test cases/osx/7 bitcode' - HOME="$TMPDIR" python ./run_project_tests.py + ''test cases/osx/7 bitcode'' + ]) + ++ [ + ''HOME="$TMPDIR" python ./run_project_tests.py'' + "runHook postCheck" + ]); - runHook postCheck + postInstall = '' + installShellCompletion --zsh data/shell-completions/zsh/_meson + installShellCompletion --bash data/shell-completions/bash/meson ''; postFixup = '' @@ -117,18 +144,9 @@ python3.pkgs.buildPythonApplication rec { --replace "python3 -c " "${python3.interpreter} -c " ''; - buildInputs = lib.optionals (python3.pythonOlder "3.9") [ - libxcrypt - ]; - - nativeBuildInputs = [ installShellFiles ]; - - postInstall = '' - installShellCompletion --zsh data/shell-completions/zsh/_meson - installShellCompletion --bash data/shell-completions/bash/meson - ''; + setupHook = ./setup-hook.sh; - meta = with lib; { + meta = { homepage = "https://mesonbuild.com"; description = "An open source, fast and friendly build system made in Python"; longDescription = '' @@ -140,8 +158,8 @@ python3.pkgs.buildPythonApplication rec { second spent waiting for the build system to actually start compiling code. ''; - license = licenses.asl20; - maintainers = with maintainers; [ mbe AndersonTorres ]; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ AndersonTorres ]; inherit (python3.meta) platforms; }; } diff --git a/pkgs/by-name/me/meson/setup-hook.sh b/pkgs/by-name/me/meson/setup-hook.sh new file mode 100644 index 00000000000..85849fbec73 --- /dev/null +++ b/pkgs/by-name/me/meson/setup-hook.sh @@ -0,0 +1,87 @@ +# shellcheck shell=bash disable=SC2206 + +mesonConfigurePhase() { + runHook preConfigure + + local flagsArray=() + + if [ -z "${dontAddPrefix-}" ]; then + flagsArray+=("--prefix=$prefix") + fi + + # See multiple-outputs.sh and meson’s coredata.py + flagsArray+=( + "--libdir=${!outputLib}/lib" + "--libexecdir=${!outputLib}/libexec" + "--bindir=${!outputBin}/bin" + "--sbindir=${!outputBin}/sbin" + "--includedir=${!outputInclude}/include" + "--mandir=${!outputMan}/share/man" + "--infodir=${!outputInfo}/share/info" + "--localedir=${!outputLib}/share/locale" + "-Dauto_features=${mesonAutoFeatures:-enabled}" + "-Dwrap_mode=${mesonWrapMode:-nodownload}" + ${crossMesonFlags} + "--buildtype=${mesonBuildType:-plain}" + ) + + flagsArray+=( + $mesonFlags + "${mesonFlagsArray[@]}" + ) + + echoCmd 'mesonConfigurePhase flags' "${flagsArray[@]}" + + meson setup build "${flagsArray[@]}" + cd build || { echoCmd 'mesonConfigurePhase' "could not cd to build"; exit 1; } + + if ! [[ -v enableParallelBuilding ]]; then + enableParallelBuilding=1 + echoCmd 'mesonConfigurePhase' "enabled parallel building" + fi + + if [[ ${checkPhase-ninjaCheckPhase} = ninjaCheckPhase && -z $dontUseMesonCheck ]]; then + checkPhase=mesonCheckPhase + fi + if [[ ${installPhase-ninjaInstallPhase} = ninjaInstallPhase && -z $dontUseMesonInstall ]]; then + installPhase=mesonInstallPhase + fi + + runHook postConfigure +} + +mesonCheckPhase() { + runHook preCheck + + local flagsArray=($mesonCheckFlags "${mesonCheckFlagsArray[@]}") + + echoCmd 'mesonCheckPhase flags' "${flagsArray[@]}" + meson test --no-rebuild "${flagsArray[@]}" + + runHook postCheck +} + +mesonInstallPhase() { + runHook preInstall + + local flagsArray=() + + if [[ -n "$mesonInstallTags" ]]; then + flagsArray+=("--tags" "${mesonInstallTags// /,}") + fi + flagsArray+=( + $mesonInstallFlags + "${mesonInstallFlagsArray[@]}" + ) + + echoCmd 'mesonInstallPhase flags' "${flagsArray[@]}" + meson install --no-rebuild "${flagsArray[@]}" + + runHook postInstall +} + +if [ -z "${dontUseMesonConfigure-}" ] && [ -z "${configurePhase-}" ]; then + # shellcheck disable=SC2034 + setOutputFlags= + configurePhase=mesonConfigurePhase +fi diff --git a/pkgs/development/compilers/gcc/default.nix b/pkgs/development/compilers/gcc/default.nix index 0980944dfc2..19bdff834cb 100644 --- a/pkgs/development/compilers/gcc/default.nix +++ b/pkgs/development/compilers/gcc/default.nix @@ -107,8 +107,8 @@ let inherit version; /* Cross-gcc settings (build == host != target) */ crossMingw = targetPlatform != hostPlatform && targetPlatform.isMinGW; - stageNameAddon = if withoutTargetLibc then "stage-static" else "stage-final"; - crossNameAddon = optionalString (targetPlatform != hostPlatform) "${targetPlatform.config}-${stageNameAddon}-"; + stageNameAddon = optionalString withoutTargetLibc "-nolibc"; + crossNameAddon = optionalString (targetPlatform != hostPlatform) "${targetPlatform.config}${stageNameAddon}-"; javaAwtGtk = langJava && x11Support; xlibs = [ diff --git a/pkgs/development/interpreters/python/catch_conflicts/catch_conflicts.py b/pkgs/development/interpreters/python/catch_conflicts/catch_conflicts.py index bb82900c65a..d5c99e64751 100644 --- a/pkgs/development/interpreters/python/catch_conflicts/catch_conflicts.py +++ b/pkgs/development/interpreters/python/catch_conflicts/catch_conflicts.py @@ -1,30 +1,34 @@ -import pkg_resources +from importlib.metadata import PathDistribution +from pathlib import Path import collections import sys + do_abort = False packages = collections.defaultdict(list) -for f in sys.path: - for req in pkg_resources.find_distributions(f): - if req not in packages[req.project_name]: - # some exceptions inside buildPythonPackage - if req.project_name in ['setuptools', 'pip', 'wheel']: - continue - packages[req.project_name].append(req) + +for path in sys.path: + for dist_info in Path(path).glob("*.dist-info"): + dist = PathDistribution(dist_info) + + packages[dist._normalized_name].append( + f"{dist._normalized_name} {dist.version} ({dist._path})" + ) for name, duplicates in packages.items(): if len(duplicates) > 1: do_abort = True print("Found duplicated packages in closure for dependency '{}': ".format(name)) - for dup in duplicates: - print(" " + repr(dup)) + for duplicate in duplicates: + print(f"\t{duplicate}") if do_abort: print("") print( - 'Package duplicates found in closure, see above. Usually this ' - 'happens if two packages depend on different version ' - 'of the same dependency.') + "Package duplicates found in closure, see above. Usually this " + "happens if two packages depend on different version " + "of the same dependency." + ) sys.exit(1) diff --git a/pkgs/development/interpreters/python/hooks/default.nix b/pkgs/development/interpreters/python/hooks/default.nix index 6a05a7fa6ee..16324b30b3f 100644 --- a/pkgs/development/interpreters/python/hooks/default.nix +++ b/pkgs/development/interpreters/python/hooks/default.nix @@ -107,7 +107,7 @@ in { makePythonHook { name = "python-catch-conflicts-hook"; substitutions = { - inherit pythonInterpreter pythonSitePackages setuptools; + inherit pythonInterpreter pythonSitePackages; catchConflicts=../catch_conflicts/catch_conflicts.py; }; } ./python-catch-conflicts-hook.sh) {}; diff --git a/pkgs/development/libraries/glibc/0001-aarch64-math-vector.h-add-NVCC-include-guard.patch b/pkgs/development/libraries/glibc/0001-aarch64-math-vector.h-add-NVCC-include-guard.patch new file mode 100644 index 00000000000..234bc1943c9 --- /dev/null +++ b/pkgs/development/libraries/glibc/0001-aarch64-math-vector.h-add-NVCC-include-guard.patch @@ -0,0 +1,37 @@ +From 44d0a3a9bd8c6fe59f6ccb44206a50a900bfcf4a Mon Sep 17 00:00:00 2001 +From: Connor Baker <connor.baker@tweag.io> +Date: Tue, 31 Oct 2023 14:30:24 +0000 +Subject: [PATCH] aarch64/math-vector.h: add NVCC include guard + +--- + sysdeps/aarch64/fpu/bits/math-vector.h | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/sysdeps/aarch64/fpu/bits/math-vector.h b/sysdeps/aarch64/fpu/bits/math-vector.h +index 7c200599c1..583a426494 100644 +--- a/sysdeps/aarch64/fpu/bits/math-vector.h ++++ b/sysdeps/aarch64/fpu/bits/math-vector.h +@@ -25,17 +25,17 @@ + /* Get default empty definitions for simd declarations. */ + #include <bits/libm-simd-decl-stubs.h> + +-#if __GNUC_PREREQ(9, 0) ++#if __GNUC_PREREQ(9, 0) && !defined(__CUDACC__) + # define __ADVSIMD_VEC_MATH_SUPPORTED + typedef __Float32x4_t __f32x4_t; + typedef __Float64x2_t __f64x2_t; +-#elif __glibc_clang_prereq(8, 0) ++#elif __glibc_clang_prereq(8, 0) && !defined(__CUDACC__) + # define __ADVSIMD_VEC_MATH_SUPPORTED + typedef __attribute__ ((__neon_vector_type__ (4))) float __f32x4_t; + typedef __attribute__ ((__neon_vector_type__ (2))) double __f64x2_t; + #endif + +-#if __GNUC_PREREQ(10, 0) || __glibc_clang_prereq(11, 0) ++#if (__GNUC_PREREQ(10, 0) || __glibc_clang_prereq(11, 0)) && !defined(__CUDACC__) + # define __SVE_VEC_MATH_SUPPORTED + typedef __SVFloat32_t __sv_f32_t; + typedef __SVFloat64_t __sv_f64_t; +-- +2.42.0 + diff --git a/pkgs/development/libraries/glibc/common.nix b/pkgs/development/libraries/glibc/common.nix index 646242de611..3e17817c0ba 100644 --- a/pkgs/development/libraries/glibc/common.nix +++ b/pkgs/development/libraries/glibc/common.nix @@ -97,6 +97,18 @@ stdenv.mkDerivation ({ */ ./reenable_DT_HASH.patch ] + /* NVCC does not support ARM intrinsics. Since <math.h> is pulled in by almost + every HPC piece of software, without this patch CUDA compilation on ARM + is effectively broken. See + https://forums.developer.nvidia.com/t/nvcc-fails-to-build-with-arm-neon-instructions-cpp-vs-cu/248355/2. + */ + ++ ( + let + isAarch64 = stdenv.buildPlatform.isAarch64 || stdenv.hostPlatform.isAarch64; + isLinux = stdenv.buildPlatform.isLinux || stdenv.hostPlatform.isLinux; + in + lib.optional (isAarch64 && isLinux) ./0001-aarch64-math-vector.h-add-NVCC-include-guard.patch + ) ++ lib.optional stdenv.hostPlatform.isMusl ./fix-rpc-types-musl-conflicts.patch ++ lib.optional stdenv.buildPlatform.isDarwin ./darwin-cross-build.patch; @@ -276,7 +288,7 @@ stdenv.mkDerivation ({ license = licenses.lgpl2Plus; - maintainers = with maintainers; [ eelco ma27 ]; + maintainers = with maintainers; [ eelco ma27 connorbaker ]; platforms = platforms.linux; } // (args.meta or {}); }) diff --git a/pkgs/development/libraries/gpgme/default.nix b/pkgs/development/libraries/gpgme/default.nix index b223f249f83..0a473c95bed 100644 --- a/pkgs/development/libraries/gpgme/default.nix +++ b/pkgs/development/libraries/gpgme/default.nix @@ -26,11 +26,11 @@ let in stdenv.mkDerivation rec { pname = "gpgme"; - version = "1.22.0"; + version = "1.23.0"; src = fetchurl { url = "mirror://gnupg/gpgme/${pname}-${version}.tar.bz2"; - hash = "sha256-lVHjcIGtO96BAYoNJPJFw/ggaZBUlZj7Mal6aDgKe3E="; + hash = "sha256-BD4u/hi0rSK5bUNN3nY/vtMs+NbCINxp3w0P+53Gb8Y="; }; patches = [ diff --git a/pkgs/development/libraries/grpc/default.nix b/pkgs/development/libraries/grpc/default.nix index 84c3abd575c..daf3bad132d 100644 --- a/pkgs/development/libraries/grpc/default.nix +++ b/pkgs/development/libraries/grpc/default.nix @@ -21,7 +21,7 @@ stdenv.mkDerivation rec { pname = "grpc"; - version = "1.57.0"; # N.B: if you change this, please update: + version = "1.59.1"; # N.B: if you change this, please update: # pythonPackages.grpcio-tools # pythonPackages.grpcio-status @@ -29,7 +29,7 @@ stdenv.mkDerivation rec { owner = "grpc"; repo = "grpc"; rev = "v${version}"; - hash = "sha256-ZPhPi4ODAAohCySVKeypaDID4ZUXvnfidOGK5EMXvh4="; + hash = "sha256-4bou7oFQOgyxjFqJdmiFT8xEMCsOap9v34W6SPrT4WQ="; fetchSubmodules = true; }; @@ -37,14 +37,8 @@ stdenv.mkDerivation rec { (fetchpatch { # armv6l support, https://github.com/grpc/grpc/pull/21341 name = "grpc-link-libatomic.patch"; - url = "https://github.com/lopsided98/grpc/commit/164f55260262c816e19cd2c41b564486097d62fe.patch"; - hash = "sha256-d6kMyjL5ZnEnEz4XZfRgXJBH53gp1r7q1tlwh+HM6+Y="; - }) - # Fix generated CMake config file - # FIXME: remove when merged - (fetchpatch { - url = "https://github.com/grpc/grpc/pull/33361/commits/117dc80eb43021dd5619023ef6d02d0d6ec7ae7a.patch"; - hash = "sha256-VBk3ZD5h9uOQVN0st+quUQK/wXqvfFNk8G8AN4f2MQo="; + url = "https://github.com/lopsided98/grpc/commit/a9b917666234f5665c347123d699055d8c2537b2.patch"; + hash = "sha256-Lm0GQsz/UjBbXXEE14lT0dcRzVmCKycrlrdBJj+KLu8="; }) ]; @@ -95,13 +89,12 @@ stdenv.mkDerivation rec { export LD_LIBRARY_PATH=$(pwd)''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH ''; - env.NIX_CFLAGS_COMPILE = lib.concatStringsSep " " ( - lib.optionals stdenv.cc.isClang [ - "-Wno-error=unknown-warning-option" - ] ++ lib.optionals stdenv.isAarch64 [ - "-Wno-error=format-security" - ] - ); + env.NIX_CFLAGS_COMPILE = toString ([ + "-Wno-error" + ] ++ lib.optionals stdenv.isDarwin [ + # Workaround for https://github.com/llvm/llvm-project/issues/48757 + "-Wno-elaborated-enum-base" + ]); enableParallelBuilds = true; diff --git a/pkgs/development/libraries/libaom/default.nix b/pkgs/development/libraries/libaom/default.nix index 6be0370a177..c5e40babfd6 100644 --- a/pkgs/development/libraries/libaom/default.nix +++ b/pkgs/development/libraries/libaom/default.nix @@ -1,6 +1,7 @@ { lib, stdenv, fetchzip, yasm, perl, cmake, pkg-config, python3 , enableButteraugli ? true, libjxl , enableVmaf ? true, libvmaf +, gitUpdater }: let @@ -8,11 +9,11 @@ let in stdenv.mkDerivation rec { pname = "libaom"; - version = "3.6.1"; + version = "3.7.0"; src = fetchzip { url = "https://aomedia.googlesource.com/aom/+archive/v${version}.tar.gz"; - sha256 = "sha256-U7hmKdpjTtqStM4UIjCvgJ2swpZ1x0Px1Q9+gSHbaeQ="; + hash = "sha256-Zf0g/CMI73O9Dkn9o7aIvwZ/8wh3lCmVY8nZaPwBp68="; stripRoot = false; }; @@ -64,6 +65,14 @@ stdenv.mkDerivation rec { outputs = [ "out" "bin" "dev" "static" ]; + passthru = { + updateScript = gitUpdater { + url = "https://aomedia.googlesource.com/aom"; + rev-prefix = "v"; + ignoredVersions = "(alpha|beta|rc).*"; + }; + }; + meta = with lib; { description = "Alliance for Open Media AV1 codec library"; longDescription = '' diff --git a/pkgs/development/libraries/libnsl/default.nix b/pkgs/development/libraries/libnsl/default.nix index 4f9d7d09caa..59e16071ce7 100644 --- a/pkgs/development/libraries/libnsl/default.nix +++ b/pkgs/development/libraries/libnsl/default.nix @@ -2,13 +2,13 @@ stdenv.mkDerivation rec { pname = "libnsl"; - version = "2.0.0"; + version = "2.0.1"; src = fetchFromGitHub { owner = "thkukuk"; repo = pname; rev = "v${version}"; - sha256 = "sha256-f9kNzzR8baf5mLgrh+bKO/rBRZA5ZYc1tJdyLE7Bi1w="; + sha256 = "sha256-bCToqXVE4RZcoZ2eTNZcVHyzKlWyIpSAssQCOZcfmEA="; }; nativeBuildInputs = [ autoreconfHook pkg-config ]; diff --git a/pkgs/development/libraries/oniguruma/default.nix b/pkgs/development/libraries/oniguruma/default.nix index 3062c3cb4e1..a1a9dc87573 100644 --- a/pkgs/development/libraries/oniguruma/default.nix +++ b/pkgs/development/libraries/oniguruma/default.nix @@ -2,12 +2,12 @@ stdenv.mkDerivation rec { pname = "oniguruma"; - version = "6.9.8"; + version = "6.9.9"; # Note: do not use fetchpatch or fetchFromGitHub to keep this package available in __bootPackages src = fetchurl { url = "https://github.com/kkos/oniguruma/releases/download/v${version}/onig-${version}.tar.gz"; - sha256 = "sha256-KM1iwUZGI8eRBWX7HMqqAQSy/osSvNZG6B9ztHU1IT4="; + sha256 = "sha256-YBYr07n8b0iG1MegeSX/03QWdzL1Xc6MSRv9nNgYps8="; }; outputs = [ "dev" "lib" "out" ]; diff --git a/pkgs/development/libraries/pipewire/default.nix b/pkgs/development/libraries/pipewire/default.nix index 05741652f46..3876a5c892a 100644 --- a/pkgs/development/libraries/pipewire/default.nix +++ b/pkgs/development/libraries/pipewire/default.nix @@ -81,7 +81,7 @@ let self = stdenv.mkDerivation rec { pname = "pipewire"; - version = "0.3.83"; + version = "0.3.84"; outputs = [ "out" @@ -97,7 +97,7 @@ let owner = "pipewire"; repo = "pipewire"; rev = version; - sha256 = "sha256-12g8/zLTCQkBtgwE6zt3yEDwcHCr2LQXJCjB1nqbmB0="; + sha256 = "sha256-9W9y+wtS/CYUaPRrCRmRDeyvuS1XllMBNQLy6GAMqBM="; }; patches = [ diff --git a/pkgs/development/libraries/re2/default.nix b/pkgs/development/libraries/re2/default.nix index c5f74854f77..a1a22fb38e4 100644 --- a/pkgs/development/libraries/re2/default.nix +++ b/pkgs/development/libraries/re2/default.nix @@ -13,13 +13,13 @@ stdenv.mkDerivation rec { pname = "re2"; - version = "2023-09-01"; + version = "2023-11-01"; src = fetchFromGitHub { owner = "google"; repo = "re2"; rev = version; - hash = "sha256-dCEkwjIs8ITVUZ4N0+qeGoShGNqKkdvJ88teyGKN6pg="; + hash = "sha256-cKXe8r5MUag/z+seem4Zg/gmqIQjaCY7DBxiKlrnXPs="; }; outputs = [ "out" "dev" ]; diff --git a/pkgs/development/libraries/s2n-tls/default.nix b/pkgs/development/libraries/s2n-tls/default.nix index 9c826aa4dde..73092a803d6 100644 --- a/pkgs/development/libraries/s2n-tls/default.nix +++ b/pkgs/development/libraries/s2n-tls/default.nix @@ -8,13 +8,13 @@ stdenv.mkDerivation rec { pname = "s2n-tls"; - version = "1.3.55"; + version = "1.3.56"; src = fetchFromGitHub { owner = "aws"; repo = pname; rev = "v${version}"; - hash = "sha256-d/h6vBqef4pE/6cb1bQboIXAAMRxdAALKHUVW07jOlE="; + hash = "sha256-VS/85qu0Dc3HSeD0DYm2f4ur+ZRPhb1Srf7BeK7Pdfk="; }; nativeBuildInputs = [ cmake ]; diff --git a/pkgs/development/python-modules/deal/default.nix b/pkgs/development/python-modules/deal/default.nix index 0333bb37ce3..13704b20939 100644 --- a/pkgs/development/python-modules/deal/default.nix +++ b/pkgs/development/python-modules/deal/default.nix @@ -77,13 +77,17 @@ buildPythonPackage rec { "test_scheme_contract_is_satisfied_when_setting_arg" "test_scheme_contract_is_satisfied_within_chain" "test_scheme_errors_rewrite_message" - # broken since pytest > 7.1.3 - "test_exception_hook" + # assert errors + "test_doctest" + "test_no_violations" ]; disabledTestPaths = [ # needs internet access "tests/test_runtime/test_offline.py" + # depends on typeguard <4.0.0 for tests, but >=4.0.0 seems fine for runtime + # https://github.com/life4/deal/blob/9be70fa1c5a0635880619b2cea83a9f6631eb236/pyproject.toml#L40 + "tests/test_testing.py" ]; pythonImportsCheck = [ "deal" ]; diff --git a/pkgs/development/python-modules/grpcio-health-checking/default.nix b/pkgs/development/python-modules/grpcio-health-checking/default.nix index ce1a78f02cf..4c028e4ec71 100644 --- a/pkgs/development/python-modules/grpcio-health-checking/default.nix +++ b/pkgs/development/python-modules/grpcio-health-checking/default.nix @@ -8,12 +8,12 @@ buildPythonPackage rec { pname = "grpcio-health-checking"; - version = "1.58.0"; + version = "1.59.0"; format = "setuptools"; src = fetchPypi { inherit pname version; - hash = "sha256-B9WGI/J77PGGyGLLrn39elS9Y/SzdZTHfIuPyTPxHC8="; + hash = "sha256-4CIcpupsITlhQXmAi4+LMjA30LG977D8TN2agUmZVx4="; }; propagatedBuildInputs = [ diff --git a/pkgs/development/python-modules/grpcio-status/default.nix b/pkgs/development/python-modules/grpcio-status/default.nix index c03c1faa9d4..e7d6fd55095 100644 --- a/pkgs/development/python-modules/grpcio-status/default.nix +++ b/pkgs/development/python-modules/grpcio-status/default.nix @@ -9,14 +9,14 @@ buildPythonPackage rec { pname = "grpcio-status"; - version = "1.58.0"; + version = "1.59.0"; format = "setuptools"; disabled = pythonOlder "3.6"; src = fetchPypi { inherit pname version; - hash = "sha256-C0LnDAQFpmqC2emGf6JV/lnmGJZKYJmyBWjDHdkJl2Y="; + hash = "sha256-+TucM+CiYWLvhDG/z/zD4fshfM2Ne1swYbbp+BPmmLU="; }; postPatch = '' diff --git a/pkgs/development/python-modules/grpcio-testing/default.nix b/pkgs/development/python-modules/grpcio-testing/default.nix index 904c0b24a0a..bb3024d4407 100644 --- a/pkgs/development/python-modules/grpcio-testing/default.nix +++ b/pkgs/development/python-modules/grpcio-testing/default.nix @@ -9,14 +9,14 @@ buildPythonPackage rec { pname = "grpcio-testing"; - version = "1.58.0"; + version = "1.59.0"; format = "setuptools"; disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; - hash = "sha256-ABZMp+VTsyf2HE50cnHf9wdCOeGlAqpbuMWlbsWE/qY="; + hash = "sha256-YiqbhlOsyoAT/uYNPbLQK5c2T8cYGEDXVkAPIzCaOQ4="; }; postPatch = '' diff --git a/pkgs/development/python-modules/grpcio-tools/default.nix b/pkgs/development/python-modules/grpcio-tools/default.nix index 285f3477dea..cd0b0abcb12 100644 --- a/pkgs/development/python-modules/grpcio-tools/default.nix +++ b/pkgs/development/python-modules/grpcio-tools/default.nix @@ -2,12 +2,12 @@ buildPythonPackage rec { pname = "grpcio-tools"; - version = "1.58.0"; + version = "1.59.0"; format = "setuptools"; src = fetchPypi { inherit pname version; - hash = "sha256-b02AzrWR4xyk3O7HR9vlYTLhOSoKm7HI/gAdG1ysiYo="; + hash = "sha256-qkAY8thmKsTZgwRF09JToRs+CW6K/iCGVUcTeqEWDpM="; }; postPatch = '' diff --git a/pkgs/development/python-modules/icontract/default.nix b/pkgs/development/python-modules/icontract/default.nix index 77565311efb..76e1814dddd 100644 --- a/pkgs/development/python-modules/icontract/default.nix +++ b/pkgs/development/python-modules/icontract/default.nix @@ -50,6 +50,13 @@ buildPythonPackage rec { # mypy decorator checks don't pass. For some reason mypy # doesn't check the python file provided in the test. "tests/test_mypy_decorators.py" + # those tests seems to simply re-run some typeguard tests + "tests/test_typeguard.py" + ]; + + pytestFlagsArray = [ + # RuntimeWarning: coroutine '*' was never awaited + "-W" "ignore::RuntimeWarning" ]; pythonImportsCheck = [ "icontract" ]; diff --git a/pkgs/development/python-modules/mocket/default.nix b/pkgs/development/python-modules/mocket/default.nix index 49125a286e9..41789a796dd 100644 --- a/pkgs/development/python-modules/mocket/default.nix +++ b/pkgs/development/python-modules/mocket/default.nix @@ -1,37 +1,51 @@ { lib -, aiohttp -, asgiref , buildPythonPackage +, fetchPypi +, pythonOlder +, stdenv + +# build-system +, hatchling + +# dependencies , decorator +, httptools +, python-magic +, urllib3 + +# optional-dependencies +, xxhash +, pook + +# tests +, aiohttp +, asgiref , fastapi -, fetchPypi , gevent -, httptools , httpx -, isPy3k -, pook -, pytest-mock +, pytest-asyncio , pytestCheckHook -, python-magic -, pythonOlder , redis +, redis-server , requests , sure -, urllib3 + }: buildPythonPackage rec { pname = "mocket"; - version = "3.11.1"; - format = "setuptools"; - - disabled = pythonOlder "3.7"; + version = "3.12.0"; + pyproject = true; src = fetchPypi { inherit pname version; - hash = "sha256-sEPLUN9nod4AKYcoCNQZ4FBblUCLCPV1dFOrNC6xDWo="; + hash = "sha256-brvBWwTWT2F/usVBRr7wz9L0kct4X1Fddl4mu5LUENA="; }; + nativeBuildInputs = [ + hatchling + ]; + propagatedBuildInputs = [ decorator httptools @@ -43,52 +57,58 @@ buildPythonPackage rec { pook = [ pook ]; + speedups = [ + xxhash + ]; }; nativeCheckInputs = [ - aiohttp asgiref fastapi gevent httpx - pytest-mock + pytest-asyncio pytestCheckHook redis requests sure - ] ++ passthru.optional-dependencies.pook; + ] ++ lib.optionals (pythonOlder "3.12") [ + aiohttp + ] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies); - # Skip http tests - SKIP_TRUE_HTTP = true; + preCheck = lib.optionalString stdenv.isLinux '' + ${redis-server}/bin/redis-server & + REDIS_PID=$! + ''; - disabledTestPaths = [ - # Requires a live Redis instance - "tests/main/test_redis.py" - ]; + postCheck = lib.optionalString stdenv.isLinux '' + kill $REDIS_PID + ''; + + # Skip http tests, they require network access + env.SKIP_TRUE_HTTP = true; + + _darwinAllowLocalNetworking = true; disabledTests = [ # tests that require network access (like DNS lookups) - "test_truesendall" - "test_truesendall_with_chunk_recording" - "test_truesendall_with_gzip_recording" - "test_truesendall_with_recording" - "test_wrongpath_truesendall" "test_truesendall_with_dump_from_recording" - "test_truesendall_with_recording_https" - "test_truesendall_after_mocket_session" - "test_real_request_session" "test_asyncio_record_replay" "test_gethostbyname" ]; + disabledTestPaths = lib.optionals stdenv.isDarwin [ + "tests/main/test_redis.py" + ]; + pythonImportsCheck = [ "mocket" ]; meta = with lib; { + changelog = "https://github.com/mindflayer/python-mocket/releases/tag/${version}"; description = "A socket mock framework for all kinds of sockets including web-clients"; homepage = "https://github.com/mindflayer/python-mocket"; - changelog = "https://github.com/mindflayer/python-mocket/releases/tag/${version}"; license = licenses.bsd3; maintainers = with maintainers; [ hexa ]; }; diff --git a/pkgs/development/python-modules/pytest-datadir/default.nix b/pkgs/development/python-modules/pytest-datadir/default.nix index bca05a0010a..90b7e6f55e2 100644 --- a/pkgs/development/python-modules/pytest-datadir/default.nix +++ b/pkgs/development/python-modules/pytest-datadir/default.nix @@ -1,30 +1,41 @@ { lib , buildPythonPackage +, pythonOlder , fetchFromGitHub +, setuptools , setuptools-scm , pytestCheckHook }: buildPythonPackage rec { pname = "pytest-datadir"; - version = "1.4.1"; + version = "1.5.0"; format = "pyproject"; + disabled = pythonOlder "3.8"; + src = fetchFromGitHub { owner = "gabrielcnr"; repo = "pytest-datadir"; - rev = "refs/tags/${version}"; - hash = "sha256-HyJ0rU1nHqRv8SHFS8m3GZ5409+JZIkoDgIVjy4ol54="; + rev = "refs/tags/v${version}"; + hash = "sha256-sRLqL+8Jf5Kz+qscuG3hClUuPA+33PQa+ob1ht/7CJE="; }; SETUPTOOLS_SCM_PRETEND_VERSION = version; - nativeBuildInputs = [ setuptools-scm ]; + + nativeBuildInputs = [ + setuptools + setuptools-scm + ]; + nativeCheckInputs = [ pytestCheckHook ]; + pythonImportsCheck = [ "pytest_datadir" ]; meta = with lib; { description = "Pytest plugin for manipulating test data directories and files"; homepage = "https://github.com/gabrielcnr/pytest-datadir"; + changelog = "https://github.com/gabrielcnr/pytest-datadir/blob/v${version}/CHANGELOG.rst"; license = licenses.mit; maintainers = with maintainers; [ kira-bruneau ]; }; diff --git a/pkgs/development/python-modules/pytest/default.nix b/pkgs/development/python-modules/pytest/default.nix index d557bcf15e9..a00b59c425b 100644 --- a/pkgs/development/python-modules/pytest/default.nix +++ b/pkgs/development/python-modules/pytest/default.nix @@ -3,10 +3,10 @@ , callPackage , pythonOlder , fetchPypi -, isPyPy , writeText # build +, setuptools , setuptools-scm # propagates @@ -21,12 +21,12 @@ buildPythonPackage rec { pname = "pytest"; - version = "7.4.2"; - format = "pyproject"; + version = "7.4.3"; + pyproject = true; src = fetchPypi { inherit pname version; - hash = "sha256-p2YlnPq1ZKKtUssarhuIGnXD6340yjd5aXwj7UfEcGk="; + hash = "sha256-2YnRNpgt5OOynavMg4rVgcZOjtUsEfvobd69naCBjNU="; }; outputs = [ @@ -35,6 +35,7 @@ buildPythonPackage rec { ]; nativeBuildInputs = [ + setuptools setuptools-scm ]; diff --git a/pkgs/development/python-modules/typeguard/default.nix b/pkgs/development/python-modules/typeguard/default.nix index 7fd258e9123..23e3bdc5b54 100644 --- a/pkgs/development/python-modules/typeguard/default.nix +++ b/pkgs/development/python-modules/typeguard/default.nix @@ -54,8 +54,12 @@ buildPythonPackage rec { ]; disabledTests = [ - # not compatible with python3.10 - "test_typed_dict" + # AssertionError: 'type of argument "x" must be ' != 'None' + "TestPrecondition::test_precondition_ok_and_typeguard_fails" + # AttributeError: 'C' object has no attribute 'x' + "TestInvariant::test_invariant_ok_and_typeguard_fails" + # AttributeError: 'D' object has no attribute 'x' + "TestInheritance::test_invariant_ok_and_typeguard_fails" ]; meta = with lib; { diff --git a/pkgs/development/tools/analysis/valgrind/default.nix b/pkgs/development/tools/analysis/valgrind/default.nix index a43520ecb4b..c8046b68cd9 100644 --- a/pkgs/development/tools/analysis/valgrind/default.nix +++ b/pkgs/development/tools/analysis/valgrind/default.nix @@ -6,11 +6,11 @@ stdenv.mkDerivation rec { pname = "valgrind"; - version = "3.21.0"; + version = "3.22.0"; src = fetchurl { url = "https://sourceware.org/pub/${pname}/${pname}-${version}.tar.bz2"; - hash = "sha256-EM4WGLs+M/rRbreVUrCj4SEXYkSKDX/OEcimJDuayXE="; + hash = "sha256-yBHbWt0sX3KZRMr0fE56Zdyqu5Rh5HK1eHZd179tLUw="; }; patches = [ diff --git a/pkgs/development/tools/build-managers/meson/setup-hook.sh b/pkgs/development/tools/build-managers/meson/setup-hook.sh deleted file mode 100644 index dc7780b2fd3..00000000000 --- a/pkgs/development/tools/build-managers/meson/setup-hook.sh +++ /dev/null @@ -1,71 +0,0 @@ -mesonConfigurePhase() { - runHook preConfigure - - if [ -z "${dontAddPrefix-}" ]; then - mesonFlags="--prefix=$prefix $mesonFlags" - fi - - # See multiple-outputs.sh and meson’s coredata.py - mesonFlags="\ - --libdir=${!outputLib}/lib --libexecdir=${!outputLib}/libexec \ - --bindir=${!outputBin}/bin --sbindir=${!outputBin}/sbin \ - --includedir=${!outputInclude}/include \ - --mandir=${!outputMan}/share/man --infodir=${!outputInfo}/share/info \ - --localedir=${!outputLib}/share/locale \ - -Dauto_features=${mesonAutoFeatures:-enabled} \ - -Dwrap_mode=${mesonWrapMode:-nodownload} \ - $mesonFlags" - - mesonFlags="${crossMesonFlags+$crossMesonFlags }--buildtype=${mesonBuildType:-plain} $mesonFlags" - - echo "meson flags: $mesonFlags ${mesonFlagsArray[@]}" - - meson setup build $mesonFlags "${mesonFlagsArray[@]}" - cd build - - if ! [[ -v enableParallelBuilding ]]; then - enableParallelBuilding=1 - echo "meson: enabled parallel building" - fi - - if [[ ${checkPhase-ninjaCheckPhase} = ninjaCheckPhase && -z $dontUseMesonCheck ]]; then - checkPhase=mesonCheckPhase - fi - if [[ ${installPhase-ninjaInstallPhase} = ninjaInstallPhase && -z $dontUseMesonInstall ]]; then - installPhase=mesonInstallPhase - fi - - runHook postConfigure -} - -mesonCheckPhase() { - runHook preCheck - - local flagsArray=($mesonCheckFlags "${mesonCheckFlagsArray[@]}") - - echoCmd 'check flags' "${flagsArray[@]}" - meson test --no-rebuild "${flagsArray[@]}" - - runHook postCheck -} - -mesonInstallPhase() { - runHook preInstall - - # shellcheck disable=SC2086 - local flagsArray=($mesonInstallFlags "${mesonInstallFlagsArray[@]}") - - if [[ -n "$mesonInstallTags" ]]; then - flagsArray+=("--tags" "${mesonInstallTags// /,}") - fi - - echoCmd 'install flags' "${flagsArray[@]}" - meson install --no-rebuild "${flagsArray[@]}" - - runHook postInstall -} - -if [ -z "${dontUseMesonConfigure-}" -a -z "${configurePhase-}" ]; then - setOutputFlags= - configurePhase=mesonConfigurePhase -fi diff --git a/pkgs/development/tools/build-managers/scons/3.1.2.nix b/pkgs/development/tools/build-managers/scons/3.1.2.nix new file mode 100644 index 00000000000..097a8ffd519 --- /dev/null +++ b/pkgs/development/tools/build-managers/scons/3.1.2.nix @@ -0,0 +1,38 @@ +{ lib, fetchurl, python3 }: + +let + pname = "scons"; + version = "3.1.2"; + src = fetchurl { + url = "mirror://sourceforge/scons/scons-${version}.tar.gz"; + hash = "sha256-eAHz9i9lRSjict94C+EMDpM36JdlC2Ldzunzn94T+Ps="; + }; +in +python3.pkgs.buildPythonApplication { + inherit pname version src; + + setupHook = ./setup-hook.sh; + + doCheck = true; + + passthru = { + # expose the used python version so tools using this (and extensing scos + # with other python modules) can use the exact same python version. + inherit python3; + python = python3; + }; + + meta = { + description = "An improved, cross-platform substitute for Make"; + longDescription = '' + SCons is an Open Source software construction tool. Think of SCons as an + improved, cross-platform substitute for the classic Make utility with + integrated functionality similar to autoconf/automake and compiler caches + such as ccache. In short, SCons is an easier, more reliable and faster way + to build software. + ''; + homepage = "https://scons.org/"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ AndersonTorres ]; + }; +} diff --git a/pkgs/development/tools/build-managers/scons/4.1.0.nix b/pkgs/development/tools/build-managers/scons/4.1.0.nix new file mode 100644 index 00000000000..65499280c2c --- /dev/null +++ b/pkgs/development/tools/build-managers/scons/4.1.0.nix @@ -0,0 +1,50 @@ +{ lib, fetchurl, python3 }: + +let + pname = "scons"; + version = "4.1.0"; + src = fetchurl { + url = "mirror://sourceforge/scons/scons-${version}.tar.gz"; + hash = "sha256-ctKNdi4hJnh/Fz49WeCJI5+LL06e8xFNV/ELEgaYXYU="; + }; +in +python3.pkgs.buildPythonApplication { + inherit pname version src; + + postPatch = '' + substituteInPlace setup.cfg \ + --replace "build/dist" "dist" \ + --replace "build/doc/man/" "" + ''; + + postInstall = '' + mkdir -p "$out/share/man/man1" + mv "$out/"*.1 "$out/share/man/man1/" + ''; + + setupHook = ./setup-hook.sh; + + # The release tarballs don't contain any tests (runtest.py and test/*): + doCheck = false; + + passthru = { + # expose the used python version so tools using this (and extensing scos + # with other python modules) can use the exact same python version. + inherit python3; + python = python3; + }; + + meta = { + description = "An improved, cross-platform substitute for Make"; + longDescription = '' + SCons is an Open Source software construction tool. Think of SCons as an + improved, cross-platform substitute for the classic Make utility with + integrated functionality similar to autoconf/automake and compiler caches + such as ccache. In short, SCons is an easier, more reliable and faster way + to build software. + ''; + homepage = "https://scons.org/"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ AndersonTorres ]; + }; +} diff --git a/pkgs/development/tools/build-managers/scons/4.5.2.nix b/pkgs/development/tools/build-managers/scons/4.5.2.nix new file mode 100644 index 00000000000..61d1719642e --- /dev/null +++ b/pkgs/development/tools/build-managers/scons/4.5.2.nix @@ -0,0 +1,54 @@ +{ lib, fetchurl, python3 }: + +let + pname = "scons"; + version = "4.5.2"; + src = fetchurl { + url = "mirror://sourceforge/project/scons/scons/${version}/SCons-${version}.tar.gz"; + hash = "sha256-ziaqyV01CnmkGSGWsL6sPLJPTMq84BI+so0zcPV28HI="; + }; +in +python3.pkgs.buildPythonApplication { + inherit pname version src; + + patches = [ + ./env.patch + ]; + + postPatch = '' + substituteInPlace setup.cfg \ + --replace "build/dist" "dist" \ + --replace "build/doc/man/" "" + ''; + + postInstall = '' + mkdir -p "$out/share/man/man1" + mv "$out/"*.1 "$out/share/man/man1/" + ''; + + setupHook = ./setup-hook.sh; + + # The release tarballs don't contain any tests (runtest.py and test/*): + doCheck = false; + + passthru = { + # expose the used python version so tools using this (and extensing scos + # with other python modules) can use the exact same python version. + inherit python3; + python = python3; + }; + + meta = { + description = "An improved, cross-platform substitute for Make"; + longDescription = '' + SCons is an Open Source software construction tool. Think of SCons as an + improved, cross-platform substitute for the classic Make utility with + integrated functionality similar to autoconf/automake and compiler caches + such as ccache. In short, SCons is an easier, more reliable and faster way + to build software. + ''; + homepage = "https://scons.org/"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ AndersonTorres ]; + }; +} diff --git a/pkgs/development/tools/build-managers/scons/common.nix b/pkgs/development/tools/build-managers/scons/common.nix deleted file mode 100644 index 64890d12cea..00000000000 --- a/pkgs/development/tools/build-managers/scons/common.nix +++ /dev/null @@ -1,62 +0,0 @@ -{ version, sha256 }: - -{ fetchurl, python, lib }: - -python.pkgs.buildPythonApplication rec { - pname = "scons"; - inherit version; - - src = fetchurl { - url = - if lib.versionAtLeast version "4.3.0" then - "mirror://sourceforge/project/scons/scons/${version}/SCons-${version}.tar.gz" - else - "mirror://sourceforge/scons/scons-${version}.tar.gz"; - inherit sha256; - }; - - setupHook = ./setup-hook.sh; - - patches = lib.optionals (lib.versionAtLeast version "4.3.0") [ - ./env.patch - ]; - - postPatch = lib.optionalString (lib.versionAtLeast version "4.0.0") '' - substituteInPlace setup.cfg \ - --replace "build/dist" "dist" - '' + lib.optionalString (lib.versionAtLeast version "4.1.0") '' - substituteInPlace setup.cfg \ - --replace "build/doc/man/" "" - ''; - - # The release tarballs don't contain any tests (runtest.py and test/*): - doCheck = lib.versionOlder version "4.0.0"; - - postInstall = lib.optionalString (lib.versionAtLeast version "4.1.0") '' - mkdir -p "$out/share/man/man1" - mv "$out/"*.1 "$out/share/man/man1/" - ''; - - passthru = { - # expose the used python version so tools using this (and extensing scos with other python modules) - # can use the exact same python version. - inherit python; - }; - - meta = with lib; { - description = "An improved, cross-platform substitute for Make"; - longDescription = '' - SCons is an Open Source software construction tool. Think of - SCons as an improved, cross-platform substitute for the classic - Make utility with integrated functionality similar to - autoconf/automake and compiler caches such as ccache. In short, - SCons is an easier, more reliable and faster way to build - software. - ''; - homepage = "https://scons.org/"; - changelog = "https://raw.githubusercontent.com/SConsProject/scons/rel_${version}/src/CHANGES.txt"; - license = licenses.mit; - platforms = platforms.all; - maintainers = with lib.maintainers; [ AndersonTorres ]; - }; -} diff --git a/pkgs/development/tools/build-managers/scons/default.nix b/pkgs/development/tools/build-managers/scons/default.nix deleted file mode 100644 index f338d346a70..00000000000 --- a/pkgs/development/tools/build-managers/scons/default.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ callPackage, python2, python3 }: - -let - mkScons = args: callPackage (import ./common.nix args) { - python = python3; - }; -in { - scons_3_1_2 = (mkScons { - version = "3.1.2"; - sha256 = "1yzq2gg9zwz9rvfn42v5jzl3g4qf1khhny6zfbi2hib55zvg60bq"; - }); - scons_4_1_0 = mkScons { - version = "4.1.0"; - sha256 = "11axk03142ziax6i3wwy9qpqp7r3i7h5jg9y2xzph9i15rv8vlkj"; - }; - scons_latest = mkScons { - version = "4.5.2"; - sha256 = "sha256-ziaqyV01CnmkGSGWsL6sPLJPTMq84BI+so0zcPV28HI="; - }; -} diff --git a/pkgs/os-specific/linux/procps-ng/default.nix b/pkgs/os-specific/linux/procps-ng/default.nix index 67b839a1bd3..56a92ffa44e 100644 --- a/pkgs/os-specific/linux/procps-ng/default.nix +++ b/pkgs/os-specific/linux/procps-ng/default.nix @@ -27,7 +27,9 @@ stdenv.mkDerivation rec { sha256 = "sha256-RRiz56r9NOwH0AY9JQ/UdJmbILIAIYw65W9dIRPxQbQ="; }; - patches = lib.optionals stdenv.hostPlatform.isMusl [ + patches = [ + ./v3-CVE-2023-4016.patch + ] ++ lib.optionals stdenv.hostPlatform.isMusl [ # NOTE: Starting from 4.x we will not need a patch anymore, but need to add # "--disable-w" to configureFlags instead to prevent the utmp errors (fetchpatch { diff --git a/pkgs/os-specific/linux/procps-ng/v3-CVE-2023-4016.patch b/pkgs/os-specific/linux/procps-ng/v3-CVE-2023-4016.patch new file mode 100644 index 00000000000..2e260eaf738 --- /dev/null +++ b/pkgs/os-specific/linux/procps-ng/v3-CVE-2023-4016.patch @@ -0,0 +1,63 @@ +This is https://gitlab.com/procps-ng/procps/-/commit/2c933ecba3bb1d3041a5a7a53a7b4078a6003413.diff +back-ported to procps 3.3.17. That commit changes xmalloc to xcalloc. This patch differs in two ways: + +* We modify it to change malloc (no x-) to xcalloc instead +* We pull in procps-4's definition of xcalloc + +Alternative considered: Also pull in commits that changed malloc to xmalloc and defined xcalloc. +This alternative is rejected because those commits contain many other unrelated changes. + +diff --git a/ps/parser.c b/ps/parser.c +index 4263a1fb..ee9a57d9 100644 +--- a/ps/parser.c ++++ b/ps/parser.c +@@ -36,6 +36,14 @@ + #include "common.h" + #include "c.h" + ++static void *xxcalloc(const size_t nelems, const size_t size) ++{ ++ void *ret = calloc(nelems, size); ++ if (!ret && size && nelems) ++ xerrx(EXIT_FAILURE, "cannot allocate %zu bytes", nelems*size); ++ return ret; ++} ++ + #define ARG_GNU 0 + #define ARG_END 1 + #define ARG_PGRP 2 +@@ -184,7 +192,6 @@ static const char *parse_list(const char *arg, const char *(*parse_fn)(char *, s + const char *err; /* error code that could or did happen */ + /*** prepare to operate ***/ + node = malloc(sizeof(selection_node)); +- node->u = malloc(strlen(arg)*sizeof(sel_union)); /* waste is insignificant */ + node->n = 0; + buf = strdup(arg); + /*** sanity check and count items ***/ +@@ -205,6 +212,7 @@ static const char *parse_list(const char *arg, const char *(*parse_fn)(char *, s + } while (*++walk); + if(need_item) goto parse_error; + node->n = items; ++ node->u = xxcalloc(items, sizeof(sel_union)); + /*** actually parse the list ***/ + walk = buf; + while(items--){ +@@ -1031,15 +1039,15 @@ static const char *parse_trailing_pids(void){ + thisarg = ps_argc - 1; /* we must be at the end now */ + + pidnode = malloc(sizeof(selection_node)); +- pidnode->u = malloc(i*sizeof(sel_union)); /* waste is insignificant */ ++ pidnode->u = xxcalloc(i, sizeof(sel_union)); /* waste is insignificant */ + pidnode->n = 0; + + grpnode = malloc(sizeof(selection_node)); +- grpnode->u = malloc(i*sizeof(sel_union)); /* waste is insignificant */ ++ grpnode->u = xxcalloc(i, sizeof(sel_union)); /* waste is insignificant */ + grpnode->n = 0; + + sidnode = malloc(sizeof(selection_node)); +- sidnode->u = malloc(i*sizeof(sel_union)); /* waste is insignificant */ ++ sidnode->u = xxcalloc(i, sizeof(sel_union)); /* waste is insignificant */ + sidnode->n = 0; + + while(i--){ diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index 44c595de0e4..0311d46d1fc 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -124,7 +124,7 @@ , withRemote ? !stdenv.hostPlatform.isMusl , withResolved ? true , withShellCompletions ? true -, withSysusers ? false # conflicts with the NixOS user management +, withSysusers ? true , withSysupdate ? true , withTimedated ? true , withTimesyncd ? true @@ -729,6 +729,8 @@ stdenv.mkDerivation (finalAttrs: { rm -rf $out/share/doc '' + lib.optionalString (withKmod && !buildLibsOnly) '' mv $out/lib/modules-load.d $out/example + '' + lib.optionalString withSysusers '' + mv $out/lib/sysusers.d $out/example ''; # Avoid *.EFI binary stripping. At least on aarch64-linux strip diff --git a/pkgs/os-specific/linux/usbutils/default.nix b/pkgs/os-specific/linux/usbutils/default.nix index 20936fa7d49..cfd94bf33c4 100644 --- a/pkgs/os-specific/linux/usbutils/default.nix +++ b/pkgs/os-specific/linux/usbutils/default.nix @@ -2,11 +2,11 @@ stdenv.mkDerivation rec { pname = "usbutils"; - version = "015"; + version = "017"; src = fetchurl { url = "mirror://kernel/linux/utils/usb/usbutils/usbutils-${version}.tar.xz"; - sha256 = "sha256-w7RRux9P+fY1bKxaaVaprI6F2BZRr1ainmiflPpv2m4="; + hash = "sha256-pqJf/c+RA+ONekRzKsoXBz9OYCuS5K5VYlIxqCcC4Fs="; }; patches = [ diff --git a/pkgs/servers/nosql/mongodb/mongodb.nix b/pkgs/servers/nosql/mongodb/mongodb.nix index 5be49f18891..df7efb33b68 100644 --- a/pkgs/servers/nosql/mongodb/mongodb.nix +++ b/pkgs/servers/nosql/mongodb/mongodb.nix @@ -1,7 +1,7 @@ { lib , stdenv , fetchurl -, sconsPackages +, scons_3_1_2 , boost , gperftools , pcre-cpp @@ -31,7 +31,8 @@ with lib; let variants = - if versionAtLeast version "6.0" then rec { + if versionAtLeast version "6.0" + then rec { python = scons.python.withPackages (ps: with ps; [ pyyaml cheetah3 @@ -41,12 +42,13 @@ let pymongo ]); - scons = sconsPackages.scons_3_1_2; + scons = scons_3_1_2; mozjsVersion = "60"; mozjsReplace = "defined(HAVE___SINCOS)"; - } else rec { + } + else rec { python = scons.python.withPackages (ps: with ps; [ pyyaml cheetah3 @@ -54,7 +56,7 @@ let setuptools ]); - scons = sconsPackages.scons_3_1_2; + scons = scons_3_1_2; mozjsVersion = "60"; mozjsReplace = "defined(HAVE___SINCOS)"; @@ -84,7 +86,7 @@ in stdenv.mkDerivation rec { }; nativeBuildInputs = [ variants.scons ] - ++ lib.optionals (versionAtLeast version "4.4") [ xz ]; + ++ lib.optionals (versionAtLeast version "4.4") [ xz ]; buildInputs = [ boost @@ -147,7 +149,7 @@ in stdenv.mkDerivation rec { "--disable-warnings-as-errors" "VARIANT_DIR=nixos" # Needed so we don't produce argument lists that are too long for gcc / ld ] ++ lib.optionals (versionAtLeast version "4.4") [ "--link-model=static" ] - ++ map (lib: "--use-system-${lib}") system-libraries; + ++ map (lib: "--use-system-${lib}") system-libraries; # This seems to fix mongodb not able to find OpenSSL's crypto.h during build hardeningDisable = [ "fortify3" ]; diff --git a/pkgs/stdenv/darwin/make-bootstrap-tools.nix b/pkgs/stdenv/darwin/make-bootstrap-tools.nix index 448d6ecd9f1..deda9b052e5 100644 --- a/pkgs/stdenv/darwin/make-bootstrap-tools.nix +++ b/pkgs/stdenv/darwin/make-bootstrap-tools.nix @@ -28,7 +28,7 @@ in rec { cctools_ = darwin.cctools; # Avoid debugging larger changes for now. - bzip2_ = bzip2.override (args: { linkStatic = true; }); + bzip2_ = bzip2.override (args: { enableStatic = true; enableShared = false; }); # Avoid messing with libkrb5 and libnghttp2. curl_ = curlMinimal.override (args: { gssSupport = false; http2Support = false; }); diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index 419a66261e6..37c10fb2957 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -1526,6 +1526,44 @@ showPhaseFooter() { } +runPhase() { + local curPhase="$*" + if [[ "$curPhase" = unpackPhase && -n "${dontUnpack:-}" ]]; then return; fi + if [[ "$curPhase" = patchPhase && -n "${dontPatch:-}" ]]; then return; fi + if [[ "$curPhase" = configurePhase && -n "${dontConfigure:-}" ]]; then return; fi + if [[ "$curPhase" = buildPhase && -n "${dontBuild:-}" ]]; then return; fi + if [[ "$curPhase" = checkPhase && -z "${doCheck:-}" ]]; then return; fi + if [[ "$curPhase" = installPhase && -n "${dontInstall:-}" ]]; then return; fi + if [[ "$curPhase" = fixupPhase && -n "${dontFixup:-}" ]]; then return; fi + if [[ "$curPhase" = installCheckPhase && -z "${doInstallCheck:-}" ]]; then return; fi + if [[ "$curPhase" = distPhase && -z "${doDist:-}" ]]; then return; fi + + if [[ -n $NIX_LOG_FD ]]; then + echo "@nix { \"action\": \"setPhase\", \"phase\": \"$curPhase\" }" >&"$NIX_LOG_FD" + fi + + showPhaseHeader "$curPhase" + dumpVars + + local startTime=$(date +"%s") + + # Evaluate the variable named $curPhase if it exists, otherwise the + # function named $curPhase. + eval "${!curPhase:-$curPhase}" + + local endTime=$(date +"%s") + + showPhaseFooter "$curPhase" "$startTime" "$endTime" + + if [ "$curPhase" = unpackPhase ]; then + # make sure we can cd into the directory + [ -n "${sourceRoot:-}" ] && chmod +x "${sourceRoot}" + + cd "${sourceRoot:-.}" + fi +} + + genericBuild() { # variable used by our gzip wrapper to add -n. # gzip is in common-path.nix and is added to nix-shell but we only want to change its behaviour in nix builds. do not move to a setupHook in gzip. @@ -1552,39 +1590,7 @@ genericBuild() { # phase name is space-free, which it must be because it's the name # of either a shell variable or a shell function. for curPhase in ${phases[*]}; do - if [[ "$curPhase" = unpackPhase && -n "${dontUnpack:-}" ]]; then continue; fi - if [[ "$curPhase" = patchPhase && -n "${dontPatch:-}" ]]; then continue; fi - if [[ "$curPhase" = configurePhase && -n "${dontConfigure:-}" ]]; then continue; fi - if [[ "$curPhase" = buildPhase && -n "${dontBuild:-}" ]]; then continue; fi - if [[ "$curPhase" = checkPhase && -z "${doCheck:-}" ]]; then continue; fi - if [[ "$curPhase" = installPhase && -n "${dontInstall:-}" ]]; then continue; fi - if [[ "$curPhase" = fixupPhase && -n "${dontFixup:-}" ]]; then continue; fi - if [[ "$curPhase" = installCheckPhase && -z "${doInstallCheck:-}" ]]; then continue; fi - if [[ "$curPhase" = distPhase && -z "${doDist:-}" ]]; then continue; fi - - if [[ -n $NIX_LOG_FD ]]; then - echo "@nix { \"action\": \"setPhase\", \"phase\": \"$curPhase\" }" >&"$NIX_LOG_FD" - fi - - showPhaseHeader "$curPhase" - dumpVars - - local startTime=$(date +"%s") - - # Evaluate the variable named $curPhase if it exists, otherwise the - # function named $curPhase. - eval "${!curPhase:-$curPhase}" - - local endTime=$(date +"%s") - - showPhaseFooter "$curPhase" "$startTime" "$endTime" - - if [ "$curPhase" = unpackPhase ]; then - # make sure we can cd into the directory - [ -n "${sourceRoot:-}" ] && chmod +x "${sourceRoot}" - - cd "${sourceRoot:-.}" - fi + runPhase "$curPhase" done } diff --git a/pkgs/tools/compression/bzip2/default.nix b/pkgs/tools/compression/bzip2/default.nix index be456cf5944..bfab2dbb946 100644 --- a/pkgs/tools/compression/bzip2/default.nix +++ b/pkgs/tools/compression/bzip2/default.nix @@ -1,5 +1,6 @@ { lib, stdenv, fetchurl -, linkStatic ? with stdenv.hostPlatform; isStatic || isCygwin +, enableStatic ? with stdenv.hostPlatform; isStatic || isCygwin +, enableShared ? true , autoreconfHook , testers }: @@ -47,8 +48,12 @@ in { outputs = [ "bin" "dev" "out" "man" ]; - configureFlags = - lib.optionals linkStatic [ "--enable-static" "--disable-shared" ]; + configureFlags = lib.concatLists [ + (lib.optional enableStatic "--enable-static") + (lib.optional (!enableShared) "--disable-shared") + ]; + + dontDisableStatic = enableStatic; enableParallelBuilding = true; diff --git a/pkgs/tools/compression/zstd/default.nix b/pkgs/tools/compression/zstd/default.nix index 791dda4f11e..75b306b368a 100644 --- a/pkgs/tools/compression/zstd/default.nix +++ b/pkgs/tools/compression/zstd/default.nix @@ -2,7 +2,8 @@ , fixDarwinDylibNames , file , legacySupport ? false -, static ? stdenv.hostPlatform.isStatic +, static ? stdenv.hostPlatform.isStatic # generates static libraries *only* +, enableStatic ? static # these need to be ran on the host, thus disable when cross-compiling , buildContrib ? stdenv.hostPlatform == stdenv.buildPlatform , doCheck ? stdenv.hostPlatform == stdenv.buildPlatform @@ -54,7 +55,7 @@ stdenv.mkDerivation rec { cmakeFlags = lib.attrsets.mapAttrsToList (name: value: "-DZSTD_${name}:BOOL=${if value then "ON" else "OFF"}") { BUILD_SHARED = !static; - BUILD_STATIC = static; + BUILD_STATIC = enableStatic; BUILD_CONTRIB = buildContrib; PROGRAMS_LINK_SHARED = !static; LEGACY_SUPPORT = legacySupport; diff --git a/pkgs/tools/misc/hdf5/default.nix b/pkgs/tools/misc/hdf5/default.nix index 39c0b680b00..89702cfd1a7 100644 --- a/pkgs/tools/misc/hdf5/default.nix +++ b/pkgs/tools/misc/hdf5/default.nix @@ -27,7 +27,7 @@ assert !cppSupport || !mpiSupport; let inherit (lib) optional optionals; in stdenv.mkDerivation rec { - version = "1.14.2"; + version = "1.14.3"; pname = "hdf5" + lib.optionalString cppSupport "-cpp" + lib.optionalString fortranSupport "-fortran" @@ -41,7 +41,7 @@ stdenv.mkDerivation rec { majorMinorPatch = with lib.versions; "${major version}.${minor version}.${patch version}"; in "https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-${majorMinor}/hdf5-${majorMinorPatch}/src/hdf5-${version}.tar.bz2"; - sha256 = "sha256-6jxeJX7zIq9ed/weUurTrWvzu0rAZIDdF+45ANeiTPs="; + sha256 = "sha256-lCXyJO110SgLtG1vJpI92Tj5BA5+rr9X5m7HNXwI+Rc="; }; passthru = { diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c362880be1a..5ab237a34c8 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5975,10 +5975,6 @@ with pkgs; merriweather-sans = callPackage ../data/fonts/merriweather-sans { }; - meson = callPackage ../development/tools/build-managers/meson { - inherit (darwin.apple_sdk.frameworks) Foundation OpenGL AppKit Cocoa; - }; - # while building documentation meson may want to run binaries for host # which needs an emulator # example of an error which this fixes @@ -5998,7 +5994,7 @@ with pkgs; # outer level, but not its outPath can still be evaluated if the condition # doesn't hold. This ensures that splicing still can work correctly. (if (!stdenv.hostPlatform.canExecute stdenv.targetPlatform) then - ../development/tools/build-managers/meson/emulator-hook.sh + ../by-name/me/meson/emulator-hook.sh else throw "mesonEmulatorHook may only be added to nativeBuildInputs when the target binaries can't be executed; however you are attempting to use it in a situation where ${stdenv.hostPlatform.config} can execute ${stdenv.targetPlatform.config}. Consider only adding mesonEmulatorHook according to a conditional based canExecute in your package expression."); @@ -18900,11 +18896,9 @@ with pkgs; ctmg = callPackage ../tools/security/ctmg { }; - cmake = callPackage ../development/tools/build-managers/cmake { }; - # can't use override - it triggers infinite recursion - cmakeMinimal = callPackage ../development/tools/build-managers/cmake { - isBootstrap = true; + cmakeMinimal = callPackage ../by-name/cm/cmake/package.nix { + isMinimalBuild = true; }; cmakeCurses = cmake.override { @@ -20020,8 +20014,10 @@ with pkgs; sca2d = callPackage ../development/tools/sca2d { }; - sconsPackages = dontRecurseIntoAttrs (callPackage ../development/tools/build-managers/scons { }); - scons = sconsPackages.scons_latest; + scons = scons_4_5_2; + scons_3_1_2 = callPackage ../development/tools/build-managers/scons/3.1.2.nix { }; + scons_4_1_0 = callPackage ../development/tools/build-managers/scons/4.1.0.nix { }; + scons_4_5_2 = callPackage ../development/tools/build-managers/scons/4.5.2.nix { }; mill = callPackage ../development/tools/build-managers/mill { }; @@ -21784,10 +21780,9 @@ with pkgs; grilo-plugins = callPackage ../development/libraries/grilo-plugins { }; - grpc = callPackage ../development/libraries/grpc { - # Work around Clang check for 10.13 when using aligned allocations with C++17. + grpc = darwin.apple_sdk_11_0.callPackage ../development/libraries/grpc { stdenv = if stdenv.isDarwin && stdenv.isx86_64 - then overrideSDK stdenv { darwinMinVersion = "10.13"; } + then overrideSDK darwin.apple_sdk_11_0.stdenv { darwinMinVersion = "10.13"; } else stdenv; }; @@ -28788,6 +28783,7 @@ with pkgs; withResolved = false; withShellCompletions = false; withSysupdate = false; + withSysusers = false; withTimedated = false; withTimesyncd = false; withTpm2Tss = false; diff --git a/pkgs/top-level/packages-config.nix b/pkgs/top-level/packages-config.nix index 79be645162e..b1c436d1ccf 100644 --- a/pkgs/top-level/packages-config.nix +++ b/pkgs/top-level/packages-config.nix @@ -20,7 +20,6 @@ quicklispPackagesSBCL rPackages roundcubePlugins - sconsPackages sourceHanPackages steamPackages ut2004Packages diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index a91a56b08b5..bfb99c847e2 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6938,7 +6938,9 @@ self: super: with self; { mobly = callPackage ../development/python-modules/mobly { }; - mocket = callPackage ../development/python-modules/mocket { }; + mocket = callPackage ../development/python-modules/mocket { + redis-server = pkgs.redis; + }; mock = callPackage ../development/python-modules/mock { }; |