-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
Deprecate use of stdenv.lib across Nixpkgs #108938
Comments
In the short term, we could add this check in ofbrorg and nix-hammering, and update any examples in the documentation to reduce new usage of |
Don't forget things like |
Ah. So 45K occurrences across 11.8K files. $ ag '[sS]tdenv.*\.lib' -l | wc -l
11853 |
toplevel is done #108934 |
the xorg dep generator also doesn’t put it in its output anymore #108935 |
|
doc changes in #108979 |
Part of: NixOS#108938 Changing the documentation to not refer to stdenv.lib is the first step to make people use it directly.
Part of: #108938 Changing the documentation to not refer to stdenv.lib is the first step to make people use it directly.
Part of: NixOS#108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
Part of: #108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
Graph of stdenv.lib occurrences over time:
https://edef.eu/~qyliss/nix/lib/
|
Nice! What scripts did you use to generate it? |
Nice! What scripts did you use to generate it?
There's a source code link now :)
|
undortunatrely I still see ``` trace: Warning: `stdenv.lib` is deprecated and will be removed in the next release. Please use `lib` instead. For more information see NixOS/nixpkgs#108938 ```
Fixes this message on nixpkgs-unstable: trace: Warning: `stdenv.lib` is deprecated and will be removed in the next release. Please use `pkgs.lib` instead. For more information see NixOS/nixpkgs#108938 Signed-off-by: Anders Kaseorg <[email protected]>
This is in preparation for the `stdenv.lib` removal. Strangely, the warning persists. I assume it comes from some expressions that are outside of this repo and we only transitively pull in. This is the warning we eventually want to fix: ``` trace: Warning: `stdenv.lib` is deprecated and will be removed in the next release. Please use `lib` instead. For more information see NixOS/nixpkgs#108938 ```
I just got this warning while doing a |
see issue NixOS/nixpkgs#108938
stdenv.lib is deprecated in nixpkgs see NixOS/nixpkgs#108938
- stdenv.lib has been deprecated (NixOS/nixpkgs#108938) - replace linuxkit-nix (unmaintained) with nix-docker - updated niv sources
- stdenv.lib has been deprecated (NixOS/nixpkgs#108938) - replace linuxkit-nix (unmaintained) with nix-docker - updated niv sources
- stdenv.lib has been deprecated (NixOS/nixpkgs#108938) - replace linuxkit-nix (unmaintained) with nix-docker - updated niv sources
- stdenv.lib has been deprecated (NixOS/nixpkgs#108938) - replace linuxkit-nix (unmaintained) with nix-docker - updated niv sources
- stdenv.lib has been deprecated (NixOS/nixpkgs#108938) - replace linuxkit-nix (unmaintained) with nix-docker - updated niv sources
- stdenv.lib has been deprecated (NixOS/nixpkgs#108938) - replace linuxkit-nix (unmaintained) with nix-docker - updated niv sources
Fixes: Warning: `stdenv.lib` is deprecated and will be removed in the next release. Please use `pkgs.lib` instead. For more information see NixOS/nixpkgs#108938
On Nixpkgs, the work[1] for deprecating stdenv.lib has started. This patch updates the generator, existing documentation and tests to use the top-level lib attribute to access the standard library, instead of stdenv.lib. [1]: NixOS/nixpkgs#108938
In Nixpkgs stdenv.lib is deprecated[1] and may be removed in the future. [1]: NixOS/nixpkgs#108938
* Nix maintenance - stdenv.lib has been deprecated (NixOS/nixpkgs#108938) - replace linuxkit-nix (unmaintained) with nix-docker - updated niv sources * Add Nix workflow * Adjust Nix build to use oxide target * Use auth token for cachix Co-authored-by: Nathaniel van Diepen <[email protected]>
Running `nix develop` prints a warning message about using this deprecated attribute. See NixOS/nixpkgs#108938
Running `nix develop` prints a warning message about using this deprecated attribute. See NixOS/nixpkgs#108938 Update oldNixpkgs to the latest working version
Running `nix develop` prints a warning message about using this deprecated attribute. See NixOS/nixpkgs#108938 Update oldNixpkgs to the latest working version
Running `nix develop` prints a warning message about using this deprecated attribute. See NixOS/nixpkgs#108938 Update oldNixpkgs to the latest working version
Carry over discussion from IRC #nixos-dev and #108934. Inspired by the doc change in c06b2b3 recommending top-level usage of
lib
overstdenv.lib
, we want to reduce confusion for newcomers and unnecessary complexity by makinglib
the canonical way to access the Nix library. We may still want to keepstdenv.lib
to not break external code, and place atrace
or similar at its definition site.There are over 11000 files where
stdenv.lib
occurs at least once. Beyond splitting this change across multiple PRs, in what ways can the change be automated?Pinging @alyssais @Profpatsch @FRidh @Atemu @ehmry
The text was updated successfully, but these errors were encountered: