diff --git a/pkgs/development/cuda-modules/_cuda/lib/meta.nix b/pkgs/development/cuda-modules/_cuda/lib/meta.nix index 72f71973b0cd..7adc36474935 100644 --- a/pkgs/development/cuda-modules/_cuda/lib/meta.nix +++ b/pkgs/development/cuda-modules/_cuda/lib/meta.nix @@ -2,7 +2,7 @@ { /** Returns a list of bad platforms for a given package if assertsions in `finalAttrs.passthru.platformAssertions` - fail, optionally logging evaluation warnings for each reason. + fail, optionally logging evaluation warnings with `builtins.traceVerbose` for each reason. NOTE: No guarantees are made about this function's stability. You may use it at your own risk. @@ -12,31 +12,39 @@ # Type ``` - _mkMetaBadPlatforms :: (warn :: Bool) -> (finalAttrs :: AttrSet) -> List String + _mkMetaBadPlatforms :: (finalAttrs :: AttrSet) -> List String ``` + + # Inputs + + `finalAttrs` + + : The final attributes of the package */ _mkMetaBadPlatforms = - warn: finalAttrs: + finalAttrs: let failedAssertionsString = _cuda.lib._mkFailedAssertionsString finalAttrs.passthru.platformAssertions; hasFailedAssertions = failedAssertionsString != ""; finalStdenv = finalAttrs.finalPackage.stdenv; - in - lib.warnIf (warn && hasFailedAssertions) - "Package ${finalAttrs.finalPackage.name} is unsupported on this platform due to the following failed assertions:${failedAssertionsString}" - ( - lib.optionals hasFailedAssertions ( - lib.unique [ - finalStdenv.buildPlatform.system - finalStdenv.hostPlatform.system - finalStdenv.targetPlatform.system - ] - ) + badPlatforms = lib.optionals hasFailedAssertions ( + lib.unique [ + finalStdenv.buildPlatform.system + finalStdenv.hostPlatform.system + finalStdenv.targetPlatform.system + ] ); + handle = + if hasFailedAssertions then + builtins.traceVerbose "Package ${finalAttrs.finalPackage.name} is unsupported on this platform due to the following failed assertions:${failedAssertionsString}" + else + lib.id; + in + handle badPlatforms; /** Returns a boolean indicating whether the package is broken as a result of `finalAttrs.passthru.brokenAssertions`, - optionally logging evaluation warnings for each reason. + optionally logging evaluation warnings with `builtins.traceVerbose` for each reason. NOTE: No guarantees are made about this function's stability. You may use it at your own risk. @@ -46,26 +54,25 @@ # Type ``` - _mkMetaBroken :: (warn :: Bool) -> (finalAttrs :: AttrSet) -> Bool + _mkMetaBroken :: (finalAttrs :: AttrSet) -> Bool ``` # Inputs - `warn` - - : A boolean indicating whether to log warnings - `finalAttrs` : The final attributes of the package */ _mkMetaBroken = - warn: finalAttrs: + finalAttrs: let failedAssertionsString = _cuda.lib._mkFailedAssertionsString finalAttrs.passthru.brokenAssertions; hasFailedAssertions = failedAssertionsString != ""; + handle = + if hasFailedAssertions then + builtins.traceVerbose "Package ${finalAttrs.finalPackage.name} is marked as broken due to the following failed assertions:${failedAssertionsString}" + else + lib.id; in - lib.warnIf (warn && hasFailedAssertions) - "Package ${finalAttrs.finalPackage.name} is marked as broken due to the following failed assertions:${failedAssertionsString}" - hasFailedAssertions; + handle hasFailedAssertions; } diff --git a/pkgs/development/cuda-modules/buildRedist/default.nix b/pkgs/development/cuda-modules/buildRedist/default.nix index 847830e17641..b29eacd37c2b 100644 --- a/pkgs/development/cuda-modules/buildRedist/default.nix +++ b/pkgs/development/cuda-modules/buildRedist/default.nix @@ -439,8 +439,8 @@ extendMkDerivation { ''; sourceProvenance = meta.sourceProvenance or [ sourceTypes.binaryNativeCode ]; platforms = finalAttrs.passthru.supportedNixSystems; - broken = _mkMetaBroken (!(config.inHydra or false)) finalAttrs; - badPlatforms = _mkMetaBadPlatforms (!(config.inHydra or false)) finalAttrs; + broken = _mkMetaBroken finalAttrs; + badPlatforms = _mkMetaBadPlatforms finalAttrs; downloadPage = meta.downloadPage or "https://developer.download.nvidia.com/compute/${finalAttrs.passthru.redistName}/redist/${finalAttrs.pname}"; diff --git a/pkgs/development/cuda-modules/packages/cutlass.nix b/pkgs/development/cuda-modules/packages/cutlass.nix index e9dfaa84f786..c6e0126504f0 100644 --- a/pkgs/development/cuda-modules/packages/cutlass.nix +++ b/pkgs/development/cuda-modules/packages/cutlass.nix @@ -225,7 +225,7 @@ backendStdenv.mkDerivation (finalAttrs: { "aarch64-linux" "x86_64-linux" ]; - badPlatforms = _mkMetaBadPlatforms (!(config.inHydra or false)) finalAttrs; + badPlatforms = _mkMetaBadPlatforms finalAttrs; maintainers = [ maintainers.connorbaker ]; teams = [ teams.cuda ]; }; diff --git a/pkgs/development/cuda-modules/packages/nccl-tests.nix b/pkgs/development/cuda-modules/packages/nccl-tests.nix index 18118b94bcb8..4a7528a10356 100644 --- a/pkgs/development/cuda-modules/packages/nccl-tests.nix +++ b/pkgs/development/cuda-modules/packages/nccl-tests.nix @@ -107,7 +107,7 @@ backendStdenv.mkDerivation (finalAttrs: { "x86_64-linux" ]; license = licenses.bsd3; - broken = _mkMetaBroken (!(config.inHydra or false)) finalAttrs; + broken = _mkMetaBroken finalAttrs; maintainers = with maintainers; [ jmillerpdt ]; teams = [ teams.cuda ]; }; diff --git a/pkgs/development/cuda-modules/packages/nccl.nix b/pkgs/development/cuda-modules/packages/nccl.nix index a160d501cb44..48ce87101eba 100644 --- a/pkgs/development/cuda-modules/packages/nccl.nix +++ b/pkgs/development/cuda-modules/packages/nccl.nix @@ -112,7 +112,7 @@ backendStdenv.mkDerivation (finalAttrs: { ]; # 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 = _mkMetaBadPlatforms (!(config.inHydra or false)) finalAttrs; + badPlatforms = _mkMetaBadPlatforms finalAttrs; maintainers = with maintainers; [ mdaiter orivej