lib/tests: Allow overriding pkgs independent of lib being tested #86024
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.
Motivation for this change
Currently, the lib tests depend on the pkgs in the same nixpkgs tree to run the tests, for trivial things like
pkgs.runCommand
and such. This means when there's mass rebuilds due to a changed stdenv, the lib tests can't be run! Currently @GrahamcOfBorg fails to run the lib tests for stdenv rebuilds because of that, an example: #85951.With this PR, you can now override only the
pkgs
used for the lib tests, e.g.would allow you to still run tests even with stdenv rebuilds, assuming you have a somewhat working
<nixpkgs>
. This can then be used by ofborg to always run lib tests (see NixOS/ofborg#472 which implements this)Things done
--arg pkgs 'import <nixpkgs> {}'
pkgs.lib
from being used, instead the lib in the nixpkgs tree should be used instead.