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

stdenv: warn about use of inherited lib #111284

Merged
merged 6 commits into from
Jan 31, 2021
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions nixos/doc/manual/release-notes/rl-2103.xml
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,14 @@ self: super:
<title>Other Notable Changes</title>

<itemizedlist>
<listitem>
<para>
<literal>stdenv.lib</literal> has been deprecated and will break
eval in 21.11. Please use <literal>pkgs.lib</literal> instead.
See <link xlink:href="https://github.com/NixOS/nixpkgs/issues/108938">#108938</link>
for details.
</para>
</listitem>
<listitem>
<para>
The Mailman NixOS module (<literal>services.mailman</literal>) has a new
Expand Down
8 changes: 4 additions & 4 deletions pkgs/development/libraries/hspell/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 ];
Expand Down
7 changes: 4 additions & 3 deletions pkgs/development/tools/rust/cargo-valgrind/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{ stdenv
{ lib
, stdenv
, rustPlatform
, fetchFromGitHub
, nix-update-script
Expand Down Expand Up @@ -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 ];
Expand Down
9 changes: 5 additions & 4 deletions pkgs/servers/pleroma-otp/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{ stdenv
{ lib
, stdenv
, autoPatchelfHook
, fetchurl
, file
Expand Down Expand Up @@ -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" ];
};
}
9 changes: 6 additions & 3 deletions pkgs/stdenv/generic/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down