From d25cd80ecacb915c963e34ea80b4de4c727c0d19 Mon Sep 17 00:00:00 2001 From: Ovyerus Date: Fri, 22 Dec 2023 11:33:20 +1100 Subject: [PATCH 01/32] darwin.xcode: add 15 and 15.1 --- pkgs/os-specific/darwin/xcode/default.nix | 2 ++ pkgs/top-level/darwin-packages.nix | 1 + 2 files changed, 3 insertions(+) diff --git a/pkgs/os-specific/darwin/xcode/default.nix b/pkgs/os-specific/darwin/xcode/default.nix index ec98a0b1cfb6..54250001d9eb 100644 --- a/pkgs/os-specific/darwin/xcode/default.nix +++ b/pkgs/os-specific/darwin/xcode/default.nix @@ -79,6 +79,8 @@ in lib.makeExtensible (self: { xcode_13_4_1 = requireXcode "13.4.1" "sha256-Jk8fLgvnODoIhuVJqfV0KrpBBL40fRrHJbFmm44NRKE="; xcode_14 = requireXcode "14" "sha256-E+wjPgQx/lbYAsauksdmGsygL5VPBA8R9pHB93eA7T0="; xcode_14_1 = requireXcode "14.1" "sha256-QJGAUVIhuDYyzDNttBPv5lIGOfvkYqdOFSUAr5tlkfs="; + xcode_15 = requireXcode "15" "sha256-ffqISt2Ayccln5BArKIjSdzbEgoSoNwq8TPLGysAE0c="; + xcode_15_1 = requireXcode "15.1" "sha256-0djqoSamU87rCpjo50Un3cFg9wKf+pSczRko6uumGM0="; xcode = self."xcode_${lib.replaceStrings ["."] ["_"] (if (stdenv.targetPlatform ? xcodeVer) then stdenv.targetPlatform.xcodeVer else "12.3")}"; }) diff --git a/pkgs/top-level/darwin-packages.nix b/pkgs/top-level/darwin-packages.nix index 2547b0c81cca..73943fb3b8a3 100644 --- a/pkgs/top-level/darwin-packages.nix +++ b/pkgs/top-level/darwin-packages.nix @@ -196,6 +196,7 @@ impure-cmds // appleSourcePackages // chooseLibs // { xcode_12 xcode_12_0_1 xcode_12_1 xcode_12_2 xcode_12_3 xcode_12_4 xcode_12_5 xcode_12_5_1 xcode_13 xcode_13_1 xcode_13_2 xcode_13_3 xcode_13_3_1 xcode_13_4 xcode_13_4_1 xcode_14 xcode_14_1 + xcode_15 xcode_15_1 xcode; CoreSymbolication = callPackage ../os-specific/darwin/CoreSymbolication { }; From 597f3d31d8254f1f13214f006131f60f868f134d Mon Sep 17 00:00:00 2001 From: Peter Kolloch Date: Thu, 4 Jan 2024 12:14:17 +0100 Subject: [PATCH 02/32] build-rust-crate: Allow missing `hostPlatform.extensions.sharedLibrary` If you cross-build, sharedLibrary might not be set. E.g. for this nixpkgs instance: ```nix pkgs = import { config = { }; crossSystem = { config = "riscv32-unknown-none-elf"; rustc = { config = "riscv32i-unknown-none-elf"; }; }; } ``` --- pkgs/build-support/rust/build-rust-crate/build-crate.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/build-support/rust/build-rust-crate/build-crate.nix b/pkgs/build-support/rust/build-rust-crate/build-crate.nix index e842b6a3f501..bbb26606a6a4 100644 --- a/pkgs/build-support/rust/build-rust-crate/build-crate.nix +++ b/pkgs/build-support/rust/build-rust-crate/build-crate.nix @@ -51,7 +51,7 @@ # configure & source common build functions LIB_RUSTC_OPTS="${libRustcOpts}" BIN_RUSTC_OPTS="${binRustcOpts}" - LIB_EXT="${stdenv.hostPlatform.extensions.sharedLibrary}" + LIB_EXT="${stdenv.hostPlatform.extensions.sharedLibrary or ""}" LIB_PATH="${libPath}" LIB_NAME="${libName}" From 72db73af3db9392554b89eb9aeb3187ae9dca78e Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Thu, 4 Jan 2024 19:17:41 -0800 Subject: [PATCH 03/32] cudaPackage_10_0.cudatoolkit: fix build Acknowledge to `autoPatchelfHook` that we don't have ancient versions of ffmeg for the jre shipped. Also, targets/ directory doesn't exist in cuda 10.0, so the preFixup phase collected 0 files and when passed to patchelf would fail the build. --- pkgs/development/cuda-modules/cudatoolkit/default.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkgs/development/cuda-modules/cudatoolkit/default.nix b/pkgs/development/cuda-modules/cudatoolkit/default.nix index de216c24bb67..57d1a0461e13 100644 --- a/pkgs/development/cuda-modules/cudatoolkit/default.nix +++ b/pkgs/development/cuda-modules/cudatoolkit/default.nix @@ -180,10 +180,17 @@ backendStdenv.mkDerivation rec { # This dependency is asked for by target-linux-x64/CollectX/RedHat/x86_64/libssl.so.10 # - do we even want to use nvidia-shipped libssl? "libcom_err.so.2" + ] ++ lib.optionals (lib.versionOlder version "10.1") [ + # For Cuda 10.0, nVidia also shipped a jre implementation which needed + # two old versions of ffmpeg which are not available in nixpkgs + "libavcodec.so.54" + "libavcodec.so.53" + "libavformat.so.54" + "libavformat.so.53" ]; preFixup = - if lib.versionOlder version "11" then + if (lib.versionAtLeast version "10.1" && lib.versionOlder version "11") then '' ${lib.getExe' patchelf "patchelf"} $out/targets/*/lib/libnvrtc.so --add-needed libnvrtc-builtins.so '' From 775b3f7585988703cb31104b727220b8b94c69d3 Mon Sep 17 00:00:00 2001 From: traxys Date: Thu, 28 Dec 2023 20:43:15 +0100 Subject: [PATCH 04/32] luaPackages.lua-pam: init at unstable-2015-07-03 --- pkgs/top-level/lua-packages.nix | 39 +++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/pkgs/top-level/lua-packages.nix b/pkgs/top-level/lua-packages.nix index 014cf6d394f9..f4868822463b 100644 --- a/pkgs/top-level/lua-packages.nix +++ b/pkgs/top-level/lua-packages.nix @@ -59,6 +59,45 @@ rec { # a fork of luarocks used to generate nix lua derivations from rockspecs luarocks-nix = toLuaModule (callPackage ../development/tools/misc/luarocks/luarocks-nix.nix { }); + lua-pam = callPackage({fetchFromGitHub, linux-pam, openpam}: buildLuaPackage rec { + pname = "lua-pam"; + version = "unstable-2015-07-03"; + # Needed for `disabled`, overridden in buildLuaPackage + name = "${pname}-${version}"; + + src = fetchFromGitHub { + owner = "devurandom"; + repo = "lua-pam"; + rev = "3818ee6346a976669d74a5cbc2a83ad2585c5953"; + hash = "sha256-YlMZ5mM9Ij/9yRmgA0X1ahYVZMUx8Igj5OBvAMskqTg="; + fetchSubmodules = true; + }; + + # The makefile tries to link to `-llua` + LUA_LIBS = "-llua"; + + buildInputs = lib.optionals stdenv.isLinux [linux-pam] + ++ lib.optionals stdenv.isDarwin [openpam]; + + installPhase = '' + runHook preInstall + + install -Dm755 pam.so $out/lib/lua/${lua.luaversion}/pam.so + + runHook postInstall + ''; + + # The package does not build with lua 5.4 or luaJIT + disabled = luaAtLeast "5.4" || isLuaJIT; + + meta = with lib; { + description = "Lua module for PAM authentication"; + homepage = "https://github.com/devurandom/lua-pam"; + license = licenses.mit; + maintainers = with maintainers; [ traxys ]; + }; + }) {}; + lua-resty-core = callPackage ({ fetchFromGitHub }: buildLuaPackage rec { pname = "lua-resty-core"; version = "0.1.24"; From fa4bee28ad1df7067185e1b7ac341033cd0ef440 Mon Sep 17 00:00:00 2001 From: Thomas Gerbet Date: Tue, 9 Jan 2024 22:25:48 +0100 Subject: [PATCH 05/32] go_1_20: 1.20.12 -> 1.20.13 Changes: https://github.com/golang/go/issues?q=milestone%3AGo1.20.13+label%3ACherryPickApproved --- pkgs/development/compilers/go/1.20.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/compilers/go/1.20.nix b/pkgs/development/compilers/go/1.20.nix index 0b83a57994c2..2adeaf69bb11 100644 --- a/pkgs/development/compilers/go/1.20.nix +++ b/pkgs/development/compilers/go/1.20.nix @@ -46,11 +46,11 @@ let in stdenv.mkDerivation (finalAttrs: { pname = "go"; - version = "1.20.12"; + version = "1.20.13"; src = fetchurl { url = "https://go.dev/dl/go${finalAttrs.version}.src.tar.gz"; - hash = "sha256-xb+TR1HTHDFcHQu1+wIpZUX6bQiSNWb3pa/sgfLtJ9Y="; + hash = "sha256-D+dFxTDy8dZxk688XqJSRr4HeYnsUXjfJm6XXzUyRJ4="; }; strictDeps = true; From 501a1af970ca54cb300474a00aacfbd01f8a5b24 Mon Sep 17 00:00:00 2001 From: Connor Baker Date: Thu, 14 Dec 2023 20:12:20 +0000 Subject: [PATCH 06/32] cudaPackages.saxpy: now available pre-11.4 with CUDA Toolkit --- pkgs/top-level/cuda-packages.nix | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pkgs/top-level/cuda-packages.nix b/pkgs/top-level/cuda-packages.nix index 9045b5754ab8..f997963ff468 100644 --- a/pkgs/top-level/cuda-packages.nix +++ b/pkgs/top-level/cuda-packages.nix @@ -72,10 +72,7 @@ let # Loose packages cudatoolkit = final.callPackage ../development/cuda-modules/cudatoolkit {}; - # SaxPy is only available after 11.4 because it requires redistributable versions of CUDA libraries. - saxpy = attrsets.optionalAttrs (strings.versionAtLeast cudaVersion "11.4") ( - final.callPackage ../development/cuda-modules/saxpy {} - ); + saxpy = final.callPackage ../development/cuda-modules/saxpy {}; } # NCCL is not supported on Jetson, because it does not use NVLink or PCI-e for inter-GPU communication. # https://forums.developer.nvidia.com/t/can-jetson-orin-support-nccl/232845/9 From 9bebd9e72d6b552fcfd3d1e6716eca6563944f42 Mon Sep 17 00:00:00 2001 From: Connor Baker Date: Thu, 14 Dec 2023 22:19:02 +0000 Subject: [PATCH 07/32] tree-wide: cudaPackages should not break default eval cudaPackages: guard expressions against null values --- .../science/math/caffe/default.nix | 2 +- pkgs/development/cuda-modules/cudnn/shims.nix | 18 ++++-- .../cuda-modules/cutensor/extension.nix | 1 + pkgs/development/cuda-modules/flags.nix | 50 ++++++--------- .../generic-builders/manifest.nix | 62 ++++++++++++------- .../generic-builders/multiplex.nix | 18 ++---- .../development/cuda-modules/nccl/default.nix | 3 + .../cuda-modules/tensorrt/fixup.nix | 15 +++-- .../cuda-modules/tensorrt/shims.nix | 24 ++++--- .../libraries/science/math/magma/generic.nix | 2 +- .../development/libraries/xgboost/default.nix | 2 +- .../python-modules/jaxlib/default.nix | 3 +- .../python-modules/torch/default.nix | 13 ++-- pkgs/top-level/cuda-packages.nix | 4 -- 14 files changed, 119 insertions(+), 98 deletions(-) diff --git a/pkgs/applications/science/math/caffe/default.nix b/pkgs/applications/science/math/caffe/default.nix index 6595f0b846dd..25f7229a845a 100644 --- a/pkgs/applications/science/math/caffe/default.nix +++ b/pkgs/applications/science/math/caffe/default.nix @@ -153,7 +153,7 @@ stdenv.mkDerivation rec { || cudaSupport || !(leveldbSupport -> (leveldb != null && snappy != null)) || !(cudnnSupport -> (hasCudnn && cudaSupport)) - || !(ncclSupport -> cudaSupport) + || !(ncclSupport -> (cudaSupport && !nccl.meta.unsupported)) || !(pythonSupport -> (python != null && numpy != null)) ; license = licenses.bsd2; diff --git a/pkgs/development/cuda-modules/cudnn/shims.nix b/pkgs/development/cuda-modules/cudnn/shims.nix index e9eca8ef7c8b..a36ee26dab5d 100644 --- a/pkgs/development/cuda-modules/cudnn/shims.nix +++ b/pkgs/development/cuda-modules/cudnn/shims.nix @@ -1,10 +1,18 @@ # Shims to mimic the shape of ../modules/generic/manifests/{feature,redistrib}/release.nix -{package, redistArch}: { - featureRelease.${redistArch}.outputs = { - lib = true; - static = true; - dev = true; + lib, + package, + # redistArch :: String + # String is "unsupported" if the given architecture is unsupported. + redistArch, +}: +{ + featureRelease = lib.optionalAttrs (redistArch != "unsupported") { + ${redistArch}.outputs = { + lib = true; + static = true; + dev = true; + }; }; redistribRelease = { name = "NVIDIA CUDA Deep Neural Network library (cuDNN)"; diff --git a/pkgs/development/cuda-modules/cutensor/extension.nix b/pkgs/development/cuda-modules/cutensor/extension.nix index b762fd22ede8..534941887c6e 100644 --- a/pkgs/development/cuda-modules/cutensor/extension.nix +++ b/pkgs/development/cuda-modules/cutensor/extension.nix @@ -92,6 +92,7 @@ let # A release is supported if it has a libPath that matches our CUDA version for our platform. # LibPath are not constant across the same release -- one platform may support fewer # CUDA versions than another. + # redistArch :: String redistArch = flags.getRedistArch hostPlatform.system; # platformIsSupported :: Manifests -> Boolean platformIsSupported = diff --git a/pkgs/development/cuda-modules/flags.nix b/pkgs/development/cuda-modules/flags.nix index a123c7bce5a1..d5e01be01fd5 100644 --- a/pkgs/development/cuda-modules/flags.nix +++ b/pkgs/development/cuda-modules/flags.nix @@ -131,39 +131,29 @@ let # `linux-aarch64` redist (which is for Jetson devices) if we're building any Jetson devices. # Since both are based on aarch64, we can only have one or the other, otherwise there's an # ambiguity as to which should be used. + # NOTE: This function *will* be called by unsupported systems because `cudaPackages` is part of + # `all-packages.nix`, which is evaluated on all systems. As such, we need to handle unsupported + # systems gracefully. # getRedistArch :: String -> String - getRedistArch = - nixSystem: - if nixSystem == "aarch64-linux" then - if jetsonTargets != [] then "linux-aarch64" else "linux-sbsa" - else if nixSystem == "x86_64-linux" then - "linux-x86_64" - else if nixSystem == "ppc64le-linux" then - "linux-ppc64le" - else if nixSystem == "x86_64-windows" then - "windows-x86_64" - else - "unsupported"; + getRedistArch = nixSystem: attrsets.attrByPath [ nixSystem ] "unsupported" { + aarch64-linux = if jetsonTargets != [] then "linux-aarch64" else "linux-sbsa"; + x86_64-linux = "linux-x86_64"; + ppc64le-linux = "linux-ppc64le"; + x86_64-windows = "windows-x86_64"; + }; # Maps NVIDIA redist arch to Nix system. - # It is imperative that we include the boolean condition based on jetsonTargets to ensure - # we don't advertise availability of packages only available on server-grade ARM - # as being available for the Jetson, since both `linux-sbsa` and `linux-aarch64` are - # mapped to the Nix system `aarch64-linux`. - getNixSystem = - redistArch: - if redistArch == "linux-sbsa" && jetsonTargets == [] then - "aarch64-linux" - else if redistArch == "linux-aarch64" && jetsonTargets != [] then - "aarch64-linux" - else if redistArch == "linux-x86_64" then - "x86_64-linux" - else if redistArch == "linux-ppc64le" then - "ppc64le-linux" - else if redistArch == "windows-x86_64" then - "x86_64-windows" - else - "unsupported-${redistArch}"; + # NOTE: This function *will* be called by unsupported systems because `cudaPackages` is part of + # `all-packages.nix`, which is evaluated on all systems. As such, we need to handle unsupported + # systems gracefully. + # getNixSystem :: String -> String + getNixSystem = redistArch: attrsets.attrByPath [ redistArch ] "unsupported-${redistArch}" { + linux-sbsa = "aarch64-linux"; + linux-aarch64 = "aarch64-linux"; + linux-x86_64 = "x86_64-linux"; + linux-ppc64le = "ppc64le-linux"; + windows-x86_64 = "x86_64-windows"; + }; formatCapabilities = { diff --git a/pkgs/development/cuda-modules/generic-builders/manifest.nix b/pkgs/development/cuda-modules/generic-builders/manifest.nix index 5a4c5280d7db..64204346791a 100644 --- a/pkgs/development/cuda-modules/generic-builders/manifest.nix +++ b/pkgs/development/cuda-modules/generic-builders/manifest.nix @@ -42,6 +42,9 @@ let # Get the redist architectures for which package provides distributables. # These are used by meta.platforms. supportedRedistArchs = builtins.attrNames featureRelease; + # redistArch :: String + # The redistArch is the name of the architecture for which the redistributable is built. + # It is `"unsupported"` if the redistributable is not supported on the target platform. redistArch = flags.getRedistArch hostPlatform.system; in backendStdenv.mkDerivation ( @@ -86,8 +89,18 @@ backendStdenv.mkDerivation ( "sample" "python" ]; + # Filter out outputs that don't exist in the redistributable. + # NOTE: In the case the redistributable isn't supported on the target platform, + # we will have `outputs = [ "out" ] ++ possibleOutputs`. This is of note because platforms which + # aren't supported would otherwise have evaluation errors when trying to access outputs other than `out`. + # The alternative would be to have `outputs = [ "out" ]` when`redistArch = "unsupported"`, but that would + # require adding guards throughout the entirety of the CUDA package set to ensure `cudaSupport` is true -- + # recall that OfBorg will evaluate packages marked as broken and that `cudaPackages` will be evaluated with + # `cudaSupport = false`! additionalOutputs = - if redistArch == "unsupported" then possibleOutputs else builtins.filter hasOutput possibleOutputs; + if redistArch == "unsupported" + then possibleOutputs + else builtins.filter hasOutput possibleOutputs; # The out output is special -- it's the default output and we always include it. outputs = [ "out" ] ++ additionalOutputs; in @@ -114,19 +127,28 @@ backendStdenv.mkDerivation ( # Useful for introspecting why something went wrong. # Maps descriptions of why the derivation would be marked broken to # booleans indicating whether that description is true. - brokenConditions = {}; - - src = fetchurl { - url = - if (builtins.hasAttr redistArch redistribRelease) then - "https://developer.download.nvidia.com/compute/${redistName}/redist/${ - redistribRelease.${redistArch}.relative_path - }" - else - "cannot-construct-an-url-for-the-${redistArch}-platform"; - sha256 = redistribRelease.${redistArch}.sha256 or lib.fakeHash; + # brokenConditions :: AttrSet Bool + brokenConditions = { + # Using an unrecognized redistArch + "Unrecognized NixOS platform ${hostPlatform.system}" = redistArch == "unsupported"; + # Trying to build for a platform that doesn't have a redistributable + "Unsupported NixOS platform (or configuration) ${hostPlatform.system}" = finalAttrs.src == null; }; + # src :: Optional Derivation + src = trivial.pipe redistArch [ + # If redistArch doesn't exist in redistribRelease, return null. + (redistArch: redistribRelease.${redistArch} or null) + # If the release is non-null, fetch the source; otherwise, return null. + (trivial.mapNullable ( + { relative_path, sha256, ... }: + fetchurl { + url = "https://developer.download.nvidia.com/compute/${redistName}/redist/${relative_path}"; + inherit sha256; + } + )) + ]; + postPatch = '' if [[ -d pkg-config ]] ; then mkdir -p share/pkg-config @@ -284,16 +306,12 @@ backendStdenv.mkDerivation ( meta = { description = "${redistribRelease.name}. By downloading and using the packages you accept the terms and conditions of the ${finalAttrs.meta.license.shortName}"; sourceProvenance = [sourceTypes.binaryNativeCode]; - platforms = - lists.concatMap - ( - redistArch: - let - nixSystem = flags.getNixSystem redistArch; - in - lists.optionals (!(strings.hasPrefix "unsupported-" nixSystem)) [ nixSystem ] - ) - supportedRedistArchs; + platforms = trivial.pipe supportedRedistArchs [ + # Map each redist arch to the equivalent nix system or null if there is no equivalent. + (builtins.map flags.getNixSystem) + # Filter out unsupported systems + (builtins.filter (nixSystem: !(strings.hasPrefix "unsupported-" nixSystem))) + ]; broken = lists.any trivial.id (attrsets.attrValues finalAttrs.brokenConditions); license = licenses.unfree; maintainers = teams.cuda.members; diff --git a/pkgs/development/cuda-modules/generic-builders/multiplex.nix b/pkgs/development/cuda-modules/generic-builders/multiplex.nix index 5480da730726..6353b07545a4 100644 --- a/pkgs/development/cuda-modules/generic-builders/multiplex.nix +++ b/pkgs/development/cuda-modules/generic-builders/multiplex.nix @@ -20,7 +20,7 @@ # The featureRelease is used to populate meta.platforms (by way of looking at the attribute names) # and to determine the outputs of the package. # shimFn :: {package, redistArch} -> AttrSet - shimsFn ? ({package, redistArch}: throw "shimsFn must be provided"), + shimsFn ? (throw "shimsFn must be provided"), # fixupFn :: Path # A path (or nix expression) to be evaluated with callPackage and then # provided to the package's overrideAttrs function. @@ -29,16 +29,8 @@ # - cudaVersion # - mkVersionedPackageName # - package - fixupFn ? ( - { - final, - cudaVersion, - mkVersionedPackageName, - package, - ... - }: - throw "fixupFn must be provided" - ), + # - ... + fixupFn ? (throw "fixupFn must be provided"), }: let inherit (lib) @@ -80,9 +72,11 @@ let && strings.versionAtLeast package.maxCudaVersion cudaVersion; # Get all of the packages for our given platform. + # redistArch :: String + # Value is `"unsupported"` if the platform is not supported. redistArch = flags.getRedistArch hostPlatform.system; - allReleases = builtins.concatMap (xs: xs) (builtins.attrValues releaseSets); + allReleases = lists.flatten (builtins.attrValues releaseSets); # All the supported packages we can build for our platform. # perSystemReleases :: List Package diff --git a/pkgs/development/cuda-modules/nccl/default.nix b/pkgs/development/cuda-modules/nccl/default.nix index c56d59cb4206..6e385688d0f8 100644 --- a/pkgs/development/cuda-modules/nccl/default.nix +++ b/pkgs/development/cuda-modules/nccl/default.nix @@ -100,6 +100,9 @@ backendStdenv.mkDerivation ( homepage = "https://developer.nvidia.com/nccl"; license = licenses.bsd3; platforms = platforms.linux; + # NCCL is not supported on Jetson, because it does not use NVLink or PCI-e for inter-GPU communication. + # https://forums.developer.nvidia.com/t/can-jetson-orin-support-nccl/232845/9 + badPlatforms = lib.optionals cudaFlags.isJetsonBuild [ "aarch64-linux" ]; maintainers = with maintainers; [ diff --git a/pkgs/development/cuda-modules/tensorrt/fixup.nix b/pkgs/development/cuda-modules/tensorrt/fixup.nix index 43a7dfb81784..51ca3d652bd1 100644 --- a/pkgs/development/cuda-modules/tensorrt/fixup.nix +++ b/pkgs/development/cuda-modules/tensorrt/fixup.nix @@ -11,18 +11,17 @@ }: let inherit (lib) + attrsets maintainers meta strings versions ; - targetArch = - if hostPlatform.isx86_64 then - "x86_64-linux-gnu" - else if hostPlatform.isAarch64 then - "aarch64-linux-gnu" - else - "unsupported"; + # targetArch :: String + targetArch = attrsets.attrByPath [ hostPlatform.system ] "unsupported" { + x86_64-linux = "x86_64-linux-gnu"; + aarch64-linux = "aarch64-linux-gnu"; + }; in finalAttrs: prevAttrs: { # Useful for inspecting why something went wrong. @@ -69,7 +68,7 @@ finalAttrs: prevAttrs: { preInstall = (prevAttrs.preInstall or "") - + '' + + strings.optionalString (targetArch != "unsupported") '' # Replace symlinks to bin and lib with the actual directories from targets. for dir in bin lib; do rm "$dir" diff --git a/pkgs/development/cuda-modules/tensorrt/shims.nix b/pkgs/development/cuda-modules/tensorrt/shims.nix index 8be3e7988bb3..12465434ec85 100644 --- a/pkgs/development/cuda-modules/tensorrt/shims.nix +++ b/pkgs/development/cuda-modules/tensorrt/shims.nix @@ -1,13 +1,21 @@ # Shims to mimic the shape of ../modules/generic/manifests/{feature,redistrib}/release.nix -{package, redistArch}: { - featureRelease.${redistArch}.outputs = { - bin = true; - lib = true; - static = true; - dev = true; - sample = true; - python = true; + lib, + package, + # redistArch :: String + # String is `"unsupported"` if the given architecture is unsupported. + redistArch, +}: +{ + featureRelease = lib.optionalAttrs (redistArch != "unsupported") { + ${redistArch}.outputs = { + bin = true; + lib = true; + static = true; + dev = true; + sample = true; + python = true; + }; }; redistribRelease = { name = "TensorRT: a high-performance deep learning interface"; diff --git a/pkgs/development/libraries/science/math/magma/generic.nix b/pkgs/development/libraries/science/math/magma/generic.nix index 1aaab46e1d1d..b27b42bf3ae8 100644 --- a/pkgs/development/libraries/science/math/magma/generic.nix +++ b/pkgs/development/libraries/science/math/magma/generic.nix @@ -159,7 +159,7 @@ stdenv.mkDerivation { description = "Matrix Algebra on GPU and Multicore Architectures"; license = licenses.bsd3; homepage = "http://icl.cs.utk.edu/magma/index.html"; - platforms = platforms.unix; + platforms = platforms.linux; maintainers = with maintainers; [ connorbaker ]; # Cf. https://bitbucket.org/icl/magma/src/fcfe5aa61c1a4c664b36a73ebabbdbab82765e9f/CMakeLists.txt#lines-20 diff --git a/pkgs/development/libraries/xgboost/default.nix b/pkgs/development/libraries/xgboost/default.nix index 2a44ffc44382..0af51a40dfb1 100644 --- a/pkgs/development/libraries/xgboost/default.nix +++ b/pkgs/development/libraries/xgboost/default.nix @@ -14,7 +14,7 @@ , rPackages }@inputs: -assert ncclSupport -> cudaSupport; +assert ncclSupport -> (cudaSupport && !cudaPackages.nccl.meta.unsupported); # Disable regular tests when building the R package # because 1) the R package runs its own tests and # 2) the R package creates a different binary shared diff --git a/pkgs/development/python-modules/jaxlib/default.nix b/pkgs/development/python-modules/jaxlib/default.nix index 27b9e61fbc82..d8dc4d67a594 100644 --- a/pkgs/development/python-modules/jaxlib/default.nix +++ b/pkgs/development/python-modules/jaxlib/default.nix @@ -64,7 +64,8 @@ let # aarch64-darwin is broken because of https://github.com/bazelbuild/rules_cc/pull/136 # however even with that fix applied, it doesn't work for everyone: # https://github.com/NixOS/nixpkgs/pull/184395#issuecomment-1207287129 - broken = stdenv.isDarwin; + # NOTE: We always build with NCCL; if it is unsupported, then our build is broken. + broken = stdenv.isDarwin || nccl.meta.unsupported; }; cudatoolkit_joined = symlinkJoin { diff --git a/pkgs/development/python-modules/torch/default.nix b/pkgs/development/python-modules/torch/default.nix index 8fb227cbd36b..802d1a920141 100644 --- a/pkgs/development/python-modules/torch/default.nix +++ b/pkgs/development/python-modules/torch/default.nix @@ -7,7 +7,8 @@ magma, magma-hip, magma-cuda-static, - useSystemNccl ? true, + # Use the system NCCL as long as it is supported. + useSystemNccl ? !cudaPackages.nccl.meta.unsupported, MPISupport ? false, mpi, buildDocs ? false, @@ -57,6 +58,7 @@ let inherit (lib) attrsets lists strings trivial; inherit (cudaPackages) cudaFlags cudnn nccl; + ncclSupported = cudaSupport && !cudaPackages.nccl.meta.unsupported; setBool = v: if v then "1" else "0"; @@ -121,6 +123,7 @@ let "Unsupported CUDA version" = cudaSupport && !(builtins.elem cudaPackages.cudaMajorVersion [ "11" "12" ]); "MPI cudatoolkit does not match cudaPackages.cudatoolkit" = MPISupport && cudaSupport && (mpi.cudatoolkit != cudaPackages.cudatoolkit); "Magma cudaPackages does not match cudaPackages" = cudaSupport && (effectiveMagma.cudaPackages != cudaPackages); + "Requested system NCCL, but cudaPackages.nccl is not supported" = useSystemNccl && !ncclSupported; }; in buildPythonPackage rec { pname = "torch"; @@ -273,9 +276,9 @@ in buildPythonPackage rec { PYTORCH_BUILD_VERSION = version; PYTORCH_BUILD_NUMBER = 0; - USE_NCCL = setBool (cudaSupport && cudaPackages ? nccl); - USE_SYSTEM_NCCL = setBool useSystemNccl; # don't build pytorch's third_party NCCL - USE_STATIC_NCCL = setBool useSystemNccl; + USE_NCCL = setBool (cudaSupport && ncclSupported); + USE_SYSTEM_NCCL = setBool (cudaSupport && useSystemNccl); # don't build pytorch's third_party NCCL + USE_STATIC_NCCL = setBool (cudaSupport && useSystemNccl); # Suppress a weird warning in mkl-dnn, part of ideep in pytorch # (upstream seems to have fixed this in the wrong place?) @@ -363,7 +366,7 @@ in buildPythonPackage rec { ] ++ lists.optionals (cudaPackages ? cudnn) [ cudnn.dev cudnn.lib - ] ++ lists.optionals (useSystemNccl && cudaPackages ? nccl) [ + ] ++ lists.optionals (useSystemNccl && ncclSupported) [ # Some platforms do not support NCCL (i.e., Jetson) nccl.dev # Provides nccl.h AND a static copy of NCCL! ] ++ lists.optionals (strings.versionOlder cudaVersion "11.8") [ diff --git a/pkgs/top-level/cuda-packages.nix b/pkgs/top-level/cuda-packages.nix index f997963ff468..f20a36152203 100644 --- a/pkgs/top-level/cuda-packages.nix +++ b/pkgs/top-level/cuda-packages.nix @@ -73,10 +73,6 @@ let # Loose packages cudatoolkit = final.callPackage ../development/cuda-modules/cudatoolkit {}; saxpy = final.callPackage ../development/cuda-modules/saxpy {}; - } - # NCCL is not supported on Jetson, because it does not use NVLink or PCI-e for inter-GPU communication. - # https://forums.developer.nvidia.com/t/can-jetson-orin-support-nccl/232845/9 - // attrsets.optionalAttrs (!flags.isJetsonBuild) { nccl = final.callPackage ../development/cuda-modules/nccl {}; nccl-tests = final.callPackage ../development/cuda-modules/nccl-tests {}; } From 5e472d946836bb1be3e2ba30e01d746d5b597876 Mon Sep 17 00:00:00 2001 From: Connor Baker Date: Thu, 4 Jan 2024 13:48:10 +0000 Subject: [PATCH 08/32] cudaPackages: unsupported platform should not set broken to true --- .../cuda-modules/generic-builders/manifest.nix | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/pkgs/development/cuda-modules/generic-builders/manifest.nix b/pkgs/development/cuda-modules/generic-builders/manifest.nix index 64204346791a..f77a1a6385a9 100644 --- a/pkgs/development/cuda-modules/generic-builders/manifest.nix +++ b/pkgs/development/cuda-modules/generic-builders/manifest.nix @@ -127,13 +127,10 @@ backendStdenv.mkDerivation ( # Useful for introspecting why something went wrong. # Maps descriptions of why the derivation would be marked broken to # booleans indicating whether that description is true. + # NOTE: This should not include reasons relating to the architecture, as those are handled by + # the `badPlatforms` attribute. # brokenConditions :: AttrSet Bool - brokenConditions = { - # Using an unrecognized redistArch - "Unrecognized NixOS platform ${hostPlatform.system}" = redistArch == "unsupported"; - # Trying to build for a platform that doesn't have a redistributable - "Unsupported NixOS platform (or configuration) ${hostPlatform.system}" = finalAttrs.src == null; - }; + brokenConditions = { }; # src :: Optional Derivation src = trivial.pipe redistArch [ From 5c260fa5321120f660578674c6d41f54b4290f21 Mon Sep 17 00:00:00 2001 From: Connor Baker Date: Tue, 9 Jan 2024 15:33:13 +0000 Subject: [PATCH 09/32] cudaPackages: set badPlatforms when cudaSupport is false --- .../cuda-modules/cuda/overrides.nix | 2 +- .../generic-builders/manifest.nix | 26 ++++++++++++++----- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/pkgs/development/cuda-modules/cuda/overrides.nix b/pkgs/development/cuda-modules/cuda/overrides.nix index d92e07bb1b0b..e40d58736e8b 100644 --- a/pkgs/development/cuda-modules/cuda/overrides.nix +++ b/pkgs/development/cuda-modules/cuda/overrides.nix @@ -72,7 +72,7 @@ attrsets.filterAttrs (attr: _: (builtins.hasAttr attr prev)) { env.autoPatchelfIgnoreMissingDeps = prevAttrs.env.autoPatchelfIgnoreMissingDeps + " libnvrm_gpu.so libnvrm_mem.so libnvdla_runtime.so"; # `cuda_compat` only works on aarch64-linux, and only when building for Jetson devices. - brokenConditions = prevAttrs.brokenConditions // { + badPlatformsConditions = prevAttrs.badPlatformsConditions // { "Trying to use cuda_compat on aarch64-linux targeting non-Jetson devices" = !final.flags.isJetsonBuild; }; diff --git a/pkgs/development/cuda-modules/generic-builders/manifest.nix b/pkgs/development/cuda-modules/generic-builders/manifest.nix index f77a1a6385a9..dcc7c91d1e28 100644 --- a/pkgs/development/cuda-modules/generic-builders/manifest.nix +++ b/pkgs/development/cuda-modules/generic-builders/manifest.nix @@ -4,6 +4,7 @@ autoAddCudaCompatRunpathHook, autoPatchelfHook, backendStdenv, + config, fetchurl, lib, lndir, @@ -124,14 +125,22 @@ backendStdenv.mkDerivation ( python = ["**/*.whl"]; }; - # Useful for introspecting why something went wrong. - # Maps descriptions of why the derivation would be marked broken to - # booleans indicating whether that description is true. - # NOTE: This should not include reasons relating to the architecture, as those are handled by - # the `badPlatforms` attribute. + # Useful for introspecting why something went wrong. Maps descriptions of why the derivation would be marked as + # broken on have badPlatforms include the current platform. + # brokenConditions :: AttrSet Bool + # Sets `meta.broken = true` if any of the conditions are true. + # Example: Broken on a specific version of CUDA or when a dependency has a specific version. brokenConditions = { }; + # badPlatformsConditions :: AttrSet Bool + # Sets `meta.badPlatforms = meta.platforms` if any of the conditions are true. + # Example: Broken on a specific architecture or when cudaSupport is false (building with CUDA essentially targets) + # a platform which NixOS doesn't have a notion of, otherwise we would specify the platform directly. + badPlatformsConditions = { + "CUDA support is disabled" = !config.cudaSupport; + }; + # src :: Optional Derivation src = trivial.pipe redistArch [ # If redistArch doesn't exist in redistribRelease, return null. @@ -303,13 +312,18 @@ backendStdenv.mkDerivation ( meta = { description = "${redistribRelease.name}. By downloading and using the packages you accept the terms and conditions of the ${finalAttrs.meta.license.shortName}"; sourceProvenance = [sourceTypes.binaryNativeCode]; + broken = lists.any trivial.id (attrsets.attrValues finalAttrs.brokenConditions); platforms = trivial.pipe supportedRedistArchs [ # Map each redist arch to the equivalent nix system or null if there is no equivalent. (builtins.map flags.getNixSystem) # Filter out unsupported systems (builtins.filter (nixSystem: !(strings.hasPrefix "unsupported-" nixSystem))) ]; - broken = lists.any trivial.id (attrsets.attrValues finalAttrs.brokenConditions); + badPlatforms = + let + isBadPlatform = lists.any trivial.id (attrsets.attrValues finalAttrs.badPlatformsConditions); + in + lists.optionals isBadPlatform finalAttrs.meta.platforms; license = licenses.unfree; maintainers = teams.cuda.members; # Force the use of the default, fat output by default (even though `dev` exists, which From 39cab2b768ef7a4b692f2d1b1516a7d44957e1c5 Mon Sep 17 00:00:00 2001 From: Connor Baker Date: Tue, 9 Jan 2024 22:31:43 +0000 Subject: [PATCH 10/32] python3Packages.torch: only build with NCCL when targeting CUDA on a supported platform --- .../development/python-modules/torch/default.nix | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pkgs/development/python-modules/torch/default.nix b/pkgs/development/python-modules/torch/default.nix index 802d1a920141..8a499d763a4a 100644 --- a/pkgs/development/python-modules/torch/default.nix +++ b/pkgs/development/python-modules/torch/default.nix @@ -7,8 +7,8 @@ magma, magma-hip, magma-cuda-static, - # Use the system NCCL as long as it is supported. - useSystemNccl ? !cudaPackages.nccl.meta.unsupported, + # Use the system NCCL as long as we're targeting CUDA on a supported platform. + useSystemNccl ? (cudaSupport && !cudaPackages.nccl.meta.unsupported), MPISupport ? false, mpi, buildDocs ? false, @@ -58,7 +58,6 @@ let inherit (lib) attrsets lists strings trivial; inherit (cudaPackages) cudaFlags cudnn nccl; - ncclSupported = cudaSupport && !cudaPackages.nccl.meta.unsupported; setBool = v: if v then "1" else "0"; @@ -123,7 +122,6 @@ let "Unsupported CUDA version" = cudaSupport && !(builtins.elem cudaPackages.cudaMajorVersion [ "11" "12" ]); "MPI cudatoolkit does not match cudaPackages.cudatoolkit" = MPISupport && cudaSupport && (mpi.cudatoolkit != cudaPackages.cudatoolkit); "Magma cudaPackages does not match cudaPackages" = cudaSupport && (effectiveMagma.cudaPackages != cudaPackages); - "Requested system NCCL, but cudaPackages.nccl is not supported" = useSystemNccl && !ncclSupported; }; in buildPythonPackage rec { pname = "torch"; @@ -276,9 +274,11 @@ in buildPythonPackage rec { PYTORCH_BUILD_VERSION = version; PYTORCH_BUILD_NUMBER = 0; - USE_NCCL = setBool (cudaSupport && ncclSupported); - USE_SYSTEM_NCCL = setBool (cudaSupport && useSystemNccl); # don't build pytorch's third_party NCCL - USE_STATIC_NCCL = setBool (cudaSupport && useSystemNccl); + # In-tree builds of NCCL are not supported. + # Use NCCL when cudaSupport is enabled and nccl is available. + USE_NCCL = setBool useSystemNccl; + USE_SYSTEM_NCCL = USE_NCCL; + USE_STATIC_NCCL = USE_NCCL; # Suppress a weird warning in mkl-dnn, part of ideep in pytorch # (upstream seems to have fixed this in the wrong place?) @@ -366,7 +366,7 @@ in buildPythonPackage rec { ] ++ lists.optionals (cudaPackages ? cudnn) [ cudnn.dev cudnn.lib - ] ++ lists.optionals (useSystemNccl && ncclSupported) [ + ] ++ lists.optionals useSystemNccl [ # Some platforms do not support NCCL (i.e., Jetson) nccl.dev # Provides nccl.h AND a static copy of NCCL! ] ++ lists.optionals (strings.versionOlder cudaVersion "11.8") [ From b2f97e14aee25445d324a53d3374cb3547242ba7 Mon Sep 17 00:00:00 2001 From: Connor Baker Date: Tue, 9 Jan 2024 23:02:00 +0000 Subject: [PATCH 11/32] cudaPackages: default badPlatformsConditions to empty --- .../cuda-modules/generic-builders/manifest.nix | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pkgs/development/cuda-modules/generic-builders/manifest.nix b/pkgs/development/cuda-modules/generic-builders/manifest.nix index dcc7c91d1e28..a823bb7d9ac7 100644 --- a/pkgs/development/cuda-modules/generic-builders/manifest.nix +++ b/pkgs/development/cuda-modules/generic-builders/manifest.nix @@ -4,7 +4,6 @@ autoAddCudaCompatRunpathHook, autoPatchelfHook, backendStdenv, - config, fetchurl, lib, lndir, @@ -135,11 +134,8 @@ backendStdenv.mkDerivation ( # badPlatformsConditions :: AttrSet Bool # Sets `meta.badPlatforms = meta.platforms` if any of the conditions are true. - # Example: Broken on a specific architecture or when cudaSupport is false (building with CUDA essentially targets) - # a platform which NixOS doesn't have a notion of, otherwise we would specify the platform directly. - badPlatformsConditions = { - "CUDA support is disabled" = !config.cudaSupport; - }; + # Example: Broken on a specific architecture when some condition is met (like targeting Jetson). + badPlatformsConditions = { }; # src :: Optional Derivation src = trivial.pipe redistArch [ From e6fb2723aae0c4f08c113883142ef6692fa388e0 Mon Sep 17 00:00:00 2001 From: TomaSajt <62384384+TomaSajt@users.noreply.github.com> Date: Fri, 10 Nov 2023 23:32:13 +0100 Subject: [PATCH 12/32] rPackages.multibridge: fix build --- pkgs/development/r-modules/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/r-modules/default.nix b/pkgs/development/r-modules/default.nix index a7489afd30a0..0f766eac54ec 100644 --- a/pkgs/development/r-modules/default.nix +++ b/pkgs/development/r-modules/default.nix @@ -618,7 +618,7 @@ let LCMCR = [ pkgs.gsl ]; BNSP = [ pkgs.gsl ]; scModels = [ pkgs.mpfr.dev ]; - multibridge = [ pkgs.mpfr.dev ]; + multibridge = with pkgs; [ pkg-config mpfr.dev ]; RcppCWB = with pkgs; [ pcre.dev glib.dev ]; redux = [ pkgs.hiredis ]; RmecabKo = [ pkgs.mecab ]; From f4474ec730cfc8d84aa3cb55bcbe357b912c1b6c Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Sat, 6 Jan 2024 23:12:29 +0000 Subject: [PATCH 13/32] cudaPackages.saxpy: 1/3 the runtime closure (cherry picked from commit 3e003a17bafb8ad2c9026843c241412e2d61a541) --- pkgs/development/cuda-modules/saxpy/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/development/cuda-modules/saxpy/default.nix b/pkgs/development/cuda-modules/saxpy/default.nix index 73e17b28757b..9c6692cb0b31 100644 --- a/pkgs/development/cuda-modules/saxpy/default.nix +++ b/pkgs/development/cuda-modules/saxpy/default.nix @@ -36,7 +36,9 @@ backendStdenv.mkDerivation { buildInputs = lib.optionals (lib.versionOlder cudaVersion "11.4") [cudatoolkit] ++ lib.optionals (lib.versionAtLeast cudaVersion "11.4") [ - libcublas + libcublas.dev + libcublas.lib + libcublas.static cuda_cudart ] ++ lib.optionals (lib.versionAtLeast cudaVersion "12.0") [cuda_cccl]; From c76883f955ebf8b6a6a8194febfbcc2f453ac819 Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Sat, 6 Jan 2024 21:08:15 +0000 Subject: [PATCH 14/32] apptainer: allow --nvccli with read-only images (cherry picked from commit 07305dff4f2de16df1532e846d1365b3660146ac) --- pkgs/applications/virtualization/singularity/generic.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/applications/virtualization/singularity/generic.nix b/pkgs/applications/virtualization/singularity/generic.nix index 9f17dc8eb03d..ab789de0221d 100644 --- a/pkgs/applications/virtualization/singularity/generic.nix +++ b/pkgs/applications/virtualization/singularity/generic.nix @@ -175,11 +175,18 @@ in if [[ ! -e .git || ! -e VERSION ]]; then echo "${version}" > VERSION fi + # Patch shebangs for script run during build patchShebangs --build "$configureScript" makeit e2e scripts mlocal/scripts + # Patching the hard-coded defaultPath by prefixing the packages in defaultPathInputs substituteInPlace cmd/internal/cli/actions.go \ --replace "defaultPath = \"${defaultPathOriginal}\"" "defaultPath = \"''${defaultPathInputs// /\/bin:}''${defaultPathInputs:+/bin:}${defaultPathOriginal}\"" + + substituteInPlace internal/pkg/util/gpu/nvidia.go \ + --replace \ + 'return fmt.Errorf("/usr/bin not writable in the container")' \ + "" ''; postConfigure = '' From 2b3eaf55afc0e2a77677e3b1522879d7a5361640 Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Wed, 3 Jan 2024 23:53:51 +0000 Subject: [PATCH 15/32] nvidia-docker: unbreak the runc symlink (cherry picked from commit 1e1eb8ba6ee7e3428599a27b1b81e2e1be41b4fa) --- .../virtualization/nvidia-container-toolkit/default.nix | 8 ++++++++ pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/virtualization/nvidia-container-toolkit/default.nix b/pkgs/applications/virtualization/nvidia-container-toolkit/default.nix index a174c3031227..71fc18f0b327 100644 --- a/pkgs/applications/virtualization/nvidia-container-toolkit/default.nix +++ b/pkgs/applications/virtualization/nvidia-container-toolkit/default.nix @@ -47,6 +47,14 @@ buildGoModule rec { nativeBuildInputs = [ makeWrapper ]; + preConfigure = '' + # Ensure the runc symlink isn't broken: + if ! readlink --quiet --canonicalize-existing "${isolatedContainerRuntimePath}/runc" ; then + echo "${isolatedContainerRuntimePath}/runc: broken symlink" >&2 + exit 1 + fi + ''; + checkFlags = let skippedTests = [ diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ace5c084e77f..c3cd76e3afd9 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -24197,7 +24197,7 @@ with pkgs; nvidia-docker = mkNvidiaContainerPkg { name = "nvidia-docker"; - containerRuntimePath = "${docker}/libexec/docker/runc"; + containerRuntimePath = "${docker}/libexec/docker/docker"; configTemplate = ../applications/virtualization/nvidia-docker/config.toml; additionalPaths = [ (callPackage ../applications/virtualization/nvidia-docker { }) ]; }; From 88f438fc5f5d1194479b6bf52dd48c8ec1810464 Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Fri, 5 Jan 2024 23:31:22 +0000 Subject: [PATCH 16/32] libnvidia-container: set mainProgram (cherry picked from commit 42ed2f841a08e8b35492a3ffd7b38e2863e5c957) --- pkgs/applications/virtualization/libnvidia-container/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/applications/virtualization/libnvidia-container/default.nix b/pkgs/applications/virtualization/libnvidia-container/default.nix index 622ba090e0ee..b462b24711de 100644 --- a/pkgs/applications/virtualization/libnvidia-container/default.nix +++ b/pkgs/applications/virtualization/libnvidia-container/default.nix @@ -116,6 +116,7 @@ stdenv.mkDerivation rec { description = "NVIDIA container runtime library"; license = licenses.asl20; platforms = platforms.linux; + mainProgram = "nvidia-container-cli"; maintainers = with maintainers; [ cpcloud ]; }; } From 336e2218e04f86e5593cf91ed614fad6cd63698b Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Wed, 3 Jan 2024 22:55:43 +0000 Subject: [PATCH 17/32] nvidiaCtkPackages: init ...this way we expose and allow overriding the symlinkJoin constituent components (cherry picked from commit 1142433e70881b546e2ca5db87792f08829f02ce) --- .../nvidia-container-toolkit/packages.nix | 40 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 32 ++++----------- 2 files changed, 47 insertions(+), 25 deletions(-) create mode 100644 pkgs/applications/virtualization/nvidia-container-toolkit/packages.nix diff --git a/pkgs/applications/virtualization/nvidia-container-toolkit/packages.nix b/pkgs/applications/virtualization/nvidia-container-toolkit/packages.nix new file mode 100644 index 000000000000..ac7da5bd33ea --- /dev/null +++ b/pkgs/applications/virtualization/nvidia-container-toolkit/packages.nix @@ -0,0 +1,40 @@ +{ + lib, + newScope, + docker, + libnvidia-container, + runc, + symlinkJoin, +}: + +lib.makeScope newScope ( + self: { + + nvidia-container-toolkit-docker = self.callPackage ./. { + containerRuntimePath = "${docker}/libexec/docker/docker"; + configTemplate = ../nvidia-docker/config.toml; + }; + nvidia-container-toolkit-podman = self.nvidia-container-toolkit-docker.override { + containerRuntimePath = lib.getExe runc; + configTemplate = ../nvidia-podman/config.toml; + }; + + nvidia-docker = symlinkJoin { + name = "nvidia-docker"; + paths = [ + libnvidia-container + self.nvidia-docker-unwrapped + self.nvidia-container-toolkit-docker + ]; + }; + nvidia-docker-unwrapped = self.callPackage ../nvidia-docker { }; + + nvidia-podman = symlinkJoin { + name = "nvidia-podman"; + paths = [ + libnvidia-container + self.nvidia-container-toolkit-podman + ]; + }; + } +) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c3cd76e3afd9..db8eac8a101c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -24182,31 +24182,13 @@ with pkgs; nv-codec-headers-11 = callPackage ../development/libraries/nv-codec-headers/11_x.nix { }; nv-codec-headers-12 = callPackage ../development/libraries/nv-codec-headers/12_x.nix { }; - mkNvidiaContainerPkg = { name, containerRuntimePath, configTemplate, additionalPaths ? [] }: - let - nvidia-container-toolkit = callPackage ../applications/virtualization/nvidia-container-toolkit { - inherit containerRuntimePath configTemplate; - }; - in symlinkJoin { - inherit name; - paths = [ - libnvidia-container - nvidia-container-toolkit - ] ++ additionalPaths; - }; - - nvidia-docker = mkNvidiaContainerPkg { - name = "nvidia-docker"; - containerRuntimePath = "${docker}/libexec/docker/docker"; - configTemplate = ../applications/virtualization/nvidia-docker/config.toml; - additionalPaths = [ (callPackage ../applications/virtualization/nvidia-docker { }) ]; - }; - - nvidia-podman = mkNvidiaContainerPkg { - name = "nvidia-podman"; - containerRuntimePath = "${runc}/bin/runc"; - configTemplate = ../applications/virtualization/nvidia-podman/config.toml; - }; + nvidiaCtkPackages = + callPackage ../applications/virtualization/nvidia-container-toolkit/packages.nix + { }; + inherit (nvidiaCtkPackages) + nvidia-docker + nvidia-podman + ; nvidia-vaapi-driver = lib.hiPrio (callPackage ../development/libraries/nvidia-vaapi-driver { }); From 5e7c297ba25bdaaf2806a6dfa5f436f2a3afb7d7 Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Wed, 10 Jan 2024 18:43:07 +0000 Subject: [PATCH 18/32] nvidia-docker: support config.toml as an attrset argument --- .../nvidia-container-toolkit/default.nix | 10 ++++- .../nvidia-container-toolkit/packages.nix | 41 ++++++++++++++++++- .../virtualization/nvidia-docker/config.toml | 13 ------ .../virtualization/nvidia-podman/config.toml | 13 ------ 4 files changed, 48 insertions(+), 29 deletions(-) delete mode 100644 pkgs/applications/virtualization/nvidia-docker/config.toml delete mode 100644 pkgs/applications/virtualization/nvidia-podman/config.toml diff --git a/pkgs/applications/virtualization/nvidia-container-toolkit/default.nix b/pkgs/applications/virtualization/nvidia-container-toolkit/default.nix index 71fc18f0b327..7d0ecfab53e7 100644 --- a/pkgs/applications/virtualization/nvidia-container-toolkit/default.nix +++ b/pkgs/applications/virtualization/nvidia-container-toolkit/default.nix @@ -5,10 +5,16 @@ , buildGoModule , linkFarm , writeShellScript +, formats , containerRuntimePath , configTemplate +, configTemplatePath ? null , libnvidia-container }: + +assert configTemplate != null -> (lib.isAttrs configTemplate && configTemplatePath == null); +assert configTemplatePath != null -> (lib.isStringLike configTemplatePath && configTemplate == null); + let isolatedContainerRuntimePath = linkFarm "isolated_container_runtime_path" [ { @@ -23,6 +29,8 @@ let echo >&2 "$(tput setaf 3)warning: \$XDG_CONFIG_HOME=$XDG_CONFIG_HOME$(tput sgr 0)" fi ''; + + configToml = if configTemplatePath != null then configTemplatePath else (formats.toml { }).generate "config.toml" configTemplate; in buildGoModule rec { pname = "container-toolkit/container-toolkit"; @@ -82,7 +90,7 @@ buildGoModule rec { --prefix PATH : ${isolatedContainerRuntimePath}:${libnvidia-container}/bin \ --set-default XDG_CONFIG_HOME $out/etc - cp ${configTemplate} $out/etc/nvidia-container-runtime/config.toml + cp ${configToml} $out/etc/nvidia-container-runtime/config.toml substituteInPlace $out/etc/nvidia-container-runtime/config.toml \ --subst-var-by glibcbin ${lib.getBin glibc} diff --git a/pkgs/applications/virtualization/nvidia-container-toolkit/packages.nix b/pkgs/applications/virtualization/nvidia-container-toolkit/packages.nix index ac7da5bd33ea..2d1058a00211 100644 --- a/pkgs/applications/virtualization/nvidia-container-toolkit/packages.nix +++ b/pkgs/applications/virtualization/nvidia-container-toolkit/packages.nix @@ -7,16 +7,53 @@ symlinkJoin, }: +# Note this scope isn't recursed into, at the time of writing. lib.makeScope newScope ( self: { + # The config is only exposed as an attrset so that the user may reach the + # deafult values, for inspectability purposes. + dockerConfig = { + disable-require = false; + #swarm-resource = "DOCKER_RESOURCE_GPU" + + nvidia-container-cli = { + #root = "/run/nvidia/driver"; + #path = "/usr/bin/nvidia-container-cli"; + environment = [ ]; + #debug = "/var/log/nvidia-container-runtime-hook.log"; + ldcache = "/tmp/ld.so.cache"; + load-kmods = true; + #no-cgroups = false; + #user = "root:video"; + ldconfig = "@@glibcbin@/bin/ldconfig"; + }; + }; nvidia-container-toolkit-docker = self.callPackage ./. { containerRuntimePath = "${docker}/libexec/docker/docker"; - configTemplate = ../nvidia-docker/config.toml; + configTemplate = self.dockerConfig; + }; + + podmanConfig = { + disable-require = true; + #swarm-resource = "DOCKER_RESOURCE_GPU"; + + nvidia-container-cli = { + #root = "/run/nvidia/driver"; + #path = "/usr/bin/nvidia-container-cli"; + environment = [ ]; + #debug = "/var/log/nvidia-container-runtime-hook.log"; + ldcache = "/tmp/ld.so.cache"; + load-kmods = true; + no-cgroups = true; + #user = "root:video"; + ldconfig = "@@glibcbin@/bin/ldconfig"; + }; }; nvidia-container-toolkit-podman = self.nvidia-container-toolkit-docker.override { containerRuntimePath = lib.getExe runc; - configTemplate = ../nvidia-podman/config.toml; + + configTemplate = self.podmanConfig; }; nvidia-docker = symlinkJoin { diff --git a/pkgs/applications/virtualization/nvidia-docker/config.toml b/pkgs/applications/virtualization/nvidia-docker/config.toml deleted file mode 100644 index bbd166995f36..000000000000 --- a/pkgs/applications/virtualization/nvidia-docker/config.toml +++ /dev/null @@ -1,13 +0,0 @@ -disable-require = false -#swarm-resource = "DOCKER_RESOURCE_GPU" - -[nvidia-container-cli] -#root = "/run/nvidia/driver" -#path = "/usr/bin/nvidia-container-cli" -environment = [] -#debug = "/var/log/nvidia-container-runtime-hook.log" -ldcache = "/tmp/ld.so.cache" -load-kmods = true -#no-cgroups = false -#user = "root:video" -ldconfig = "@@glibcbin@/bin/ldconfig" diff --git a/pkgs/applications/virtualization/nvidia-podman/config.toml b/pkgs/applications/virtualization/nvidia-podman/config.toml deleted file mode 100644 index eb39699b96b3..000000000000 --- a/pkgs/applications/virtualization/nvidia-podman/config.toml +++ /dev/null @@ -1,13 +0,0 @@ -disable-require = true -#swarm-resource = "DOCKER_RESOURCE_GPU" - -[nvidia-container-cli] -#root = "/run/nvidia/driver" -#path = "/usr/bin/nvidia-container-cli" -environment = [] -#debug = "/var/log/nvidia-container-runtime-hook.log" -ldcache = "/tmp/ld.so.cache" -load-kmods = true -no-cgroups = true -#user = "root:video" -ldconfig = "@@glibcbin@/bin/ldconfig" From 4160504219078cd25ab4c6a7785e0a10a57b8500 Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Wed, 10 Jan 2024 18:43:16 +0000 Subject: [PATCH 19/32] nvidia-docker: add missing meta --- .../virtualization/nvidia-container-toolkit/packages.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/applications/virtualization/nvidia-container-toolkit/packages.nix b/pkgs/applications/virtualization/nvidia-container-toolkit/packages.nix index 2d1058a00211..0ce76d5aed31 100644 --- a/pkgs/applications/virtualization/nvidia-container-toolkit/packages.nix +++ b/pkgs/applications/virtualization/nvidia-container-toolkit/packages.nix @@ -63,6 +63,7 @@ lib.makeScope newScope ( self.nvidia-docker-unwrapped self.nvidia-container-toolkit-docker ]; + inherit (self.nvidia-docker-unwrapped) meta; }; nvidia-docker-unwrapped = self.callPackage ../nvidia-docker { }; @@ -72,6 +73,7 @@ lib.makeScope newScope ( libnvidia-container self.nvidia-container-toolkit-podman ]; + inherit (self.nvidia-container-toolkit-podman) meta; }; } ) From 045d203df8d642490af20a6cac8c4219d021e195 Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Fri, 15 Dec 2023 09:20:47 +0100 Subject: [PATCH 20/32] boost184: init at 1.84.0 --- pkgs/development/libraries/boost/1.84.nix | 14 ++++++++++++++ pkgs/development/libraries/boost/default.nix | 1 + pkgs/top-level/all-packages.nix | 1 + 3 files changed, 16 insertions(+) create mode 100644 pkgs/development/libraries/boost/1.84.nix diff --git a/pkgs/development/libraries/boost/1.84.nix b/pkgs/development/libraries/boost/1.84.nix new file mode 100644 index 000000000000..a55f55afaae0 --- /dev/null +++ b/pkgs/development/libraries/boost/1.84.nix @@ -0,0 +1,14 @@ +{ callPackage, fetchurl, fetchpatch, ... } @ args: + +callPackage ./generic.nix (args // rec { + version = "1.84.0"; + + src = fetchurl { + urls = [ + "mirror://sourceforge/boost/boost_${builtins.replaceStrings ["."] ["_"] version}.tar.bz2" + "https://boostorg.jfrog.io/artifactory/main/release/${version}/source/boost_${builtins.replaceStrings ["."] ["_"] version}.tar.bz2" + ]; + # SHA256 from http://www.boost.org/users/history/version_1_84_0.html + sha256 = "cc4b893acf645c9d4b698e9a0f08ca8846aa5d6c68275c14c3e7949c24109454"; + }; +}) diff --git a/pkgs/development/libraries/boost/default.nix b/pkgs/development/libraries/boost/default.nix index 7f6422515ace..6434c6d19699 100644 --- a/pkgs/development/libraries/boost/default.nix +++ b/pkgs/development/libraries/boost/default.nix @@ -24,4 +24,5 @@ in { boost181 = makeBoost ./1.81.nix; boost182 = makeBoost ./1.82.nix; boost183 = makeBoost ./1.83.nix; + boost184 = makeBoost ./1.84.nix; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 98b8e880a79c..50ac957c9f28 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -20698,6 +20698,7 @@ with pkgs; boost181 boost182 boost183 + boost184 ; boost = boost181; From 0f67ac5c4fd74b71cfde074e1c8d79b6074d262f Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Fri, 8 Dec 2023 10:42:27 +0100 Subject: [PATCH 21/32] graplang: init at 1.46 This is an implementation of Grap the language for describing graphs as first implemented by Brian Kernighan and Jon Bentley at Bell Labs. Co-authored-by: Anderson Torres Co-authored-by: Peder Bergebakken Sundt --- pkgs/by-name/gr/graplang/package.nix | 35 ++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 pkgs/by-name/gr/graplang/package.nix diff --git a/pkgs/by-name/gr/graplang/package.nix b/pkgs/by-name/gr/graplang/package.nix new file mode 100644 index 000000000000..aa0a74da382f --- /dev/null +++ b/pkgs/by-name/gr/graplang/package.nix @@ -0,0 +1,35 @@ +{ lib +, stdenv +, fetchurl +, flex +, bison +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "graplang"; + version = "1.46"; + + outputs = [ "out" "man" ]; + + src = fetchurl { + url = "https://www.lunabase.org/~faber/Vault/software/grap/grap-${finalAttrs.version}.tar.gz"; + hash = "sha512-7n+jLANU/x+wGrpjwYAnf45fQ5M91SwraiCbvUKe6XhWtilhGoT2yTlLkPlTihETTkizLyssW5gj5gbwNHaooA=="; + }; + + nativeBuildInputs = [ flex bison ]; + + meta = with lib; { + description = "Language for typesetting graphs"; + longDescription = '' + Grap is an Expressive language for describing graphs and incorporating + them in typeset documents. It is implemented as a preprocessor to + Kernigan's pic language for describing languages, so any system that can + use pic can use grap. For sure, TeX and groff can use it. + ''; + homepage = "https://www.lunabase.org/~faber/Vault/software/grap/"; + changelog = "https://github.com/snorerot13/grap/blob/master/CHANGES"; + license = licenses.bsd2; + maintainers = with maintainers; [ afh ]; + mainProgram = "grap"; + }; +}) From 0a35690873467cd4f76733f911853bd3e6e5d377 Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Wed, 10 Jan 2024 20:50:41 +0100 Subject: [PATCH 22/32] gitnuro: update meta.homepage --- pkgs/applications/version-management/gitnuro/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/version-management/gitnuro/default.nix b/pkgs/applications/version-management/gitnuro/default.nix index e265f56aea85..e577cbaa6f61 100644 --- a/pkgs/applications/version-management/gitnuro/default.nix +++ b/pkgs/applications/version-management/gitnuro/default.nix @@ -48,7 +48,7 @@ stdenv.mkDerivation rec { meta = with lib; { description = "A FOSS Git multiplatform client based on Compose and JGit"; - homepage = "https://gitnuro.jetpackduba.com"; + homepage = "https://gitnuro.com/"; license = licenses.gpl3Plus; platforms = platforms.unix; maintainers = with maintainers; [ zendo ]; From 4b7014aa8811e53d8ba1082167125f14b31b7515 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=A9clairevoyant?= <848000+eclairevoyant@users.noreply.github.com> Date: Wed, 10 Jan 2024 15:03:11 -0500 Subject: [PATCH 23/32] nh: add passthru.updateScript --- pkgs/by-name/nh/nh/package.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/by-name/nh/nh/package.nix b/pkgs/by-name/nh/nh/package.nix index c32b16876dd8..0feea409df9d 100644 --- a/pkgs/by-name/nh/nh/package.nix +++ b/pkgs/by-name/nh/nh/package.nix @@ -3,6 +3,7 @@ , installShellFiles , makeWrapper , fetchFromGitHub +, nix-update-script , nvd , use-nom ? true , nix-output-monitor ? null @@ -49,6 +50,8 @@ rustPlatform.buildRustPackage { cargoHash = "sha256-Ul4DM8WmKvKG32zBXzpdzHZknpTQAVvrxFcEd/C1buA="; + passthru.updateScript = nix-update-script { }; + meta = { description = "Yet another nix cli helper"; homepage = "https://github.com/ViperML/nh"; From 1427d969120cf92cf096807f9b364a476e1d8fcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=A9clairevoyant?= <848000+eclairevoyant@users.noreply.github.com> Date: Wed, 10 Jan 2024 15:03:45 -0500 Subject: [PATCH 24/32] nh: 3.4.12 -> 3.5.1 --- pkgs/by-name/nh/nh/package.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/nh/nh/package.nix b/pkgs/by-name/nh/nh/package.nix index 0feea409df9d..fa24e8c38d2f 100644 --- a/pkgs/by-name/nh/nh/package.nix +++ b/pkgs/by-name/nh/nh/package.nix @@ -12,7 +12,7 @@ assert use-nom -> nix-output-monitor != null; let - version = "3.4.12"; + version = "3.5.1"; runtimeDeps = [ nvd ] ++ lib.optionals use-nom [ nix-output-monitor ]; in rustPlatform.buildRustPackage { @@ -23,7 +23,7 @@ rustPlatform.buildRustPackage { owner = "ViperML"; repo = "nh"; rev = "refs/tags/v${version}"; - hash = "sha256-V5TQ/1loQnegDjfLh61DxBWEQZivYEBq2kQpT0fn2cQ="; + hash = "sha256-q13oPB1fl45E+7cbV1P1VQt1GtGBaSbrHPtC0Y7q83c="; }; strictDeps = true; @@ -48,7 +48,7 @@ rustPlatform.buildRustPackage { ${lib.optionalString use-nom "--set-default NH_NOM 1"} ''; - cargoHash = "sha256-Ul4DM8WmKvKG32zBXzpdzHZknpTQAVvrxFcEd/C1buA="; + cargoHash = "sha256-Jy873l3ZRBqljzV/GwLbkk1kpO6zNqeGmuMDSKUqyzM="; passthru.updateScript = nix-update-script { }; From b0324257640d8707993f024ab533aae834bb6d70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=A9clairevoyant?= <848000+eclairevoyant@users.noreply.github.com> Date: Wed, 10 Jan 2024 15:05:01 -0500 Subject: [PATCH 25/32] nh: use makeBinaryWrapper --- pkgs/by-name/nh/nh/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/nh/nh/package.nix b/pkgs/by-name/nh/nh/package.nix index fa24e8c38d2f..db00e4538c27 100644 --- a/pkgs/by-name/nh/nh/package.nix +++ b/pkgs/by-name/nh/nh/package.nix @@ -1,7 +1,7 @@ { lib , rustPlatform , installShellFiles -, makeWrapper +, makeBinaryWrapper , fetchFromGitHub , nix-update-script , nvd @@ -30,7 +30,7 @@ rustPlatform.buildRustPackage { nativeBuildInputs = [ installShellFiles - makeWrapper + makeBinaryWrapper ]; preFixup = '' From 85cd33e31c6f128eeb640892717b574144f882f2 Mon Sep 17 00:00:00 2001 From: Nanotwerp Date: Wed, 10 Jan 2024 15:42:52 -0500 Subject: [PATCH 26/32] sabnzbd: replace par2cmdline with par2cmdline-turbo --- pkgs/servers/sabnzbd/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/servers/sabnzbd/default.nix b/pkgs/servers/sabnzbd/default.nix index 4f34c9f0b73a..43a8ac582125 100644 --- a/pkgs/servers/sabnzbd/default.nix +++ b/pkgs/servers/sabnzbd/default.nix @@ -2,7 +2,7 @@ , coreutils , fetchFromGitHub , python3 -, par2cmdline +, par2cmdline-turbo , unzip , unrar , p7zip From 231aca2b973e4f82703303fb3d4dce692d0aa4ee Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Sat, 6 Jan 2024 22:50:52 +0000 Subject: [PATCH 27/32] apptainer: add a cuda test (cherry picked from commit 0c4fe1f45241fee18ce1a33d2a8a3dfdba611cbb) --- .../virtualization/singularity/generic.nix | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/pkgs/applications/virtualization/singularity/generic.nix b/pkgs/applications/virtualization/singularity/generic.nix index ab789de0221d..6fd2905d9d4e 100644 --- a/pkgs/applications/virtualization/singularity/generic.nix +++ b/pkgs/applications/virtualization/singularity/generic.nix @@ -33,6 +33,7 @@ in , which # Build inputs , bash +, callPackage , conmon , coreutils , cryptsetup @@ -271,5 +272,38 @@ in singularity = finalAttrs.finalPackage; }; }; + gpuChecks = lib.optionalAttrs (projectName == "apptainer") { + # Should be in tests, but Ofborg would skip image-hello-cowsay because + # saxpy is unfree. + image-saxpy = callPackage + ({ singularity-tools, cudaPackages }: + singularity-tools.buildImage { + name = "saxpy"; + contents = [ cudaPackages.saxpy ]; + memSize = 2048; + diskSize = 2048; + singularity = finalAttrs.finalPackage; + }) + { }; + saxpy = + callPackage + ({ runCommand, writeShellScriptBin }: + let + unwrapped = writeShellScriptBin "apptainer-cuda-saxpy" + '' + ${lib.getExe finalAttrs.finalPackage} exec --nv $@ ${finalAttrs.passthru.gpuChecks.image-saxpy} saxpy + ''; + in + runCommand "run-apptainer-cuda-saxpy" + { + requiredSystemFeatures = [ "cuda" ]; + nativeBuildInputs = [ unwrapped ]; + passthru = { inherit unwrapped; }; + } + '' + apptainer-cuda-saxpy + '') + { }; + }; }; }) From 562dd639328c5da2fa5291c0f9d9860adf8f57a4 Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Mon, 8 Jan 2024 17:03:15 +0000 Subject: [PATCH 28/32] apptainer: fix nvliblist.conf-based --nv (cherry picked from commit 680bbed84fd37e5a46330e1c9b63a7a60a9e4933) --- .../0001-ldCache-patch-for-driverLink.patch | 84 +++++++++++++++++++ .../virtualization/singularity/generic.nix | 13 ++- 2 files changed, 95 insertions(+), 2 deletions(-) create mode 100644 pkgs/applications/virtualization/singularity/apptainer/0001-ldCache-patch-for-driverLink.patch diff --git a/pkgs/applications/virtualization/singularity/apptainer/0001-ldCache-patch-for-driverLink.patch b/pkgs/applications/virtualization/singularity/apptainer/0001-ldCache-patch-for-driverLink.patch new file mode 100644 index 000000000000..c931894bc21f --- /dev/null +++ b/pkgs/applications/virtualization/singularity/apptainer/0001-ldCache-patch-for-driverLink.patch @@ -0,0 +1,84 @@ +From 783ec26c0d83013baf04579a6a415d7f8776ac93 Mon Sep 17 00:00:00 2001 +From: Someone Serge +Date: Sun, 7 Jan 2024 11:48:24 +0000 +Subject: [PATCH] ldCache(): patch for @driverLink@ + +--- + internal/pkg/util/paths/resolve.go | 41 +++++++++++++++++++++++++++--- + 1 file changed, 38 insertions(+), 3 deletions(-) + +diff --git a/internal/pkg/util/paths/resolve.go b/internal/pkg/util/paths/resolve.go +index db45d9db1..9d0110b6b 100644 +--- a/internal/pkg/util/paths/resolve.go ++++ b/internal/pkg/util/paths/resolve.go +@@ -14,6 +14,7 @@ import ( + "fmt" + "os" + "os/exec" ++ "path" + "path/filepath" + "regexp" + "strings" +@@ -154,14 +155,49 @@ func Resolve(fileList []string) ([]string, []string, error) { + // lists three variants of libEGL.so.1 that are in different locations, we only + // report the first, highest priority, variant. + func ldCache() (map[string]string, error) { ++ driverDirs := strings.Split("@driverLink@/lib", ":") ++ if machine, err := elfMachine(); err == nil && machine == elf.EM_386 { ++ driverDirs = strings.Split("@driverLink@-32/lib", ":") ++ } ++ ++ soPattern, err := regexp.Compile(`[^\s]+\.so(\.\d+(\.\d+(\.\d+)?)?)?$`) ++ if err != nil { ++ return nil, fmt.Errorf("could not compile ldconfig regexp: %v", err) ++ } ++ ++ ldCache := make(map[string]string) ++ for _, dirPath := range driverDirs { ++ dir, err := os.Open(dirPath) ++ if err != nil { ++ /* Maybe we're not running under NixOS */ ++ continue ++ } ++ files, err := dir.ReadDir(-1) ++ if err != nil { ++ continue ++ } ++ for _, f := range files { ++ if !soPattern.MatchString(f.Name()) { ++ continue ++ } ++ libName := f.Name() ++ libPath := path.Join(dirPath, f.Name()) ++ if _, ok := ldCache[libName]; !ok { ++ ldCache[libName] = libPath ++ } ++ } ++ } ++ + // walk through the ldconfig output and add entries which contain the filenames + // returned by nvidia-container-cli OR the nvliblist.conf file contents + ldconfig, err := bin.FindBin("ldconfig") +- if err != nil { ++ if err != nil && len(ldCache) == 0 { ++ // Note that missing ldconfig is only an "error" as long ++ // as there's no driverLink + return nil, err + } + out, err := exec.Command(ldconfig, "-p").Output() +- if err != nil { ++ if err != nil && len(ldCache) == 0 { + return nil, fmt.Errorf("could not execute ldconfig: %v", err) + } + +@@ -173,7 +209,6 @@ func ldCache() (map[string]string, error) { + } + + // store library name with associated path +- ldCache := make(map[string]string) + for _, match := range r.FindAllSubmatch(out, -1) { + if match != nil { + // libName is the "libnvidia-ml.so.1" (from the above example) +-- +2.42.0 + diff --git a/pkgs/applications/virtualization/singularity/generic.nix b/pkgs/applications/virtualization/singularity/generic.nix index 6fd2905d9d4e..85992e2abce9 100644 --- a/pkgs/applications/virtualization/singularity/generic.nix +++ b/pkgs/applications/virtualization/singularity/generic.nix @@ -27,6 +27,7 @@ in , buildGoModule , runCommandLocal # Native build inputs +, addDriverRunpath , makeWrapper , pkg-config , util-linux @@ -55,6 +56,9 @@ in , hello # Overridable configurations , enableNvidiaContainerCli ? true + # --nvccli currently requires extra privileges: + # https://github.com/apptainer/apptainer/issues/1893#issuecomment-1881240800 +, forceNvcCli ? false # Compile with seccomp support # SingularityCE 3.10.0 and above requires explicit --without-seccomp when libseccomp is not available. , enableSeccomp ? true @@ -66,6 +70,7 @@ in # Whether to compile with SUID support , enableSuid ? false , starterSuidPath ? null +, substituteAll # newuidmapPath and newgidmapPath are to support --fakeroot # where those SUID-ed executables are unavailable from the FHS system PATH. # Path to SUID-ed newuidmap executable @@ -95,6 +100,10 @@ in (buildGoModule { inherit pname version src; + patches = lib.optionals (projectName == "apptainer") [ + (substituteAll { src = ./apptainer/0001-ldCache-patch-for-driverLink.patch; inherit (addDriverRunpath) driverLink; }) + ]; + # Override vendorHash with the output got from # nix-prefetch -E "{ sha256 }: ((import ./. { }).apptainer.override { vendorHash = sha256; }).goModules" # or with `null` when using vendored source tarball. @@ -220,7 +229,7 @@ in wrapProgram "$out/bin/${projectName}" \ --prefix PATH : "''${defaultPathInputs// /\/bin:}''${defaultPathInputs:+/bin:}" # Make changes in the config file - ${lib.optionalString enableNvidiaContainerCli '' + ${lib.optionalString forceNvcCli '' substituteInPlace "$out/etc/${projectName}/${projectName}.conf" \ --replace "use nvidia-container-cli = no" "use nvidia-container-cli = yes" ''} @@ -291,7 +300,7 @@ in let unwrapped = writeShellScriptBin "apptainer-cuda-saxpy" '' - ${lib.getExe finalAttrs.finalPackage} exec --nv $@ ${finalAttrs.passthru.gpuChecks.image-saxpy} saxpy + ${lib.getExe finalAttrs.finalPackage} exec --nv $@ ${finalAttrs.passthru.tests.image-saxpy} saxpy ''; in runCommand "run-apptainer-cuda-saxpy" From 35de6f1c4eb4e983fe39a5407db7c831fea675f7 Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Wed, 3 Jan 2024 22:28:57 +0000 Subject: [PATCH 29/32] nixos/singularity: disable setuid for apptainer (cherry picked from commit 5f4b6ea5dde8b0153f416c78519d877ab1224f91) --- nixos/modules/programs/singularity.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nixos/modules/programs/singularity.nix b/nixos/modules/programs/singularity.nix index 9fd37e1793a7..7f285ab05537 100644 --- a/nixos/modules/programs/singularity.nix +++ b/nixos/modules/programs/singularity.nix @@ -61,7 +61,12 @@ in }; enableSuid = mkOption { type = types.bool; - default = true; + # SingularityCE requires SETUID for most things. Apptainer prefers user + # namespaces, e.g. `apptainer exec --nv` would fail if built + # `--with-suid`: + # > `FATAL: nvidia-container-cli not allowed in setuid mode` + default = cfg.package.projectName != "apptainer"; + defaultText = literalExpression ''config.services.singularity.package.projectName != "apptainer"''; example = false; description = mdDoc '' Whether to enable the SUID support of Singularity/Apptainer. From 95164a1bb0caa6b8cb6a844d514d68df03ad9666 Mon Sep 17 00:00:00 2001 From: Nanotwerp Date: Wed, 10 Jan 2024 17:02:56 -0500 Subject: [PATCH 30/32] sabnzbd: replace par2cmdline with par2cmdline-turbo in bin path --- pkgs/servers/sabnzbd/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/servers/sabnzbd/default.nix b/pkgs/servers/sabnzbd/default.nix index 43a8ac582125..1bbf9c59021d 100644 --- a/pkgs/servers/sabnzbd/default.nix +++ b/pkgs/servers/sabnzbd/default.nix @@ -45,7 +45,7 @@ let tempora zc_lockfile ]); - path = lib.makeBinPath [ coreutils par2cmdline unrar unzip p7zip util-linux ]; + path = lib.makeBinPath [ coreutils par2cmdline-turbo unrar unzip p7zip util-linux ]; in stdenv.mkDerivation rec { version = "4.2.1"; pname = "sabnzbd"; From 190f8cd98b47fc18bff5eb039b8e875092aee712 Mon Sep 17 00:00:00 2001 From: TomaSajt <62384384+TomaSajt@users.noreply.github.com> Date: Thu, 11 Jan 2024 00:45:52 +0100 Subject: [PATCH 31/32] jasp-desktop: init at 0.18.2 --- pkgs/by-name/ja/jasp-desktop/cmake.patch | 46 ++++++++ pkgs/by-name/ja/jasp-desktop/modules.nix | 134 +++++++++++++++++++++++ pkgs/by-name/ja/jasp-desktop/package.nix | 121 ++++++++++++++++++++ 3 files changed, 301 insertions(+) create mode 100644 pkgs/by-name/ja/jasp-desktop/cmake.patch create mode 100644 pkgs/by-name/ja/jasp-desktop/modules.nix create mode 100644 pkgs/by-name/ja/jasp-desktop/package.nix diff --git a/pkgs/by-name/ja/jasp-desktop/cmake.patch b/pkgs/by-name/ja/jasp-desktop/cmake.patch new file mode 100644 index 000000000000..b6de8bc55269 --- /dev/null +++ b/pkgs/by-name/ja/jasp-desktop/cmake.patch @@ -0,0 +1,46 @@ +diff --git a/Tools/CMake/Libraries.cmake b/Tools/CMake/Libraries.cmake +index cc4681a..f484013 100644 +--- a/Tools/CMake/Libraries.cmake ++++ b/Tools/CMake/Libraries.cmake +@@ -67,7 +67,7 @@ if((NOT LibArchive_FOUND) AND (NOT WIN32)) + endif() + endif() + +-set(Boost_USE_STATIC_LIBS ON) ++add_definitions(-DBOOST_LOG_DYN_LINK) + find_package( + Boost 1.78 REQUIRED + COMPONENTS filesystem +@@ -178,10 +178,10 @@ if(LINUX) + set(LIBREADSTAT_INCLUDE_DIRS /app/include) + set(LIBREADSTAT_LIBRARY_DIRS /app/lib) + else() +- set(LIBREADSTAT_INCLUDE_DIRS /usr/local/include /usr/include) ++ set(LIBREADSTAT_INCLUDE_DIRS @readstat@/include /usr/include) + # The last two library paths handle the two most common multiarch cases. + # Other multiarch-compliant paths may come up but should be rare. +- set(LIBREADSTAT_LIBRARY_DIRS /usr/local/lib /usr/lib /usr/lib/x86_64-linux-gnu /usr/lib/aarch64-linux-gnu) ++ set(LIBREADSTAT_LIBRARY_DIRS @readstat@/lib /usr/lib /usr/lib/x86_64-linux-gnu /usr/lib/aarch64-linux-gnu) + endif() + + message(CHECK_START "Looking for libreadstat.so") +diff --git a/Tools/CMake/Programs.cmake b/Tools/CMake/Programs.cmake +index dbd089d..ef6857a 100644 +--- a/Tools/CMake/Programs.cmake ++++ b/Tools/CMake/Programs.cmake +@@ -39,6 +39,7 @@ endif() + + # ------ Linux Tools/Programs + ++#[[ + if(LINUX) + + message(CHECK_START "Looking for 'gfortran'") +@@ -81,6 +82,7 @@ if(LINUX) + endif() + + endif() ++]]# + + # ---------------------- + diff --git a/pkgs/by-name/ja/jasp-desktop/modules.nix b/pkgs/by-name/ja/jasp-desktop/modules.nix new file mode 100644 index 000000000000..1660daa764c1 --- /dev/null +++ b/pkgs/by-name/ja/jasp-desktop/modules.nix @@ -0,0 +1,134 @@ +{ R +, rPackages +, fetchFromGitHub +, jasp-src +, jasp-version +}: + +with rPackages; +let + jaspColumnEncoder-src = fetchFromGitHub { + owner = "jasp-stats"; + repo = "jaspColumnEncoder"; + rev = "c54987bb25de8963866ae69ad3a6ae5a9a9f1240"; + hash = "sha256-aWfRG7DXO1MYFvmMLkX/xtHvGeIhFRcRDrVBrhkvYuI="; + }; + + jaspGraphs = buildRPackage { + name = "jaspGraphs-${jasp-version}"; + version = jasp-version; + + src = jasp-src; + sourceRoot = "${jasp-src.name}/Engine/jaspGraphs"; + + propagatedBuildInputs = [ ggplot2 gridExtra gtable lifecycle jsonlite R6 RColorBrewer rlang scales viridisLite ]; + }; + + jaspBase = buildRPackage { + name = "jaspBase-${jasp-version}"; + version = jasp-version; + + src = jasp-src; + sourceRoot = "${jasp-src.name}/Engine/jaspBase"; + + env.INCLUDE_DIR = "../inst/include/jaspColumnEncoder"; + + postPatch = '' + mkdir -p inst/include + cp -r --no-preserve=all ${jaspColumnEncoder-src} inst/include/jaspColumnEncoder + ''; + + propagatedBuildInputs = [ cli codetools ggplot2 gridExtra gridGraphics jaspGraphs jsonlite lifecycle modules officer pkgbuild plyr qgraph ragg R6 Rcpp renv remotes rjson rvg svglite systemfonts withr ]; + }; + + stanova = buildRPackage { + name = "stanova"; + src = fetchFromGitHub { + owner = "bayesstuff"; + repo = "stanova"; + rev = "988ad8e07cda1674b881570a85502be7795fbd4e"; + hash = "sha256-tAeHqTHao2KVRNFBDWmuF++H31aNN6O1ss1Io500QBY="; + }; + propagatedBuildInputs = [ emmeans lme4 coda rstan MASS ]; + }; + + bstats = buildRPackage { + name = "bstats"; + src = fetchFromGitHub { + owner = "AlexanderLyNL"; + repo = "bstats"; + rev = "42d34c18df08d233825bae34fdc0dfa0cd70ce8c"; + hash = "sha256-N2KmbTPbyvzsZTWBRE2x7bteccnzokUWDOB4mOWUdJk="; + }; + propagatedBuildInputs = [ hypergeo purrr SuppDists ]; + }; + + flexplot = buildRPackage { + name = "flexplot"; + src = fetchFromGitHub { + owner = "dustinfife"; + repo = "flexplot"; + rev = "4223ad5fb56028018b964d6f9f5aa5bac8710821"; + hash = "sha256-L+Ed2bIWjq3ZIAGookp8dAjDSeldEbcwynwFVVZ9IcU="; + }; + propagatedBuildInputs = [ cowplot MASS tibble withr dplyr magrittr forcats purrr plyr R6 ggplot2 patchwork ggsci lme4 party mgcv rlang ]; + }; + + # conting has been removed from CRAN + conting' = buildRPackage { + name = "conting"; + src = fetchFromGitHub { + owner = "vandenman"; + repo = "conting"; + rev = "03a4eb9a687e015d602022a01d4e638324c110c8"; + hash = "sha256-Sp09YZz1WGyefn31Zy1qGufoKjtuEEZHO+wJvoLArf0="; + }; + propagatedBuildInputs = [ mvtnorm gtools tseries coda ]; + }; + + buildJaspModule = name: deps: buildRPackage { + name = "${name}-${jasp-version}"; + version = jasp-version; + src = jasp-src; + sourceRoot = "${jasp-src.name}/Modules/${name}"; + propagatedBuildInputs = deps; + }; +in +{ + engine = { inherit jaspBase jaspGraphs; }; + modules = rec { + jaspAcceptanceSampling = buildJaspModule "jaspAcceptanceSampling" [ abtest BayesFactor conting' ggplot2 jaspBase jaspGraphs plyr stringr vcd vcdExtra AcceptanceSampling ]; + jaspAnova = buildJaspModule "jaspAnova" [ afex BayesFactor boot car colorspace emmeans ggplot2 jaspBase jaspDescriptives jaspGraphs jaspTTests KernSmooth matrixStats multcomp onewaytests plyr stringi stringr restriktor ]; + jaspAudit = buildJaspModule "jaspAudit" [ bstats extraDistr ggplot2 ggrepel jaspBase jaspGraphs jfa ]; + jaspBain = buildJaspModule "jaspBain" [ bain lavaan ggplot2 semPlot stringr jaspBase jaspGraphs jaspSem ]; + jaspBsts = buildJaspModule "jaspBsts" [ Boom bsts ggplot2 jaspBase jaspGraphs matrixStats reshape2 ]; + jaspCircular = buildJaspModule "jaspCircular" [ jaspBase jaspGraphs circular ggplot2 ]; + jaspCochrane = buildJaspModule "jaspCochrane" [ jaspBase jaspGraphs jaspDescriptives jaspMetaAnalysis ]; + jaspDescriptives = buildJaspModule "jaspDescriptives" [ ggplot2 ggrepel jaspBase jaspGraphs ]; + jaspDistributions = buildJaspModule "jaspDistributions" [ car fitdistrplus ggplot2 goftest gnorm jaspBase jaspGraphs MASS sgt sn ]; + jaspEquivalenceTTests = buildJaspModule "jaspEquivalenceTTests" [ BayesFactor ggplot2 jaspBase jaspGraphs metaBMA TOSTER jaspTTests ]; + jaspFactor = buildJaspModule "jaspFactor" [ ggplot2 jaspBase jaspGraphs jaspSem lavaan psych qgraph reshape2 semPlot GPArotation Rcsdp semTools ]; + jaspFrequencies = buildJaspModule "jaspFrequencies" [ abtest BayesFactor conting' multibridge ggplot2 jaspBase jaspGraphs plyr stringr vcd vcdExtra ]; + jaspJags = buildJaspModule "jaspJags" [ coda ggplot2 ggtext hexbin jaspBase jaspGraphs rjags scales stringr ]; + jaspLearnBayes = buildJaspModule "jaspLearnBayes" [ extraDistr ggplot2 HDInterval jaspBase jaspGraphs MASS MCMCpack MGLM scales ggalluvial ragg runjags ggdist png posterior ]; + jaspLearnStats = buildJaspModule "jaspLearnStats" [ extraDistr ggplot2 jaspBase jaspGraphs jaspDistributions jaspDescriptives jaspTTests ggforce tidyr igraph ]; + jaspMachineLearning = buildJaspModule "jaspMachineLearning" [ kknn AUC cluster colorspace DALEX dbscan e1071 fpc gbm Gmedian ggparty ggdendro ggnetwork ggplot2 ggrepel ggridges glmnet jaspBase jaspGraphs MASS mvnormalTest neuralnet network partykit plyr randomForest rpart ROCR Rtsne signal ]; + jaspMetaAnalysis = buildJaspModule "jaspMetaAnalysis" [ dplyr ggplot2 jaspBase jaspGraphs MASS metaBMA metafor psych purrr rstan stringr tibble tidyr weightr BayesTools RoBMA metamisc ggmcmc pema ]; + jaspMixedModels = buildJaspModule "jaspMixedModels" [ afex emmeans ggplot2 ggpol jaspBase jaspGraphs lme4 loo mgcv rstan rstanarm stanova withr ]; + jaspNetwork = buildJaspModule "jaspNetwork" [ bootnet BDgraph corpcor dplyr foreach ggplot2 gtools HDInterval huge IsingSampler jaspBase jaspGraphs mvtnorm qgraph reshape2 snow stringr ]; + jaspPower = buildJaspModule "jaspPower" [ pwr jaspBase jaspGraphs ]; + jaspPredictiveAnalytics = buildJaspModule "jaspPredictiveAnalytics" [ jaspBase jaspGraphs bsts bssm precrec reshape2 Boom lubridate prophet BART EBMAforecast imputeTS ]; + jaspProcess = buildJaspModule "jaspProcess" [ dagitty ggplot2 ggraph jaspBase jaspGraphs ]; + jaspProphet = buildJaspModule "jaspProphet" [ rstan ggplot2 jaspBase jaspGraphs prophet scales ]; + jaspQualityControl = buildJaspModule "jaspQualityControl" [ car cowplot daewr desirability DoE_base EnvStats FAdist fitdistrplus FrF2 ggplot2 ggrepel goftest ggpp irr jaspBase jaspDescriptives jaspGraphs mle_tools psych qcc rsm Rspc tidyr tibble vipor weibullness ]; + jaspRegression = buildJaspModule "jaspRegression" [ BAS boot bstats combinat emmeans ggplot2 ggrepel hmeasure jaspAnova jaspBase jaspDescriptives jaspGraphs jaspTTests lmtest logistf MASS matrixStats mdscore ppcor purrr Rcpp statmod VGAM ]; + jaspReliability = buildJaspModule "jaspReliability" [ Bayesrel coda ggplot2 ggridges irr jaspBase jaspGraphs LaplacesDemon lme4 MASS psych ]; + jaspRobustTTests = buildJaspModule "jaspRobustTTests" [ RoBTT ggplot2 jaspBase jaspGraphs ]; + jaspSem = buildJaspModule "jaspSem" [ forcats ggplot2 jaspBase jaspGraphs lavaan cSEM reshape2 semPlot semTools stringr tibble tidyr ]; + jaspSummaryStatistics = buildJaspModule "jaspSummaryStatistics" [ BayesFactor bstats jaspBase jaspFrequencies jaspGraphs jaspRegression jaspTTests jaspAnova jaspDescriptives SuppDists bayesplay ]; + jaspSurvival = buildJaspModule "jaspSurvival" [ survival survminer jaspBase jaspGraphs ]; + jaspTTests = buildJaspModule "jaspTTests" [ BayesFactor car ggplot2 jaspBase jaspGraphs logspline plotrix plyr ]; + jaspTimeSeries = buildJaspModule "jaspTimeSeries" [ jaspBase jaspGraphs forecast ]; + jaspVisualModeling = buildJaspModule "jaspVisualModeling" [ flexplot jaspBase jaspGraphs ]; + }; +} diff --git a/pkgs/by-name/ja/jasp-desktop/package.nix b/pkgs/by-name/ja/jasp-desktop/package.nix new file mode 100644 index 000000000000..f5ec0115de12 --- /dev/null +++ b/pkgs/by-name/ja/jasp-desktop/package.nix @@ -0,0 +1,121 @@ +{ lib +, stdenv +, fetchFromGitHub +, callPackage +, buildEnv +, linkFarm +, substituteAll +, R +, rPackages +, cmake +, ninja +, pkg-config +, boost +, libarchive +, readstat +, qt6 +}: + +let + version = "0.18.2"; + + src = fetchFromGitHub { + owner = "jasp-stats"; + repo = "jasp-desktop"; + rev = "v${version}"; + hash = "sha256-W0wYvk5T9srE1cOyGgahfGxEookdOgVcnzqH9SkFyo8="; + fetchSubmodules = true; + }; + + inherit (callPackage ./modules.nix { + jasp-src = src; + jasp-version = version; + }) engine modules; + + # Merges ${R}/lib/R with all used R packages (even propagated ones) + customREnv = buildEnv { + name = "jasp-${version}-env"; + paths = [ + "${R}/lib/R" + rPackages.RInside + engine.jaspBase # Should already be propagated from modules, but include it again, just in case + ] ++ lib.attrValues modules; + }; + + modulesDir = linkFarm "jasp-${version}-modules" + (lib.mapAttrsToList (name: drv: { name = name; path = "${drv}/library"; }) modules); +in +stdenv.mkDerivation { + pname = "jasp-desktop"; + inherit version src; + + patches = [ + # remove unused cmake deps, ensure boost is dynamically linked, patch readstat path + (substituteAll { + src = ./cmake.patch; + inherit readstat; + }) + ]; + + cmakeFlags = [ + "-DGITHUB_PAT=dummy" + "-DGITHUB_PAT_DEF=dummy" + "-DINSTALL_R_FRAMEWORK=OFF" + "-DLINUX_LOCAL_BUILD=OFF" + "-DINSTALL_R_MODULES=OFF" + "-DCUSTOM_R_PATH=${customREnv}" + ]; + + nativeBuildInputs = [ + cmake + ninja + pkg-config + qt6.wrapQtAppsHook + ]; + + buildInputs = [ + customREnv + boost + libarchive + readstat + ] ++ (with qt6; [ + qtbase + qtdeclarative + qtwebengine + qtsvg + qt5compat + ]); + + env.NIX_LDFLAGS = "-L${rPackages.RInside}/library/RInside/lib"; + + postInstall = '' + # Remove unused cache locations + rm -r $out/lib64 $out/Modules + + # Remove flatpak proxy script + rm $out/bin/org.jaspstats.JASP + substituteInPlace $out/share/applications/org.jaspstats.JASP.desktop \ + --replace "Exec=org.jaspstats.JASP" "Exec=JASP" + + # symlink modules from the store + ln -s ${modulesDir} $out/Modules + ''; + + passthru = { + inherit modules engine; + env = customREnv; + }; + + meta = { + changelog = "https://jasp-stats.org/release-notes"; + description = "A complete statistical package for both Bayesian and Frequentist statistical methods"; + homepage = "https://github.com/jasp-stats/jasp-desktop"; + license = lib.licenses.agpl3; + mainProgram = "JASP"; + maintainers = with lib.maintainers; [ tomasajt ]; + # JASP's cmake build steps are really different on Darwin + # Perhaps the Darwin-specific things could be changed to be the same as Linux + platforms = lib.platforms.linux; + }; +} + From 3dd91343086f6033432b59d197daeee49cdbfb2f Mon Sep 17 00:00:00 2001 From: networkException Date: Thu, 11 Jan 2024 03:12:53 +0100 Subject: [PATCH 32/32] ungoogled-chromium: 120.0.6099.199-1 -> 120.0.6099.216-1 https://chromereleases.googleblog.com/2024/01/stable-channel-update-for-desktop_9.html This update includes 1 security fix. CVEs: CVE-2024-0333 --- .../networking/browsers/chromium/upstream-info.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/applications/networking/browsers/chromium/upstream-info.nix b/pkgs/applications/networking/browsers/chromium/upstream-info.nix index 0f848d77c678..1f90598bbb55 100644 --- a/pkgs/applications/networking/browsers/chromium/upstream-info.nix +++ b/pkgs/applications/networking/browsers/chromium/upstream-info.nix @@ -28,12 +28,12 @@ version = "2023-10-23"; }; ungoogled-patches = { - hash = "sha256-B1MNo8BdjMOmTvIr4uu3kg/MO1t+YLQz2S23L4Cye3E="; - rev = "120.0.6099.199-1"; + hash = "sha256-qB1OrsfRCWfobKAAfcYJFmKc36ofF+VmjqPNbIPugJA="; + rev = "120.0.6099.216-1"; }; }; - hash = "sha256-lT1CCwYj0hT4tCJb689mZwNecUsEwcfn2Ot8r9LBT+M="; - hash_deb_amd64 = "sha256-4BWLn0+gYNWG4DsolbY6WlTvXWl7tZIZrnqXlrGUGjQ="; - version = "120.0.6099.199"; + hash = "sha256-yqk0bh68onWqML20Q8eDsTT9o+eKtta7kS9HL74do6Q="; + hash_deb_amd64 = "sha256-MxIyOXssQ1Ke5WZbBbB4FpDec+rn46m8+PbMdmxaQCA="; + version = "120.0.6099.216"; }; }