lol

workflows/eval: load supportedSystems from JSON file

This is a refactor to prepare the next commit. It doesn't do much on its
own, but is separated for ease of review.

+23 -21
+2 -5
.github/workflows/eval.yml
··· 26 26 if: needs.get-merge-commit.outputs.mergedSha 27 27 outputs: 28 28 targetSha: ${{ steps.targetSha.outputs.targetSha }} 29 - systems: ${{ steps.systems.outputs.systems }} 30 29 steps: 31 30 - name: Check out the PR at the test merge commit 32 31 uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 ··· 47 46 with: 48 47 extra_nix_config: sandbox = true 49 48 50 - - name: Evaluate the list of all attributes and get the systems matrix 51 - id: systems 49 + - name: Evaluate the list of all attributes 52 50 run: | 53 51 nix-build nixpkgs/ci -A eval.attrpathsSuperset 54 - echo "systems=$(<result/systems.json)" >> "$GITHUB_OUTPUT" 55 52 56 53 - name: Upload the list of all attributes 57 54 uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 ··· 66 63 strategy: 67 64 fail-fast: false 68 65 matrix: 69 - system: ${{ fromJSON(needs.attrs.outputs.systems) }} 66 + system: ${{ fromJSON(needs.get-merge-commit.outputs.systems) }} 70 67 steps: 71 68 - name: Enable swap 72 69 run: |
+9 -1
.github/workflows/get-merge-commit.yml
··· 6 6 mergedSha: 7 7 description: "The merge commit SHA" 8 8 value: ${{ jobs.resolve-merge-commit.outputs.mergedSha }} 9 + systems: 10 + description: "The supported systems" 11 + value: ${{ jobs.resolve-merge-commit.outputs.systems }} 9 12 10 13 permissions: {} 11 14 ··· 14 17 runs-on: ubuntu-24.04-arm 15 18 outputs: 16 19 mergedSha: ${{ steps.merged.outputs.mergedSha }} 20 + systems: ${{ steps.systems.outputs.systems }} 17 21 steps: 18 22 - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 19 23 with: ··· 40 44 fi 41 45 ;; 42 46 esac 43 - rm -rf base 47 + 48 + - name: Load supported systems 49 + id: systems 50 + run: | 51 + echo "systems=$(jq -c <base/ci/supportedSystems.json)" >> "$GITHUB_OUTPUT"
+1 -1
ci/eval/README.md
··· 11 11 --arg evalSystems '["x86_64-linux" "aarch64-darwin"]' 12 12 ``` 13 13 14 - - `--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. 14 + - `--max-jobs`: The maximum number of derivations to run at the same time. Only each [supported system](../supportedSystems.json) gets a separate derivation, so it doesn't make sense to set this higher than that number. 15 15 - `--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`. 16 16 - `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. 17 17 - `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`).
+2 -5
ci/eval/default.nix
··· 26 26 "nixos" 27 27 "pkgs" 28 28 ".version" 29 - "ci/supportedSystems.nix" 29 + "ci/supportedSystems.json" 30 30 ] 31 31 ); 32 32 }; 33 33 34 34 nix = nixVersions.nix_2_24; 35 35 36 - supportedSystems = import ../supportedSystems.nix; 36 + supportedSystems = builtins.fromJSON (builtins.readFile ../supportedSystems.json); 37 37 38 38 attrpathsSuperset = 39 39 runCommand "attrpaths-superset.json" ··· 43 43 nix 44 44 time 45 45 ]; 46 - env.supportedSystems = builtins.toJSON supportedSystems; 47 - passAsFile = [ "supportedSystems" ]; 48 46 } 49 47 '' 50 48 export NIX_STATE_DIR=$(mktemp -d) ··· 58 56 --option restrict-eval true \ 59 57 --option allow-import-from-derivation false \ 60 58 --arg enableWarnings false > $out/paths.json 61 - mv "$supportedSystemsPath" $out/systems.json 62 59 ''; 63 60 64 61 singleSystem =
+6
ci/supportedSystems.json
··· 1 + [ 2 + "aarch64-linux", 3 + "aarch64-darwin", 4 + "x86_64-linux", 5 + "x86_64-darwin" 6 + ]
-6
ci/supportedSystems.nix
··· 1 - [ 2 - "aarch64-linux" 3 - "aarch64-darwin" 4 - "x86_64-linux" 5 - "x86_64-darwin" 6 - ]
+1 -1
pkgs/top-level/release-haskell.nix
··· 10 10 $ hydra-eval-jobs -I . pkgs/top-level/release-haskell.nix 11 11 */ 12 12 { 13 - supportedSystems ? import ../../ci/supportedSystems.nix, 13 + supportedSystems ? builtins.fromJSON (builtins.readFile ../../ci/supportedSystems.json), 14 14 }: 15 15 16 16 let
+1 -1
pkgs/top-level/release-outpaths.nix
··· 13 13 attrNamesOnly ? false, 14 14 15 15 # Set this to `null` to build for builtins.currentSystem only 16 - systems ? import ../../ci/supportedSystems.nix, 16 + systems ? builtins.fromJSON (builtins.readFile ../../ci/supportedSystems.json), 17 17 }: 18 18 let 19 19 lib = import (path + "/lib");
+1 -1
pkgs/top-level/release.nix
··· 19 19 system ? builtins.currentSystem, 20 20 officialRelease ? false, 21 21 # The platform doubles for which we build Nixpkgs. 22 - supportedSystems ? import ../../ci/supportedSystems.nix, 22 + supportedSystems ? builtins.fromJSON (builtins.readFile ../../ci/supportedSystems.json), 23 23 # The platform triples for which we build bootstrap tools. 24 24 bootstrapConfigs ? [ 25 25 "aarch64-apple-darwin"