_cuda.lib.{_mkMetaBadPlatforms,_mkMetaBroken}: use builtins.traceVerbose
Signed-off-by: Connor Baker <ConnorBaker01@gmail.com>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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}";
|
||||
|
||||
@@ -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 ];
|
||||
};
|
||||
|
||||
@@ -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 ];
|
||||
};
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user