Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib/tests: Allow overriding pkgs independent of lib being tested #86024

Merged
merged 1 commit into from Apr 28, 2020

Conversation

infinisil
Copy link
Member

@infinisil infinisil commented Apr 25, 2020

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.

nix-build lib/tests/release.nix --arg pkgs 'import <nixpkgs> {}'

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
  • Verified that changing stdenv still allows you to run the tests quickly with --arg pkgs 'import <nixpkgs> {}'
  • Added check that prevents pkgs.lib from being used, instead the lib in the nixpkgs tree should be used instead.

@infinisil infinisil merged commit aa3dde8 into NixOS:master Apr 28, 2020
@infinisil infinisil deleted the lib-tests-pkgs branch April 28, 2020 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants