Skip to content

Commit

Permalink
buildDunePackage: default to strictDeps = true
Browse files Browse the repository at this point in the history
  • Loading branch information
ulrikstrid committed Feb 3, 2023
1 parent 376e9ce commit f12b9ea
Show file tree
Hide file tree
Showing 44 changed files with 26 additions and 89 deletions.
17 changes: 16 additions & 1 deletion nixos/doc/manual/from_md/release-notes/rl-2305.section.xml
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,22 @@
<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).
except python, rust, ocaml and go packages).
</para>
</listitem>
<listitem>
<para>
<literal>buildDunePackage</literal> now defaults to
<literal>strictDeps = true</literal> which means that any
library should go into <literal>buildInputs</literal> or
<literal>checkInputs</literal>. Any executable that is run on
the building machine should go into
<literal>nativeBuildInputs</literal> or
<literal>nativeCheckInputs</literal> respectively. Example of
executables are <literal>ocaml</literal>,
<literal>findlib</literal> and <literal>menhir</literal>. PPXs
are libraries which are built by dune and should therefore not
go into <literal>nativeBuildInputs</literal>.
</para>
</listitem>
<listitem>
Expand Down
4 changes: 3 additions & 1 deletion nixos/doc/manual/release-notes/rl-2305.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ 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).
- `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, ocaml and go packages).

- `buildDunePackage` now defaults to `strictDeps = true` which means that any library should go into `buildInputs` or `checkInputs`. Any executable that is run on the building machine should go into `nativeBuildInputs` or `nativeCheckInputs` respectively. Example of executables are `ocaml`, `findlib` and `menhir`. PPXs are libraries which are built by dune and should therefore not go into `nativeBuildInputs`.

- `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).

Expand Down
2 changes: 2 additions & 0 deletions pkgs/build-support/ocaml/dune.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ stdenv.mkDerivation ({
runHook postInstall
'';

strictDeps = true;

} // (builtins.removeAttrs args [ "minimalOCamlVersion" "duneVersion" ]) // {

name = "ocaml${ocaml.version}-${pname}-${version}";
Expand Down
1 change: 0 additions & 1 deletion pkgs/development/ocaml-modules/atdgen/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ buildDunePackage {

propagatedBuildInputs = [ atdgen-runtime ];

strictDeps = true;
doCheck = true;
nativeCheckInputs = [ atd (python3.withPackages (ps: [ ps.jsonschema ]))];
checkInputs = [ alcotest atdgen-codec-runtime ];
Expand Down
2 changes: 0 additions & 2 deletions pkgs/development/ocaml-modules/bigarray-overlap/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ buildDunePackage rec {
minimumOCamlVersion = "4.07";
useDune2 = true;

strictDeps = true;

propagatedBuildInputs = [ bigarray-compat ];

nativeBuildInputs = [ findlib pkg-config ];
Expand Down
2 changes: 0 additions & 2 deletions pkgs/development/ocaml-modules/biniou/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ buildDunePackage rec {

propagatedBuildInputs = [ camlp-streams easy-format ];

strictDeps = true;

meta = {
description = "Binary data format designed for speed, safety, ease of use and backward compatibility as protocols evolve";
homepage = "https://github.com/ocaml-community/biniou";
Expand Down
2 changes: 0 additions & 2 deletions pkgs/development/ocaml-modules/bitv/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ stdenv.mkDerivation rec {

nativeBuildInputs = [ autoreconfHook which ocaml findlib ];

strictDeps = true;

createFindlibDestdir = true;

meta = {
Expand Down
2 changes: 0 additions & 2 deletions pkgs/development/ocaml-modules/calendar/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ buildDunePackage rec {

propagatedBuildInputs = [ re ];

strictDeps = true;

meta = {
inherit (src.meta) homepage;
description = "A library for handling dates and times";
Expand Down
2 changes: 0 additions & 2 deletions pkgs/development/ocaml-modules/camlimages/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ buildDunePackage rec {
sha256 = "1m2c76ghisg73dikz2ifdkrbkgiwa0hcmp21f2fm2rkbf02rq3f4";
};

strictDeps = true;

nativeBuildInputs = [ cppo ];
buildInputs = [ dune-configurator graphics lablgtk stdio ];

Expand Down
2 changes: 0 additions & 2 deletions pkgs/development/ocaml-modules/camomile/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ buildDunePackage rec {

nativeBuildInputs = [ cppo ];

strictDeps = true;

configurePhase = ''
runHook preConfigure
ocaml configure.ml --share $out/share/camomile
Expand Down
5 changes: 2 additions & 3 deletions pkgs/development/ocaml-modules/cfstream/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@ buildDunePackage rec {

patches = [ ./git_commit.patch ];

# This currently fails with dune
strictDeps = false;
strictDeps = true;

nativeBuildInputs = [ m4 ];
nativeCheckInputs = [ ounit ];
checkInputs = [ ounit ];
propagatedBuildInputs = [ core_kernel ];

doCheck = true;
Expand Down
2 changes: 0 additions & 2 deletions pkgs/development/ocaml-modules/coin/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ buildDunePackage rec {
nativeBuildInputs = [ findlib ];
buildInputs = [ re ];

strictDeps = true;

doCheck = true;

meta = {
Expand Down
2 changes: 0 additions & 2 deletions pkgs/development/ocaml-modules/digestif/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ buildDunePackage rec {
sha256 = "sha256-edNM5ROxFIV+OAqr328UcyGPGwXdflHQOJB3ntAbRmY=";
};

strictDeps = true;

nativeBuildInputs = [ findlib which ocaml pkg-config ];

propagatedBuildInputs = [ eqaf ];
Expand Down
4 changes: 0 additions & 4 deletions pkgs/development/ocaml-modules/dolmen/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,13 @@ buildDunePackage rec {
pname = "dolmen";
version = "0.6";

useDune2 = true;

minimalOCamlVersion = "4.08";

src = fetchurl {
url = "https://github.com/Gbury/dolmen/releases/download/v${version}/dolmen-v${version}.tbz";
sha256 = "133l23mwxa9xy340izvk4zp5jqjz2cwsm2innsgs2kg85pd39c41";
};

strictDeps = true;

nativeBuildInputs = [ menhir ];
propagatedBuildInputs = [ menhirLib fmt ];

Expand Down
3 changes: 0 additions & 3 deletions pkgs/development/ocaml-modules/gen/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,8 @@ buildDunePackage rec {
hash = "sha256-YWoVcl2TQoMIgU1LoKL16ia31zJjwAMwuphtSXnhtvw=";
};

strictDeps = true;

buildInputs = [ dune-configurator ];
propagatedBuildInputs = [ seq ];
nativeCheckInputs = [ qcheck ounit2 ];
checkInputs = [ qcheck ounit2 ];

doCheck = lib.versionAtLeast ocaml.version "4.08";
Expand Down
2 changes: 0 additions & 2 deletions pkgs/development/ocaml-modules/graphql_ppx/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ buildDunePackage rec {
sha256 = "sha256-+WJhA2ixZHiSZBoX14dnQKk7JfVAIME4JooNSnhRp44=";
};

strictDeps = true;

nativeBuildInputs = [ reason ];

buildInputs = [ ppxlib reason ];
Expand Down
2 changes: 0 additions & 2 deletions pkgs/development/ocaml-modules/happy-eyeballs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ buildDunePackage rec {
hash = "sha256-gR9q4J/DnYJz8oYmk/wy17h4F6wxbllba/gkor5i1nQ=";
};

strictDeps = true;

propagatedBuildInputs = [
domain-name
duration
Expand Down
2 changes: 0 additions & 2 deletions pkgs/development/ocaml-modules/happy-eyeballs/lwt.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ buildDunePackage {
minimalOCamlVersion = "4.08";
duneVersion = "3";

strictDeps = true;

buildInputs = [
cmdliner
duration
Expand Down
2 changes: 0 additions & 2 deletions pkgs/development/ocaml-modules/happy-eyeballs/mirage.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ buildDunePackage {
minimalOCamlVersion = "4.08";
duneVersion = "3";

strictDeps = true;

buildInputs = [
duration
ipaddr
Expand Down
2 changes: 0 additions & 2 deletions pkgs/development/ocaml-modules/hidapi/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ buildDunePackage rec {
sha256 = "1j7rd7ajrzla76r3sxljx6fb18f4f4s3jd7vhv59l2ilxyxycai2";
};

strictDeps = true;

minimumOCamlVersion = "4.03";

nativeBuildInputs = [ pkg-config ];
Expand Down
2 changes: 0 additions & 2 deletions pkgs/development/ocaml-modules/inotify/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ buildDunePackage rec {

checkInputs = [ ounit2 fileutils ];

strictDeps = true;

doCheck = true;

meta = {
Expand Down
2 changes: 0 additions & 2 deletions pkgs/development/ocaml-modules/irmin/ppx.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ buildDunePackage rec {

minimalOCamlVersion = "4.10";

strictDeps = false; # We must provide nativeCheckInputs as buildInputs because dune builds tests at build time

propagatedBuildInputs = [
ppx_repr
ppxlib
Expand Down
4 changes: 1 addition & 3 deletions pkgs/development/ocaml-modules/janestreet/0.15.nix
Original file line number Diff line number Diff line change
Expand Up @@ -958,9 +958,7 @@ with self;
meta.description = "Yet another implementation of fork&exec and related functionality";
buildInputs = [ jst-config ];
propagatedBuildInputs = [ textutils ];
nativeCheckInputs = [ ounit ];
# This currently fails with dune
strictDeps = false;
checkInputs = [ ounit ];
};

shexp = janePackage {
Expand Down
2 changes: 0 additions & 2 deletions pkgs/development/ocaml-modules/janestreet/janePackage.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ buildDunePackage (args // {
sha256 = hash;
};

strictDeps = true;

meta = {
license = lib.licenses.asl20;
homepage = "https://github.com/janestreet/${pname}";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ buildDunePackage (args // {
sha256 = hash;
};

strictDeps = true;

meta = {
license = lib.licenses.mit;
homepage = "https://github.com/janestreet/${pname}";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@
, minimumOCamlVersion ? "4.08"
, doCheck ? true
, buildInputs ? []
, strictDeps ? true
, ...}@args:

buildDunePackage (args // {
useDune2 = true;
inherit version buildInputs strictDeps;
inherit version buildInputs;

inherit minimumOCamlVersion;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@
, minimumOCamlVersion ? "4.11"
, doCheck ? true
, buildInputs ? []
, strictDeps ? true
, ...}@args:

buildDunePackage (args // {
useDune2 = true;
inherit version buildInputs strictDeps;
inherit version buildInputs;

inherit minimumOCamlVersion;

Expand Down
2 changes: 0 additions & 2 deletions pkgs/development/ocaml-modules/lambda-term/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ buildDunePackage rec {

duneVersion = if lib.versionAtLeast ocaml.version "4.08" then "3" else "2";

strictDeps = true;

src = fetchFromGitHub {
owner = "ocaml-community";
repo = pname;
Expand Down
2 changes: 0 additions & 2 deletions pkgs/development/ocaml-modules/lwt/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ buildDunePackage rec {
sha256 = "sha256-XstKs0tMwliCyXnP0Vzi5WC27HKJGnATUYtbbQmH1TE=";
};

strictDeps = true;

nativeBuildInputs = [ cppo ];
buildInputs = [ dune-configurator ];
propagatedBuildInputs = [ libev ocplib-endian ];
Expand Down
2 changes: 0 additions & 2 deletions pkgs/development/ocaml-modules/merlin-extend/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ buildDunePackage rec {
sha256 = "0hvc4mz92x3rl2dxwrhvhzwl4gilnyvvwcqgr45vmdpyjyp3dwn2";
};

strictDeps = true;

nativeBuildInputs = [ cppo ];

meta = with lib; {
Expand Down
2 changes: 0 additions & 2 deletions pkgs/development/ocaml-modules/mirage-crypto/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ buildDunePackage rec {
ocaml-freestanding
];

strictDeps = true;

meta = with lib; {
homepage = "https://github.com/mirage/mirage-crypto";
description = "Simple symmetric cryptography for the modern age";
Expand Down
2 changes: 0 additions & 2 deletions pkgs/development/ocaml-modules/mirage-crypto/pk.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ buildDunePackage rec {
propagatedBuildInputs = [ cstruct mirage-crypto mirage-crypto-rng
zarith eqaf sexplib0 ];

strictDeps = true;

doCheck = true;
checkInputs = [ ounit2 randomconv ];

Expand Down
2 changes: 0 additions & 2 deletions pkgs/development/ocaml-modules/mirage-crypto/rng-mirage.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ buildDunePackage rec {
propagatedBuildInputs = [ duration cstruct mirage-crypto-rng mirage-runtime
mirage-time mirage-clock logs lwt ];

strictDeps = true;

meta = mirage-crypto-rng.meta // {
description = "Entropy collection for a cryptographically secure PRNG";
};
Expand Down
3 changes: 0 additions & 3 deletions pkgs/development/ocaml-modules/ocamlfuse/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ buildDunePackage rec {
sha256 = "6nmPXZx38hBGlg+gV9nnlRpPfeSAqDj4zBPcjUNvTRo=";
};

# This currently fails with dune
strictDeps = false;

nativeBuildInputs = [ camlidl ];
buildInputs = [ dune-configurator ];
propagatedBuildInputs = [ camlidl fuse ];
Expand Down
2 changes: 0 additions & 2 deletions pkgs/development/ocaml-modules/odate/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ buildDunePackage rec {
sha256 = "1dk33lr0g2jnia2gqsm6nnc7nf256qgkm3v30w477gm6y2ppfm3h";
};

strictDeps = true;

nativeBuildInputs = [ menhir ];

# Ensure compatibility of v0.6 with menhir ≥ 20220210
Expand Down
2 changes: 0 additions & 2 deletions pkgs/development/ocaml-modules/otoml/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ buildDunePackage rec {
sha256 = "sha256-Xd3fHBN1f+tvgRFCxD/Gz8/lIvezknz7Zy3EtdqoTEM=";
};

strictDeps = true;

nativeBuildInputs = [ menhir ];

propagatedBuildInputs = [ menhirLib uutf ];
Expand Down
2 changes: 0 additions & 2 deletions pkgs/development/ocaml-modules/ppx_cstubs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ buildDunePackage rec {
ctypes
];

strictDeps = true;

meta = with lib; {
homepage = "https://github.com/fdopen/ppx_cstubs";
changelog = "https://github.com/fdopen/ppx_cstubs/raw/${version}/CHANGES.md";
Expand Down
2 changes: 0 additions & 2 deletions pkgs/development/ocaml-modules/ppx_tools/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ then
inherit pname src meta;
inherit (param) version buildInputs nativeBuildInputs;
duneVersion = "3";

strictDeps = true;
}
else
stdenv.mkDerivation {
Expand Down
2 changes: 0 additions & 2 deletions pkgs/development/ocaml-modules/psmt2-frontend/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ buildDunePackage rec {

minimalOCamlVersion = "4.03";

strictDeps = true;

nativeBuildInputs = [ menhir ];

meta = {
Expand Down
Loading

0 comments on commit f12b9ea

Please sign in to comment.