Skip to content

Commit

Permalink
ci: add subpackages
Browse files Browse the repository at this point in the history
  • Loading branch information
RossComputerGuy committed Nov 27, 2024
1 parent 3f8be24 commit a1fdbbd
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/eval.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ jobs:
strategy:
matrix:
system: ${{ fromJSON(needs.attrs.outputs.systems) }}
subpackages:
- null
- pkgsLLVM
steps:
- name: Download the list of all attributes
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
Expand All @@ -84,14 +87,16 @@ jobs:
- name: Install Nix
uses: cachix/install-nix-action@08dcb3a5e62fa31e2da3d490afc4176ef55ecd72 # v30

- name: Evaluate the ${{ matrix.system }} output paths for all derivation attributes
- name: Evaluate the ${{ matrix.system }} (subpackages: ${{ matrix.subpackages }}) output paths for all derivation attributes
env:
MATRIX_SYSTEM: ${{ matrix.system }}
MATRIX_SUBPACKAGES: ${{ matrix.subpackages }}
run: |
nix-build nixpkgs/ci -A eval.singleSystem \
--argstr evalSystem "$MATRIX_SYSTEM" \
--arg attrpathFile ./paths/paths.json \
--arg chunkSize 10000
--arg chunkSize 10000 \
--arg subpackages $MATRIX_SUBPACKAGES
# If it uses too much memory, slightly decrease chunkSize
- name: Upload the output paths and eval stats
Expand Down
6 changes: 5 additions & 1 deletion ci/eval/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ let
includeBroken ? true,
# Whether to just evaluate a single chunk for quick testing
quickTest ? false,
# Name of the sub-nixpkgs set to evaluate, null for everything enabled.
subpackages ? null,
}:
let
singleChunk = writeShellScript "single-chunk" ''
Expand All @@ -93,6 +95,7 @@ let
--arg systems "[ \"$system\" ]" \
--arg checkMeta ${lib.boolToString checkMeta} \
--arg includeBroken ${lib.boolToString includeBroken} \
${lib.optionalString (subpackages != null) "--argstr subpackages ${subpackages} \\"}
> "$outputDir/result/$myChunk"
exitCode=$?
set -e
Expand Down Expand Up @@ -245,14 +248,15 @@ let
# The number of attributes per chunk, see ./README.md for more info.
chunkSize,
quickTest ? false,
subpackages ? null,
}:
let
systems = if evalSystem == null then supportedSystems else [ evalSystem ];
results = linkFarm "results" (
map (evalSystem: {
name = evalSystem;
path = singleSystem {
inherit quickTest evalSystem chunkSize;
inherit quickTest evalSystem chunkSize subpackages;
attrpathFile = attrpathsSuperset + "/paths.json";
};
}) systems
Expand Down
7 changes: 6 additions & 1 deletion pkgs/top-level/release-attrpaths-parallel.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,16 @@
checkMeta,
includeBroken,
systems,
subpackages ? null,
}:

let
attrpaths = lib.importJSON attrpathFile;
myAttrpaths = lib.sublist (chunkSize * myChunk) chunkSize attrpaths;
myAttrpaths = lib.sublist (chunkSize * myChunk) chunkSize
(if subpackages != null then
lib.filter (p: lib.hasPrefix subpackages (lib.concatStringsSep "/" p)) attrpaths
else
attrpaths);

unfiltered = import ./release-outpaths.nix {
inherit path;
Expand Down

0 comments on commit a1fdbbd

Please sign in to comment.