Skip to content

Instantly share code, notes, and snippets.

@ConnorBaker
Last active June 20, 2024 15:56
Show Gist options
  • Select an option

  • Save ConnorBaker/305b1aebd7ee74a258a616bbbd4dcd7b to your computer and use it in GitHub Desktop.

Select an option

Save ConnorBaker/305b1aebd7ee74a258a616bbbd4dcd7b to your computer and use it in GitHub Desktop.
Markdown and bash command templates for Nixpkgs-review for CUDA.
{
allowAliases = false;
allowBroken = false;
allowUnfree = true;
checkMeta = true;
cudaSupport = true;
cudaCapabilities = [ "7.5" ];
packageOverrides =
pkgs:
let
inherit (pkgs.lib.attrsets) recursiveUpdate updateManyAttrsByPath;
inherit (pkgs.lib.lists) map;
inherit (pkgs.lib.trivial) pipe;
mkOverrides =
{
attrPaths,
overrideMsgFn ? (pkg: "${pkg.name}: setting meta.broken = true"),
overrideAttrsFnName ? "overrideAttrs",
overrideAttrsFnArgAttrSet ? ({ meta.broken = true; }),
}:
# Allows currying
packageSet:
let
updates = map (attrPath: {
path = attrPath;
update =
pkg:
let
# Must use builtins.abort to fully stop evaluation instead of throwing an exception, which eval will catch
overrideAttrsFn =
pkg.${overrideAttrsFnName}
or (builtins.abort "Package ${pkg.name} does not have the function ${overrideAttrsFnName} defined.");
overrideAttrsFnArg =
prevAttrs: builtins.trace (overrideMsgFn pkg) recursiveUpdate prevAttrs overrideAttrsFnArgAttrSet;
in
overrideAttrsFn overrideAttrsFnArg;
}) attrPaths;
in
updateManyAttrsByPath updates packageSet;
usesRequireFile = [
[ "airwave" ]
[ "alephone-apotheosis-x" ]
[ "andyetitmoves" ]
[ "ciscoPacketTracer7" ]
[ "ciscoPacketTracer8" ]
[ "citrix_workspace" ]
[ "citrix_workspace_23_11_0" ]
[ "citrix_workspace_23_09_0" ]
[ "citrix_workspace_24_02_0" ]
[ "d1x-rebirth-full" ]
[ "d2x-rebirth-full" ]
[ "displaylink" ]
[ "dxx-rebirth" ]
[ "everspace" ]
[ "houdini" ]
[ "iaca_2_1" ]
[ "iaca" ]
[ "ib-tws" ]
[ "ios-cross-compile" ]
[ "javacard-devkit" ]
[ "keeperrl" ]
[ "kinect-audio-setup" ]
[ "koboredux" ]
[ "lattice-diamond" ]
[ "liquidfun" ]
[ "mathematica-cuda" ]
[ "mathematica-webdoc-cuda" ]
[ "mathematica-webdoc" ]
[ "mathematica" ]
[ "mathematica10" ]
[ "mathematica11" ]
[ "mathematica9" ]
[ "oraclejdk" ]
[ "oraclejdk11" ]
[ "oraclejdk8" ]
[ "oraclejre" ]
[ "oraclejre8" ]
[ "pixinsight" ]
[ "planetary_annihilation" ]
[ "rcu" ]
[ "realvnc-vnc-viewer" ]
[ "sm64ex-coop" ]
[ "sm64ex" ]
[ "snapdragon-profiler" ]
[ "sqldeveloper" ]
[ "upwork" ]
[ "uqm" ]
[ "ut1999" ]
[ "vessel" ]
[ "wechat-uos" ]
[ "wolfram-engine" ]
[ "wonderdraft" ]
[ "worldofgoo" ]
[ "wtk" ]
];
brokenOnMaster = [
[ "actiona" ]
[
"libsForQt5"
"pix"
] # https://github.com/NixOS/nixpkgs/issues/317089
];
# Packages which take an inordinate amount of time to build
takesForeverToBuild = [ [ "elpa" ] ];
longCheckPhasePythonExtension =
_:
mkOverrides {
attrPaths = [
[ "apricot-select" ]
[ "botorch" ]
[ "fairseq" ]
[ "gpytorch" ]
[ "linear-operator" ]
[ "pgmpy" ]
[ "torchsde" ]
[ "tensordict" ]
];
overrideMsgFn = (pkg: "${pkg.name}: setting doCheck = false");
overrideAttrsFnName = "overridePythonAttrs";
overrideAttrsFnArgAttrSet.doCheck = false;
};
# Packages built with buildPythonPackage that are broken
brokenOnMasterPythonExtension =
_:
mkOverrides {
attrPaths = [ ];
overrideMsgFn = (pkg: "${pkg.name}: setting meta.broken = true");
overrideAttrsFnName = "overridePythonAttrs";
overrideAttrsFnArgAttrSet.meta.broken = true;
};
# Packages built with toPythonModule that are broken (they don't have overridePythonAttrs)
brokenOnMasterPythonModuleExtension =
_:
mkOverrides {
attrPaths = [
[ "hoomd-blue" ] # https://github.com/NixOS/nixpkgs/issues/317307
];
overrideMsgFn = (pkg: "${pkg.name}: setting meta.broken = true");
overrideAttrsFnName = "overrideAttrs";
overrideAttrsFnArgAttrSet.meta.broken = true;
};
in
pipe pkgs [
(mkOverrides { attrPaths = usesRequireFile ++ brokenOnMaster ++ takesForeverToBuild; })
(updateManyAttrsByPath [
{
path = [ "pythonPackagesExtensions" ];
update =
pythonPackagesExtensions:
pythonPackagesExtensions
++ [
longCheckPhasePythonExtension
brokenOnMasterPythonExtension
brokenOnMasterPythonModuleExtension
];
}
])
];
}

Important

This review was run against commit ########.

Important

To reproduce, ensure ,nixpkgs-review-nixpkgs-config.nix is present in your Nixpkgs tree -- the leading comma ensures it is ignored by git.

Note

Template nixpkgs-review command:

nixpkgs-review pr 319711 \
  --system x86_64-linux \
  --no-shell \
  --print-result \
  --build-args "--show-trace --max-jobs 1" \
  --build-graph nix \
  --extra-nixpkgs-config "$(cat ./,nixpkgs-review-nixpkgs-config.nix)"

Template command to re-run the build from the nixpkgs directory:

export PR="306172" \
RUN_NUMBER="13" \
&& nix build --system x86_64-linux --expr "
let
  pkgs = builtins.import ./. (builtins.import ./,nixpkgs-review-nixpkgs-config.nix);
  builder = builtins.import ${HOME:?}/.cache/nixpkgs-review/pr-${PR:?}${RUN_NUMBER:+-$RUN_NUMBER}/attrs.nix;
in
builder pkgs
"

Template log archival command:

PR="306172" \
RUN_NUMBER="13" \
SYSTEM="aarch64-linux" \
NIXPKGS_CUDA_CAPABILITIES="7.5" \
&& tar -cvf "${SYSTEM:?}-cap-${NIXPKGS_CUDA_CAPABILITIES:?}-pr-${PR:?}${RUN_NUMBER:+-$RUN_NUMBER}.tar.zst" \
  -I "zstd -T0 --long=31 --ultra -22" \
  -C "${HOME:?}/.cache/nixpkgs-review/pr-${PR:?}${RUN_NUMBER:+-$RUN_NUMBER}" \
  .

Logs are made available at https://drive.google.com/drive/folders/1GgABhwa2ooKeZXMqf5He6PcyClNrE6cQ?usp=share_link

πŸ• aarch64-darwin

In progress.

πŸ• x86_64-darwin

In progress.

πŸ• aarch64-linux

πŸ• CUDA (Non-Jetson)

In progress.

πŸ• CUDA (Jetson)

In progress.

πŸ• Non-CUDA

In progress.

πŸ• x86_64-linux

πŸ• CUDA (Non-Jetson)

In progress.

πŸ• Non-CUDA

In progress.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment