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

remove old deprecation warning for ruff #211

Closed
phanirithvij opened this issue Aug 10, 2024 · 7 comments · Fixed by #214
Closed

remove old deprecation warning for ruff #211

phanirithvij opened this issue Aug 10, 2024 · 7 comments · Fixed by #214
Labels
bug Something isn't working

Comments

@phanirithvij
Copy link

Describe the bug

I keep seeing the warning programs.ruff.enable has been renamed to programs.ruff.check

But the thing is I am not even using ruff in my treefmt config.

To Reproduce

Not sure, whenever I am doing nixos-rebuild or home-manager switch I get it sometimes, but not when using treefmt-nix via nix fmt

Expected behavior

If I am not using it, it shouldn't warn me.

System information

$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.6.44, NixOS, 24.11 (Vicuna), 24.11.20240806.8e27e75`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.5`
 - channels(root): `"nixos"`
 - nixpkgs: `/nix/store/whdnxrs6vh9wv72fvkp4622wsl36x6xx-source`

Additional context

Maybe just disable that in ruff.nix as a temporary fix. since it has been a while since the users were warned about it.

@phanirithvij phanirithvij added the bug Something isn't working label Aug 10, 2024
@zimbatm
Copy link
Member

zimbatm commented Aug 10, 2024

I'm not able to reproduce locally. Can you share the code?

@phanirithvij

This comment was marked as outdated.

@phanirithvij
Copy link
Author

phanirithvij commented Aug 10, 2024

So I made a repo https://github.com/phanirithvij/nix-eval-bugreport, just do nix develop inside it and you should see the trace.

Also to reproduce it I had to find ~/.cache/nix/eval-cache-v5/ -type f -cmin -2 # -delete # uncomment delete which deletes the recent eval which should be nix develop (quick and dirty)
and do nix develop again.

@phanirithvij
Copy link
Author

So my guess is it is working as it is supposed to?
Just like how I get all the current traces defined in nixpkgs printed when doing nixos-rebuild for the very first evaluation?

So this is a non-issue but since I keep modifying my flake regularly I keep seeing this frequently.
Sorry, I guess this github issue can be closed and you may decide on whether or not to proceed with #212.

@zimbatm
Copy link
Member

zimbatm commented Aug 10, 2024

Thanks. This is surprising to me, too, so I will use your repo to investigate. I would expect the warning to only show up when the enable option is being used.

I also noticed that nix flake check currently has an eval error because of ruff not having an enable function, and not sure why CI didn't catch that.

@phanirithvij
Copy link
Author

phanirithvij commented Aug 10, 2024

My guess is it is same as NixOS/nixpkgs#306276

Edit: nvm I don't know what I'm talking about.

zimbatm added a commit that referenced this issue Aug 10, 2024
zimbatm added a commit that referenced this issue Aug 10, 2024
When using `lib.mkRenamedOptionModule`, the trace warning is emitted
whenever the option is accessed.

Because we iterate and check the .enable option of all the programs, the
renamed option gets accessed all the time.

So we check if the option is "visible" before checking in, which
`lib.mkRenamedOptionModule` sets to false.

Fixes #211
zimbatm added a commit that referenced this issue Aug 10, 2024
When using `lib.mkRenamedOptionModule`, the trace warning is emitted
whenever the option is accessed.

Because we iterate and check the .enable option of all the programs, the
renamed option gets accessed all the time.

So we check if the option is "visible" before checking in, which
`lib.mkRenamedOptionModule` sets to false.

Fixes #211
@zimbatm
Copy link
Member

zimbatm commented Aug 10, 2024

👍 thanks, found the solution thanks to your repro

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants