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

nativeCheckInputs #206742

Merged
merged 8 commits into from
Jan 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion doc/hooks/postgresql-test-hook.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ stdenv.mkDerivation {

# ...

checkInputs = [
nativeCheckInputs = [
postgresql
postgresqlTestHook
];
Expand Down
24 changes: 12 additions & 12 deletions doc/languages-frameworks/python.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ arguments `buildInputs` and `propagatedBuildInputs` to specify dependencies. If
something is exclusively a build-time dependency, then the dependency should be
included in `buildInputs`, but if it is (also) a runtime dependency, then it
should be added to `propagatedBuildInputs`. Test dependencies are considered
build-time dependencies and passed to `checkInputs`.
build-time dependencies and passed to `nativeCheckInputs`.

The following example shows which arguments are given to `buildPythonPackage` in
order to build [`datashape`](https://github.com/blaze/datashape).
Expand All @@ -453,7 +453,7 @@ buildPythonPackage rec {
hash = "sha256-FLLvdm1MllKrgTGC6Gb0k0deZeVYvtCCLji/B7uhong=";
};

checkInputs = [ pytest ];
nativeCheckInputs = [ pytest ];
propagatedBuildInputs = [ numpy multipledispatch python-dateutil ];

meta = with lib; {
Expand All @@ -466,7 +466,7 @@ buildPythonPackage rec {
```

We can see several runtime dependencies, `numpy`, `multipledispatch`, and
`python-dateutil`. Furthermore, we have one `checkInputs`, i.e. `pytest`. `pytest` is a
`python-dateutil`. Furthermore, we have one `nativeCheckInputs`, i.e. `pytest`. `pytest` is a
test runner and is only used during the `checkPhase` and is therefore not added
to `propagatedBuildInputs`.

Expand Down Expand Up @@ -569,7 +569,7 @@ Pytest is the most common test runner for python repositories. A trivial
test run would be:

```
checkInputs = [ pytest ];
nativeCheckInputs = [ pytest ];
checkPhase = ''
runHook preCheck

Expand All @@ -585,7 +585,7 @@ sandbox, and will generally need many tests to be disabled.
To filter tests using pytest, one can do the following:

```
checkInputs = [ pytest ];
nativeCheckInputs = [ pytest ];
# avoid tests which need additional data or touch network
checkPhase = ''
runHook preCheck
Expand Down Expand Up @@ -618,7 +618,7 @@ when a package may need many items disabled to run the test suite.
Using the example above, the analogous `pytestCheckHook` usage would be:

```
checkInputs = [ pytestCheckHook ];
nativeCheckInputs = [ pytestCheckHook ];

# requires additional data
pytestFlagsArray = [ "tests/" "--ignore=tests/integration" ];
Expand Down Expand Up @@ -749,7 +749,7 @@ with the exception of `other` (see `format` in
`unittestCheckHook` is a hook which will substitute the setuptools `test` command for a `checkPhase` which runs `python -m unittest discover`:

```
checkInputs = [ unittestCheckHook ];
nativeCheckInputs = [ unittestCheckHook ];

unittestFlags = [ "-s" "tests" "-v" ];
```
Expand Down Expand Up @@ -1006,7 +1006,7 @@ buildPythonPackage rec {
rm testing/test_argcomplete.py
'';

checkInputs = [ hypothesis ];
nativeCheckInputs = [ hypothesis ];
nativeBuildInputs = [ setuptools-scm ];
propagatedBuildInputs = [ attrs py setuptools six pluggy ];

Expand All @@ -1028,7 +1028,7 @@ The `buildPythonPackage` mainly does four things:
* In the `installCheck` phase, `${python.interpreter} setup.py test` is run.

By default tests are run because `doCheck = true`. Test dependencies, like
e.g. the test runner, should be added to `checkInputs`.
e.g. the test runner, should be added to `nativeCheckInputs`.

By default `meta.platforms` is set to the same value
as the interpreter unless overridden otherwise.
Expand Down Expand Up @@ -1082,7 +1082,7 @@ because their behaviour is different:
* `buildInputs ? []`: Build and/or run-time dependencies that need to be
compiled for the host machine. Typically non-Python libraries which are being
linked.
* `checkInputs ? []`: Dependencies needed for running the `checkPhase`. These
* `nativeCheckInputs ? []`: Dependencies needed for running the `checkPhase`. These
are added to `nativeBuildInputs` when `doCheck = true`. Items listed in
`tests_require` go here.
* `propagatedBuildInputs ? []`: Aside from propagating dependencies,
Expand Down Expand Up @@ -1416,7 +1416,7 @@ example of such a situation is when `py.test` is used.
buildPythonPackage {
# ...
# assumes the tests are located in tests
checkInputs = [ pytest ];
nativeCheckInputs = [ pytest ];
checkPhase = ''
runHook preCheck

Expand Down Expand Up @@ -1768,7 +1768,7 @@ In a `setup.py` or `setup.cfg` it is common to declare dependencies:

* `setup_requires` corresponds to `nativeBuildInputs`
* `install_requires` corresponds to `propagatedBuildInputs`
* `tests_require` corresponds to `checkInputs`
* `tests_require` corresponds to `nativeCheckInputs`

## Contributing {#contributing}

Expand Down
12 changes: 10 additions & 2 deletions doc/stdenv/stdenv.chapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,11 @@ A list of strings passed as additional flags to `make`. Like `makeFlags` and `ma

##### `checkInputs` {#var-stdenv-checkInputs}

A list of dependencies used by the phase. This gets included in `nativeBuildInputs` when `doCheck` is set.
A list of host dependencies used by the phase, usually libraries linked into executables built during tests. This gets included in `buildInputs` when `doCheck` is set.

##### `nativeCheckInputs` {#var-stdenv-nativeCheckInputs}

A list of native dependencies used by the phase, notably tools needed on `$PATH`. This gets included in `nativeBuildInputs` when `doCheck` is set.

##### `preCheck` {#var-stdenv-preCheck}

Expand Down Expand Up @@ -821,7 +825,11 @@ A list of strings passed as additional flags to `make`. Like `makeFlags` and `ma

##### `installCheckInputs` {#var-stdenv-installCheckInputs}

A list of dependencies used by the phase. This gets included in `nativeBuildInputs` when `doInstallCheck` is set.
A list of host dependencies used by the phase, usually libraries linked into executables built during tests. This gets included in `buildInputs` when `doInstallCheck` is set.

##### `nativeInstallCheckInputs` {#var-stdenv-nativeInstallCheckInputs}

A list of native dependencies used by the phase, notably tools needed on `$PATH`. This gets included in `nativeBuildInputs` when `doInstallCheck` is set.

##### `preInstallCheck` {#var-stdenv-preInstallCheck}

Expand Down
24 changes: 24 additions & 0 deletions nixos/doc/manual/from_md/release-notes/rl-2305.section.xml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,30 @@
instead.
</para>
</listitem>
<listitem>
<para>
<literal>checkInputs</literal> have been renamed to
<literal>nativeCheckInputs</literal>, because they behave the
same as <literal>nativeBuildInputs</literal> when
<literal>doCheck</literal> is set.
<literal>checkInputs</literal> now denote a new type of
dependencies, added to <literal>buildInputs</literal> when
<literal>doCheck</literal> is set. As a rule of thumb,
<literal>nativeCheckInputs</literal> are tools on
<literal>$PATH</literal> used during the tests, and
<literal>checkInputs</literal> are libraries which are linked
to executables built as part of the tests. Similarly,
<literal>installCheckInputs</literal> are renamed to
<literal>nativeInstallCheckInputs</literal>, corresponding to
<literal>nativeBuildInputs</literal>, and
<literal>installCheckInputs</literal> are a new type of
dependencies added to <literal>buildInputs</literal> when
<literal>doInstallCheck</literal> is set. (Note that this
change will not cause breakage to derivations with
<literal>strictDeps</literal> unset, which are most packages
except python, rust and go packages).
</para>
</listitem>
<listitem>
<para>
<literal>borgbackup</literal> module now has an option for
Expand Down
2 changes: 2 additions & 0 deletions nixos/doc/manual/release-notes/rl-2305.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ In addition to numerous new and upgraded packages, this release has the followin

- `carnix` and `cratesIO` has been removed due to being unmaintained, use alternatives such as [naersk](https://github.com/nix-community/naersk) and [crate2nix](https://github.com/kolloch/crate2nix) instead.

- `checkInputs` have been renamed to `nativeCheckInputs`, because they behave the same as `nativeBuildInputs` when `doCheck` is set. `checkInputs` now denote a new type of dependencies, added to `buildInputs` when `doCheck` is set. As a rule of thumb, `nativeCheckInputs` are tools on `$PATH` used during the tests, and `checkInputs` are libraries which are linked to executables built as part of the tests. Similarly, `installCheckInputs` are renamed to `nativeInstallCheckInputs`, corresponding to `nativeBuildInputs`, and `installCheckInputs` are a new type of dependencies added to `buildInputs` when `doInstallCheck` is set. (Note that this change will not cause breakage to derivations with `strictDeps` unset, which are most packages except python, rust and go packages).

- `borgbackup` module now has an option for inhibiting system sleep while backups are running, defaulting to off (not inhibiting sleep), available as [`services.borgbackup.jobs.<name>.inhibitsSleep`](#opt-services.borgbackup.jobs._name_.inhibitsSleep).

- `podman` now uses the `netavark` network stack. Users will need to delete all of their local containers, images, volumes, etc, by running `podman system reset --force` once before upgrading their systems.
Expand Down
2 changes: 1 addition & 1 deletion nixos/lib/test-driver/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ python3Packages.buildPythonApplication rec {
++ extraPythonPackages python3Packages;

doCheck = true;
checkInputs = with python3Packages; [ mypy pylint black ];
nativeCheckInputs = with python3Packages; [ mypy pylint black ];
checkPhase = ''
mypy --disallow-untyped-defs \
--no-implicit-optional \
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/audio/exaile/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ stdenv.mkDerivation rec {
++ lib.optional podcastSupport python3.pkgs.feedparser
++ lib.optional wikipediaSupport webkitgtk;

checkInputs = with python3.pkgs; [
nativeCheckInputs = with python3.pkgs; [
pytest
];

Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/audio/gpodder/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ python3Packages.buildPythonApplication rec {
gnome.adwaita-icon-theme
];

checkInputs = with python3Packages; [
nativeCheckInputs = with python3Packages; [
minimock
pytest
pytest-httpserver
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/audio/midisheetmusic/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ in stdenv.mkDerivation {
sha256 = "05c6zskj50g29f51lx8fvgzsi3f31z01zj6ssjjrgr7jfs7ak70p";
};

checkInputs = (with dotnetPackages; [ NUnitConsole ]);
nativeCheckInputs = (with dotnetPackages; [ NUnitConsole ]);
nativeBuildInputs = [ mono makeWrapper ];

buildPhase = ''
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/audio/mmlgui/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ stdenv.mkDerivation rec {
Cocoa
];

checkInputs = [
nativeCheckInputs = [
cppunit
];

Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/audio/mopidy/local.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ python3Packages.buildPythonApplication rec {
python3Packages.uritools
];

checkInputs = [
nativeCheckInputs = [
python3Packages.pytestCheckHook
];

Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/audio/mopidy/podcast.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ python3Packages.buildPythonApplication rec {
python3Packages.uritools
];

checkInputs = with python3Packages; [
nativeCheckInputs = with python3Packages; [
pytestCheckHook
];

Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/audio/mopidy/subidy.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pythonPackages.buildPythonApplication rec {

propagatedBuildInputs = [ mopidy pythonPackages.py-sonic ];

checkInputs = with pythonPackages; [ pytestCheckHook ];
nativeCheckInputs = with pythonPackages; [ pytestCheckHook ];

meta = with lib; {
homepage = "https://www.mopidy.com/";
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/audio/mopidy/tidal.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ python3Packages.buildPythonApplication rec {
python3Packages.tidalapi
];

checkInputs = with python3Packages; [
nativeCheckInputs = with python3Packages; [
pytestCheckHook
pytest-mock
];
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/audio/mopidy/youtube.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ python3.pkgs.buildPythonApplication rec {
mopidy
];

checkInputs = with python3.pkgs; [
nativeCheckInputs = with python3.pkgs; [
vcrpy
pytestCheckHook
];
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/audio/opustags/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ stdenv.mkDerivation rec {

doCheck = true;

checkInputs = [ ffmpeg glibcLocales perl ] ++ (with perlPackages; [ ListMoreUtils ]);
nativeCheckInputs = [ ffmpeg glibcLocales perl ] ++ (with perlPackages; [ ListMoreUtils ]);

checkPhase = ''
export LANG="en_US.UTF-8"
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/audio/quodlibet/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ python3.pkgs.buildPythonApplication rec {

LC_ALL = "en_US.UTF-8";

checkInputs = [
nativeCheckInputs = [
dbus
gdk-pixbuf
glibcLocales
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/audio/r128gain/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ python3Packages.buildPythonApplication rec {
];

propagatedBuildInputs = with python3Packages; [ crcmod ffmpeg-python mutagen tqdm ];
checkInputs = with python3Packages; [ requests sox ];
nativeCheckInputs = with python3Packages; [ requests sox ];

# Testing downloads media files for testing, which requires the
# sandbox to be disabled.
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/audio/radiotray-ng/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ stdenv.mkDerivation rec {
"-DBUILD_TESTS=${if doCheck then "ON" else "OFF"}"
];

checkInputs = [ gtest ];
nativeCheckInputs = [ gtest ];
doCheck = !stdenv.isAarch64; # single failure that I can't explain

preFixup = ''
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/audio/rhythmbox/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ stdenv.mkDerivation rec {
libnotify
] ++ gst_plugins;

checkInputs = [
nativeCheckInputs = [
check
];

Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/audio/sonic-pi/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ stdenv.mkDerivation rec {
fmt
];

checkInputs = [
nativeCheckInputs = [
parallel
ruby
supercollider-with-sc3-plugins
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/audio/soundconverter/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ python3Packages.buildPythonApplication rec {
python3Packages.pygobject3
];

checkInputs = [
nativeCheckInputs = [
xvfb-run
];

Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/audio/sublime-music/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ python3Packages.buildPythonApplication rec {
# https://github.com/NixOS/nixpkgs/issues/56943
strictDeps = false;

checkInputs = with python3Packages; [
nativeCheckInputs = with python3Packages; [
pytest
];

Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/audio/whipper/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ in python3.pkgs.buildPythonApplication rec {

buildInputs = [ libsndfile ];

checkInputs = with python3.pkgs; [
nativeCheckInputs = with python3.pkgs; [
twisted
] ++ bins;

Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/audio/zynaddsubfx/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ in stdenv.mkDerivation rec {
++ lib.optional (guiModule == "fltk") "-DFLTK_SKIP_OPENGL=ON";

doCheck = true;
checkInputs = [ cxxtest ruby ];
nativeCheckInputs = [ cxxtest ruby ];

# TODO: Update cmake hook to make it simpler to selectively disable cmake tests: #113829
checkPhase = let
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/backup/unifi-protect-backup/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ python3.pkgs.buildPythonApplication rec {
pyunifiprotect
];

checkInputs = with python3.pkgs; [
nativeCheckInputs = with python3.pkgs; [
pytestCheckHook
];

Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/backup/vorta/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ python3Packages.buildPythonApplication rec {
)
'';

checkInputs = with python3Packages; [
nativeCheckInputs = with python3Packages; [
pytest-qt
pytest-mock
pytestCheckHook
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/blockchains/bitcoin-knots/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ stdenv.mkDerivation rec {
"--with-qt-bindir=${qtbase.dev}/bin:${qttools.dev}/bin"
];

checkInputs = [ python3 ];
nativeCheckInputs = [ python3 ];

doCheck = true;

Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/blockchains/bitcoin/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ stdenv.mkDerivation rec {
"--with-qt-bindir=${qtbase.dev}/bin:${qttools.dev}/bin"
];

checkInputs = [ python3 ];
nativeCheckInputs = [ python3 ];

doCheck = true;

Expand Down
Loading