Only evaluate what is needed to build #84
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The current implementation of the parallel evaluation stage evaluates the entire
#hydraJobs
attribute of ghaf, even though we don't build half of the packages it contains. This is wasteful.nix-eval-jobs
can take arbitrary nix expression as input, so I'm creating a new attribute set on the fly, which is a subset of ghaf#packages
, only containing the targets we need, and evaluating that instead.From my testing, this shaves our evaluation time in main pipeline from 7-8 minutes to just under 3 minutes (with the current set of targets)
As for the move to
#packages
, some of the newer targets are not available in#hydraJobs
, as it's being phased out and not updated anymore. Nightly pipeline for example currently could not be built in parallel for this reason. Ghaf#packages
set is very large so without this optimisation it would have taken ages to evaluate.