From 08ce0156e4775da2b530914a16022c1ac9d3047c Mon Sep 17 00:00:00 2001 From: Ben Siraphob Date: Sat, 30 Jan 2021 17:19:29 +0700 Subject: [PATCH 1/6] pleroma-otp: stdenv.lib -> lib --- pkgs/servers/pleroma-otp/default.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkgs/servers/pleroma-otp/default.nix b/pkgs/servers/pleroma-otp/default.nix index e66ae693a0e..4905acd0757 100644 --- a/pkgs/servers/pleroma-otp/default.nix +++ b/pkgs/servers/pleroma-otp/default.nix @@ -1,4 +1,5 @@ -{ stdenv +{ lib +, stdenv , autoPatchelfHook , fetchurl , file @@ -60,11 +61,11 @@ stdenv.mkDerivation { pleroma = nixosTests.pleroma; }; - meta = { + meta = with lib; { description = "ActivityPub microblogging server"; homepage = https://git.pleroma.social/pleroma/pleroma; - license = stdenv.lib.licenses.agpl3; - maintainers = with stdenv.lib.maintainers; [ ninjatrappeur ]; + license = licenses.agpl3; + maintainers = with maintainers; [ ninjatrappeur ]; platforms = [ "x86_64-linux" "aarch64-linux" ]; }; } From 7ff2c85a8ee2e5122c9b0c51946d9470a527223e Mon Sep 17 00:00:00 2001 From: Ben Siraphob Date: Sat, 30 Jan 2021 17:19:44 +0700 Subject: [PATCH 2/6] cargo-valgrind: stdenv.lib -> lib --- pkgs/development/tools/rust/cargo-valgrind/default.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkgs/development/tools/rust/cargo-valgrind/default.nix b/pkgs/development/tools/rust/cargo-valgrind/default.nix index 138fc060568..50cffe74848 100644 --- a/pkgs/development/tools/rust/cargo-valgrind/default.nix +++ b/pkgs/development/tools/rust/cargo-valgrind/default.nix @@ -1,4 +1,5 @@ -{ stdenv +{ lib +, stdenv , rustPlatform , fetchFromGitHub , nix-update-script @@ -30,10 +31,10 @@ rustPlatform.buildRustPackage rec { nativeBuildInputs = [ makeWrapper ]; postInstall = '' - wrapProgram $out/bin/cargo-valgrind --prefix PATH : ${stdenv.lib.makeBinPath [ valgrind ]} + wrapProgram $out/bin/cargo-valgrind --prefix PATH : ${lib.makeBinPath [ valgrind ]} ''; - meta = with stdenv.lib; { + meta = with lib; { description = ''Cargo subcommand "valgrind": runs valgrind and collects its output in a helpful manner''; homepage = "https://github.com/jfrimmel/cargo-valgrind"; license = with licenses; [ asl20 /* or */ mit ]; From 9071feb01d79d4e9a42a485f72bc5cb325baf8dc Mon Sep 17 00:00:00 2001 From: Ben Siraphob Date: Sat, 30 Jan 2021 17:19:55 +0700 Subject: [PATCH 3/6] hspell: stdenv.lib -> lib --- pkgs/development/libraries/hspell/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/development/libraries/hspell/default.nix b/pkgs/development/libraries/hspell/default.nix index 67e593d27f4..2a65afad809 100644 --- a/pkgs/development/libraries/hspell/default.nix +++ b/pkgs/development/libraries/hspell/default.nix @@ -16,15 +16,15 @@ stdenv.mkDerivation rec { }; patchPhase = "patchShebangs ."; - preBuild = stdenv.lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' + preBuild = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' make CC=${buildPackages.stdenv.cc}/bin/cc find_sizes mv find_sizes find_sizes_build make clean substituteInPlace Makefile --replace "./find_sizes" "./find_sizes_build" - substituteInPlace Makefile --replace "ar cr" "${stdenv.lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}ar cr" - substituteInPlace Makefile --replace "ranlib" "${stdenv.lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}ranlib" - substituteInPlace Makefile --replace "STRIP=strip" "STRIP=${stdenv.lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}strip" + substituteInPlace Makefile --replace "ar cr" "${lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}ar cr" + substituteInPlace Makefile --replace "ranlib" "${lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}ranlib" + substituteInPlace Makefile --replace "STRIP=strip" "STRIP=${lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}strip" ''; nativeBuildInputs = [ perl zlib ]; # buildInputs = [ zlib ]; From 32e8cec5d9be7963c3cc23541c2679a4a5989348 Mon Sep 17 00:00:00 2001 From: Ben Siraphob Date: Sat, 30 Jan 2021 17:23:49 +0700 Subject: [PATCH 4/6] stdenv: warn about use of inherited lib --- pkgs/stdenv/generic/default.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix index c7c3bb9f3f3..125eff9aec5 100644 --- a/pkgs/stdenv/generic/default.nix +++ b/pkgs/stdenv/generic/default.nix @@ -152,9 +152,12 @@ let inherit lib config stdenv; }) mkDerivation; - # For convenience, bring in the library functions in lib/ so - # packages don't have to do that themselves. - inherit lib; + # Slated for deprecation in 21.11 + lib = builtins.trace ( "Warning: `stdenv.lib` is deprecated " + + "and will be removed in the next release. " + + "Please use `pkgs.lib` instead. " + + "For more information see https://github.com/NixOS/nixpkgs/issues/108938") + lib; inherit fetchurlBoot; From 0fa48587917c6ed7be02aba4d76ca126c69407a9 Mon Sep 17 00:00:00 2001 From: Ben Siraphob Date: Sat, 30 Jan 2021 20:26:37 +0700 Subject: [PATCH 5/6] release-notes/rl-2103: mention deprecation of stdenv.lib --- nixos/doc/manual/release-notes/rl-2103.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/nixos/doc/manual/release-notes/rl-2103.xml b/nixos/doc/manual/release-notes/rl-2103.xml index 24a0281310c..235b9ba1ed9 100644 --- a/nixos/doc/manual/release-notes/rl-2103.xml +++ b/nixos/doc/manual/release-notes/rl-2103.xml @@ -477,6 +477,14 @@ self: super: Other Notable Changes + + + stdenv.lib has been deprecated and will break + eval in 21.11. Please use pkgs.lib instead. + See #108938 + for details. + + The Mailman NixOS module (services.mailman) has a new From 227693ed69a03605d7b9d5e051f2158aaf8cbe3c Mon Sep 17 00:00:00 2001 From: Ben Siraphob Date: Sun, 31 Jan 2021 03:03:11 +0000 Subject: [PATCH 6/6] Update pkgs/stdenv/generic/default.nix Co-authored-by: John Ericson --- pkgs/stdenv/generic/default.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix index 125eff9aec5..52d57a6dece 100644 --- a/pkgs/stdenv/generic/default.nix +++ b/pkgs/stdenv/generic/default.nix @@ -153,11 +153,11 @@ let }) mkDerivation; # Slated for deprecation in 21.11 - lib = builtins.trace ( "Warning: `stdenv.lib` is deprecated " - + "and will be removed in the next release. " - + "Please use `pkgs.lib` instead. " - + "For more information see https://github.com/NixOS/nixpkgs/issues/108938") - lib; + lib = builtins.trace + ( "Warning: `stdenv.lib` is deprecated and will be removed in the next release." + + " Please use `pkgs.lib` instead." + + " For more information see https://github.com/NixOS/nixpkgs/issues/108938") + lib; inherit fetchurlBoot;