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

trace: warning while doing nix-env -u #306276

Closed
Aviksaikat opened this issue Apr 19, 2024 · 12 comments · Fixed by #355271
Closed

trace: warning while doing nix-env -u #306276

Aviksaikat opened this issue Apr 19, 2024 · 12 comments · Fixed by #355271
Labels
0.kind: bug Something is broken

Comments

@Aviksaikat
Copy link

Describe the bug

Getting the following trace warning while doing nix-env -u

$ nix-env -u                                                                   
trace: warning: cudaPackages.autoAddDriverRunpath is deprecated, use pkgs.autoAddDriverRunpath instead
trace: warning: cudaPackages.autoAddOpenGLRunpathHook is deprecated, use pkgs.autoAddDriverRunpath instead
trace: warning: cudaPackages.autoFixElfFiles is deprecated, use pkgs.autoFixElfFiles instead
trace: warning: cudaPackages.autoAddDriverRunpath is deprecated, use pkgs.autoAddDriverRunpath instead
trace: warning: cudaPackages.autoAddOpenGLRunpathHook is deprecated, use pkgs.autoAddDriverRunpath instead
trace: warning: cudaPackages.autoFixElfFiles is deprecated, use pkgs.autoFixElfFiles instead
trace: warning: cudaPackages.autoAddDriverRunpath is deprecated, use pkgs.autoAddDriverRunpath instead
trace: warning: cudaPackages.autoAddOpenGLRunpathHook is deprecated, use pkgs.autoAddDriverRunpath instead
trace: warning: cudaPackages.autoFixElfFiles is deprecated, use pkgs.autoFixElfFiles instead
trace: warning: eww now can build for X11 and wayland simultaneously, so `eww-wayland` is deprecated, use the normal `eww` package instead.
trace: warning: lxd has been renamed to lxd-lts
trace: warning: lxd-unwrapped has been renamed to lxd-unwrapped-lts
trace: warning: nixfmt was renamed to nixfmt-classic. The nixfmt attribute may be used for the new RFC 166-style formatter in the future, which is currently available as nixfmt-rfc-style
trace: warning: nvtop has been renamed to nvtopPackages.full
trace: warning: nvtop-amd has been renamed to nvtopPackages.amd
trace: warning: nvtop-intel has been renamed to nvtopPackages.intel
trace: warning: nvtop-msm has been renamed to nvtopPackages.msm
trace: warning: nvtop-nvidia has been renamed to nvtopPackages.nvidia
trace: warning: writeReferencesToFile is deprecated in favour of writeClosure

Steps To Reproduce

  1. Do nix-env -u

Expected behavior

A clear and concise description of what you expected to happen.

nix-env --version output

nix-env (Nix) 2.21.2

Additional context

OS: Kali GNU/Linux 2024.1

Priorities

Add 👍 to issues you find important.

@colinrozzi
Copy link

I am getting the same error on Debian GNU/Linux 11 (bullseye).

I have a fresh install of both debian and nix, and whenever I run nix-env -i with any package, I get the first 9 lines of the above error, every one starting with cudaPackages.

@kakig
Copy link

kakig commented Apr 21, 2024

I'm also getting the same trace warnings with nix 2.21.2 running in Red Hat Enterprise Linux 9.3 (Plow), single user installation (--no-daemon)

@tuanpham96
Copy link

I'm getting similar warnings with nix 2.21.2 on Ubuntu 20.04 LTS.

@thufschmitt
Copy link
Member

These are Nixpkgs warnings that get triggered on recent nixos-unstable versions. I'm not sure why they suddently started popping-up, but the root cause lies in Nixpkgs itself. Moving the issue there as a consequence.

For more context: I can reproduce this with any reasonable Nix version on nixos-unstable. nixos-23.11 doesn't exhibit this.

$ nix-env -f channel:nixos-23.11 -u
$ nix-env -f channel:nixos-unstable -u
trace: warning: cudaPackages.autoAddDriverRunpath is deprecated, use pkgs.autoAddDriverRunpath instead
trace: warning: cudaPackages.autoAddOpenGLRunpathHook is deprecated, use pkgs.autoAddDriverRunpath instead
trace: warning: cudaPackages.autoFixElfFiles is deprecated, use pkgs.autoFixElfFiles instead
trace: warning: cudaPackages.autoAddDriverRunpath is deprecated, use pkgs.autoAddDriverRunpath instead
trace: warning: cudaPackages.autoAddOpenGLRunpathHook is deprecated, use pkgs.autoAddDriverRunpath instead
trace: warning: cudaPackages.autoFixElfFiles is deprecated, use pkgs.autoFixElfFiles instead
trace: warning: cudaPackages.autoAddDriverRunpath is deprecated, use pkgs.autoAddDriverRunpath instead
trace: warning: cudaPackages.autoAddOpenGLRunpathHook is deprecated, use pkgs.autoAddDriverRunpath instead
trace: warning: cudaPackages.autoFixElfFiles is deprecated, use pkgs.autoFixElfFiles instead
trace: warning: eww now can build for X11 and wayland simultaneously, so `eww-wayland` is deprecated, use the normal `eww` package instead.
trace: warning: lxd has been renamed to lxd-lts
trace: warning: lxd-unwrapped has been renamed to lxd-unwrapped-lts
trace: warning: nixfmt was renamed to nixfmt-classic. The nixfmt attribute may be used for the new RFC 166-style formatter in the future, which is currently available as nixfmt-rfc-style
trace: warning: nvtop has been renamed to nvtopPackages.full
trace: warning: nvtop-amd has been renamed to nvtopPackages.amd
trace: warning: nvtop-intel has been renamed to nvtopPackages.intel
trace: warning: nvtop-msm has been renamed to nvtopPackages.msm
trace: warning: nvtop-nvidia has been renamed to nvtopPackages.nvidia
trace: warning: writeReferencesToFile is deprecated in favour of writeClosure

@thufschmitt thufschmitt transferred this issue from NixOS/nix Apr 23, 2024
@tomodachi94 tomodachi94 added the 0.kind: bug Something is broken label May 14, 2024
@infinisil
Copy link
Member

This is caused by some packages starting to use lib.warn for deprecations:

lxd = lib.warn "lxd has been renamed to lxd-lts" lxd-lts; # Added 2024-04-01

@philiptaron
Copy link
Contributor

I wonder whether we should encourage this. Given the UX downsides, I lean towards "no".

@ManInDark
Copy link

I'd like to add that messages are also displayed multiple times, so I've got e.g. trace: warning: cudaPackages.autoAddDriverRunpath is deprecated, use pkgs.autoAddDriverRunpath instead thrice (I couldn't see any correlation from number of messages to number of packages).

Setup:

  • system: "x86_64-linux"
  • host os: Linux 6.1.0-21-amd64, Debian GNU/Linux, 12 (bookworm), nobuild
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.22.1
  • channels(root): "nixpkgs"
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixpkgs

@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/how-to-introduce-a-breaking-version-bump/46746/9

@kittygirlyy
Copy link

I got the same...

@goyalyashpal
Copy link

as far as i can recall, i started seeing this only after i added the nvtopPackages.nvidia in my etc/**/configuration.nix file.

$ sudo nixos-rebuild test
building Nix...
building the system configuration...
trace: warning: cudaPackages.autoAddDriverRunpath is deprecated, use pkgs.autoAddDriverRunpath instead
stopping the following units: accounts-daemon.service
$ nix-shell --version
nix-shell (Nix) 2.18.2

$ nix-info
system: "x86_64-linux", 
multi-user?: yes, 
version: nix-env (Nix) 2.18.2, 
nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos

@roberth
Copy link
Member

roberth commented Aug 21, 2024

This is caused by some packages starting to use lib.warn for deprecations:

lxd = lib.warn "lxd has been renamed to lxd-lts" lxd-lts; # Added 2024-04-01

What if they did something like the following?

  lxd = pkgs.lxd-lts // { outPath = lib.warn "lxd has been renamed to lxd-lts" lxd-lts.outPath; }

This doesn't cover everything; this should probably be handled by a function that adds it to all the outputs, so that a warning is emitted on instantiation, and not on attributes like name, version, type and meta.

@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/2024-08-21-nix-team-meeting-minutes-171/50950/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken
Projects
None yet
Development

Successfully merging a pull request may close this issue.