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

nix-channel documentation: don't suggest deprecated function #2291

Merged
merged 1 commit into from Oct 17, 2019

Conversation

Taneb
Copy link
Contributor

@Taneb Taneb commented Jul 16, 2018

Running nix-instantiate --eval -E '(import <nixpkgs> {}).lib.nixpkgsVersion emits a warning

trace: `lib.nixpkgsVersion` is deprecated, use `lib.version` instead!

Running `nix-instantiate --eval -E '(import <nixpkgs> {}).lib.nixpkgsVersion` emits a warning
```
trace: `lib.nixpkgsVersion` is deprecated, use `lib.version` instead!
```
@samueldr
Copy link
Member

samueldr commented Jul 17, 2018

Backporting lib.version to 18.03 may be necessary, or living with the warning until 18.09 is released and established. Otherwise, the instructions will become wrong for the current stable release of NixOS.

~ $ nix-instantiate --eval -E '(import <nixpkgs> {}).lib.nixpkgsVersion'
"18.03.git.d72c3e8bb64"
~ $ nix-instantiate --eval -E '(import <nixpkgs> {}).lib.version'
error: attribute 'version' missing, at (string):1:1
(use '--show-trace' to show detailed location information)

For the record the commit introducing lib.version.

@Taneb
Copy link
Contributor Author

Taneb commented Jul 18, 2018

Ah! I didn't consider that! I guess this PR can wait until September ;)

edolstra referenced this pull request in NixOS/nixpkgs Aug 3, 2018
As suggested in #39416 (comment)
the versioning attributes in `lib` should be consistent to
`nixos/version` which implicates the following changes:

* `lib.trivial.version` -> `lib.trivial.release`
* `lib.trivial.suffix` -> `lib.trivial.versionSuffix`
* `lib.nixpkgsVersion` -> `lib.version`

As `lib.nixpkgsVersion` is referenced several times in `NixOS/nixpkgs`,
`NixOS/nix` and probably several user's setups. As the rename will cause
a notable impact it's better to keep `lib.nixpkgsVersion` as alias with
a warning yielded by `builtins.trace`.
Ma27 added a commit to Ma27/nixpkgs that referenced this pull request Aug 5, 2018
Originally introduced in NixOS#39416 (1),
however it causes confusion and shouldn't be deprecated (2)(3).

/cc @edolstra

(1) NixOS#39416 (comment)
(2) NixOS@9274ea3#commitcomment-29951594
(3) NixOS/nix#2291
@edolstra edolstra merged commit ab4dd1d into NixOS:master Oct 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants