From 6d54fe622d9fb31c7c08c832522bf46ffb79ea27 Mon Sep 17 00:00:00 2001 From: Artturin Date: Sun, 15 May 2022 19:25:41 +0300 Subject: [PATCH 1/2] stdenv: start deprecating non-list configureFlags the motivation for this is to simplify stdenv and ease the job of reviewers due to them needing to tell contributors about the defacto rule that configureFlags should be a list of strings --- pkgs/stdenv/generic/make-derivation.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index cfed6d197cf0..ed457019c558 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -331,8 +331,8 @@ else let # This parameter is sometimes a string, sometimes null, and sometimes a list, yuck configureFlags = let inherit (lib) optional elem; in - (/**/ if lib.isString configureFlags then [configureFlags] - else if configureFlags == null then [] + (/**/ if lib.isString configureFlags then lib.warn "String 'configureFlags' is deprecated and will be removed in release 23.05. Please use a list of strings. Derivation name: ${derivationArg.name}, file: ${pos.file or "unknown file"}" [configureFlags] + else if configureFlags == null then lib.warn "Null 'configureFlags' is deprecated and will be removed in release 23.05. Please use a empty list instead '[]'. Derivation name: ${derivationArg.name}, file: ${pos.file or "unknown file"}" [] else configureFlags) ++ optional (elem "build" configurePlatforms) "--build=${stdenv.buildPlatform.config}" ++ optional (elem "host" configurePlatforms) "--host=${stdenv.hostPlatform.config}" From cf7476804a3f29e446a5aece77e60b64d15182c5 Mon Sep 17 00:00:00 2001 From: Artturin Date: Mon, 16 May 2022 21:46:33 +0300 Subject: [PATCH 2/2] treewide: convert string configureFlags to list of strings --- pkgs/applications/audio/ecasound/default.nix | 2 +- pkgs/applications/science/logic/alt-ergo/default.nix | 6 +++--- pkgs/development/ocaml-modules/stdcompat/default.nix | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/applications/audio/ecasound/default.nix b/pkgs/applications/audio/ecasound/default.nix index 108be8726c50..f23b11d1a67e 100644 --- a/pkgs/applications/audio/ecasound/default.nix +++ b/pkgs/applications/audio/ecasound/default.nix @@ -60,7 +60,7 @@ stdenv.mkDerivation rec { strictDeps = true; CXXFLAGS = "-std=c++11"; - configureFlags = "--enable-liblilv --with-extra-cppflags=-Dnullptr=0"; + configureFlags = [ "--enable-liblilv" "--with-extra-cppflags=-Dnullptr=0" ]; postPatch = '' sed -i -e ' diff --git a/pkgs/applications/science/logic/alt-ergo/default.nix b/pkgs/applications/science/logic/alt-ergo/default.nix index 096a648b4ddf..0767c58bdea1 100644 --- a/pkgs/applications/science/logic/alt-ergo/default.nix +++ b/pkgs/applications/science/logic/alt-ergo/default.nix @@ -17,7 +17,7 @@ in let alt-ergo-lib = ocamlPackages.buildDunePackage rec { pname = "alt-ergo-lib"; inherit version src useDune2; - configureFlags = pname; + configureFlags = [ pname ]; nativeBuildInputs = [ which ]; buildInputs = with ocamlPackages; [ dune-configurator ]; propagatedBuildInputs = with ocamlPackages; [ num ocplib-simplex stdlib-shims zarith ]; @@ -26,7 +26,7 @@ let alt-ergo-lib = ocamlPackages.buildDunePackage rec { let alt-ergo-parsers = ocamlPackages.buildDunePackage rec { pname = "alt-ergo-parsers"; inherit version src useDune2; - configureFlags = pname; + configureFlags = [ pname ]; nativeBuildInputs = [ which ocamlPackages.menhir ]; propagatedBuildInputs = [ alt-ergo-lib ] ++ (with ocamlPackages; [ camlzip psmt2-frontend ]); }; in @@ -35,7 +35,7 @@ ocamlPackages.buildDunePackage { inherit pname version src useDune2; - configureFlags = pname; + configureFlags = [ pname ]; nativeBuildInputs = [ which ocamlPackages.menhir ]; buildInputs = [ alt-ergo-parsers ocamlPackages.cmdliner ]; diff --git a/pkgs/development/ocaml-modules/stdcompat/default.nix b/pkgs/development/ocaml-modules/stdcompat/default.nix index eae9b264ba1f..3630be368e55 100644 --- a/pkgs/development/ocaml-modules/stdcompat/default.nix +++ b/pkgs/development/ocaml-modules/stdcompat/default.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { # build fails otherwise enableParallelBuilding = false; - configureFlags = "--libdir=$(OCAMLFIND_DESTDIR)"; + configureFlags = [ "--libdir=$(OCAMLFIND_DESTDIR)" ]; meta = { homepage = "https://github.com/thierry-martinez/stdcompat";