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

lib: delay/remove 4 deprecation warnings #72260

Closed
wants to merge 1 commit into from

Conversation

danbst
Copy link
Contributor

@danbst danbst commented Oct 29, 2019

This issue was seen when, for example, I've tried to nix-shell into docs:

$ nix-shell nixpkgs/doc
trace: `mkStrict' is obsolete; use `mkOverride 0' instead.
trace: `lib.nixpkgsVersion` is deprecated, use `lib.version` instead!
trace: Warning: `showVal` is deprecated and will be removed in the next release, please use `traceSeqN`
trace: lib.zip is deprecated, use lib.zipAttrsWith instead

nix-shell $

IMO it is clutter, so I did a few adjustments:

  1. For multi-arity functions I've moved deprecation warning deeper, so
    shallow function evaluation doesn't trigger warning message, only deep evaluation does that.
  2. Move function to lib/deprecated.nix.
    a) for 0-arity functions (lib.nixpkgsVersion) I've also removed deprecation
    message, as there is no way to silence it other way.

The worst thing is deprecation message removed for lib.nixpkgsVersion, but
I hope future linters will be able to scan lib/deprecated.nix and report deprecated
stuff before evaluation.

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @

This issue was seen when, for example, I've tried to nix-shell into docs:

```
$ nix-shell nixpkgs/doc
trace: `mkStrict' is obsolete; use `mkOverride 0' instead.
trace: `lib.nixpkgsVersion` is deprecated, use `lib.version` instead!
trace: Warning: `showVal` is deprecated and will be removed in the next release, please use `traceSeqN`
trace: lib.zip is deprecated, use lib.zipAttrsWith instead

nix-shell $
```

IMO it is clutter, so I did a few adjustments:

1. For multi-arity functions I've moved deprecation warning deeper, so
    shallow function evaluation doesn't trigger warning message, only deep evaluation does that.
2. Move function to `lib/deprecated.nix`.
   a) for 0-arity functions (lib.nixpkgsVersion) I've also removed deprecation
      message, as there is no way to silence it other way.

The worst thing is deprecation message removed for `lib.nixpkgsVersion`, but
I hope future linters will be able to scan `lib/deprecated.nix` and report deprecated
stuff before evaluation.
@infinisil
Copy link
Member

How about just getting rid of the deprecated stuff?

@danbst
Copy link
Contributor Author

danbst commented Nov 4, 2019

those are not used in nixpkgs at all, only as a compat layer.

There is also that deprecated.nix, which has lots of to-delete stuff. Here I've tried to delay this "delete deprecated stuff" action.

@infinisil
Copy link
Member

  • mkStrict: Marked as obsolete for over 5 years since 90a7711
  • nixpkgsVersion: Marked as deprecated for over a year since 9274ea3
  • showVal: Marked as deprecated for over a year since a7fdd10
  • zip: Marked as deprecated for over 6 years since fcbc4fe

I think we can get rid of mkStrict and zip, the others should probably stay for a bit longer.

@infinisil
Copy link
Member

Update on this?

@Ma27
Copy link
Member

Ma27 commented Jul 12, 2020

@danbst may I ask what's the status on this?

@stale
Copy link

stale bot commented Jun 7, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 7, 2021
@SuperSandro2000
Copy link
Member

This PR is really old and we are not going to undeprecate functions years later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: merge conflict 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 10.rebuild-darwin: 0 10.rebuild-linux: 0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants