From 6eadbf9c9788cd842066ff9c66dbfd1dfa00b25c Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Sat, 14 Dec 2024 21:32:34 +0100 Subject: [PATCH] ci/eval: allow precisely choosing which systems to evaluate for (evalSystem -> evalSystems) --- ci/eval/README.md | 8 +++++--- ci/eval/default.nix | 7 +++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/ci/eval/README.md b/ci/eval/README.md index 020e7127f51a9..0436a028ed69e 100644 --- a/ci/eval/README.md +++ b/ci/eval/README.md @@ -5,14 +5,16 @@ The code in this directory is used by the [eval.yml](../../.github/workflows/eva Furthermore it also allows local evaluation using ``` nix-build ci -A eval.full \ - --max-jobs 4 - --cores 2 - --arg chunkSize 10000 + --max-jobs 4 \ + --cores 2 \ + --arg chunkSize 10000 \ + --arg evalSystems '["x86_64-linux" "aarch64-darwin"]' ``` - `--max-jobs`: The maximum number of derivations to run at the same time. Only each [supported system](../supportedSystems.nix) gets a separate derivation, so it doesn't make sense to set this higher than that number. - `--cores`: The number of cores to use for each job. Recommended to set this to the amount of cores on your system divided by `--max-jobs`. - `chunkSize`: The number of attributes that are evaluated simultaneously on a single core. Lowering this decreases memory usage at the cost of increased evaluation time. If this is too high, there won't be enough chunks to process them in parallel, and will also increase evaluation time. +- `evalSystems`: The set of systems for which `nixpkgs` should be evaluated. Defaults to the four official platforms (`x86_64-linux`, `aarch64-linux`, `x86_64-darwin` and `aarch64-darwin`). A good default is to set `chunkSize` to 10000, which leads to about 3.6GB max memory usage per core, so suitable for fully utilising machines with 4 cores and 16GB memory, 8 cores and 32GB memory or 16 cores and 64GB memory. diff --git a/ci/eval/default.nix b/ci/eval/default.nix index e55093be57c52..77430976ffc53 100644 --- a/ci/eval/default.nix +++ b/ci/eval/default.nix @@ -259,14 +259,13 @@ let full = { - # Whether to evaluate just a single system, by default all are evaluated - evalSystem ? if quickTest then "x86_64-linux" else null, + # Whether to evaluate on a specific set of systems, by default all are evaluated + evalSystems ? if quickTest then [ "x86_64-linux" ] else supportedSystems, # The number of attributes per chunk, see ./README.md for more info. chunkSize, quickTest ? false, }: let - systems = if evalSystem == null then supportedSystems else [ evalSystem ]; results = linkFarm "results" ( map (evalSystem: { name = evalSystem; @@ -274,7 +273,7 @@ let inherit quickTest evalSystem chunkSize; attrpathFile = attrpathsSuperset + "/paths.json"; }; - }) systems + }) evalSystems ); in combine {