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

yaxg: Removed unstable from name #91406

Closed
wants to merge 1 commit into from
Closed

Conversation

neonfuz
Copy link
Contributor

@neonfuz neonfuz commented Jun 24, 2020

Motivation for this change

When I first wrote this package I didn't fully understand how versioning worked in nixos, and I didn't realize the -unstable would end up in the package name rather than the version string. I added unstable because there was no official version tag, however yaxg is actually stable, and hasn't had a change since 2018. This change simplifies installing yaxg in a nix environment from nix-env -i yaxg-unstable to just nix-env -i yaxg.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nixpkgs-review --run "nixpkgs-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.

@mweinelt
Copy link
Member

This change simplifies installing yaxg in a nix environment from nix-env -i yaxg-unstable to just nix-env -i yaxg.

Pretty sure that is already the case, since the -i flag expects a pkgname. The version is not part of that.

❯ nix-build -A yaxg-unstable
error: attribute 'yaxg-unstable' in selection path 'yaxg-unstable' not found
❯ nix-build -A yaxg
/nix/store/dfvybj89l9xn4vyvy8v3gmps3l89x8qc-yaxg-unstable-2018-05-03

I've seen the unstable prefix in the version attribute whenever there was no tagged release. So I'm not sure this change is actually necessary.

@neonfuz
Copy link
Contributor Author

neonfuz commented Jun 24, 2020

Pretty sure that is already the case

no it's not, nix-build's syntax is not consistent with nix-env:

$ nix-env -i yaxg
error: selector 'yaxg' matches no derivations

working commands:

$ nix-env -i yaxg-unstable
$ nix-env -iA nixpkgs.yaxg

nix-env -i doesn't read the pname and search against it, instead it takes the full name and strips the version with something like /-[0-9-]*$/d.

nix-env -i yaxg is shorter than either of these, and doesn't give the feeling of installing unstable software. needing to append -unstable makes me as a user feel like I'm installing a beta version, like firefox-beta or something-git. To me, the existence of the postfix -unstable implies that the software has an alternative stable version, is undergoing rapid changes, or is very new. None of these are true for yaxg anymore.

Anyways, I just remembered it's actually in the nixpkgs manual that you should add -unstable to the name of "non releases". It also says the version should always start with a number. So technically -unstable should be moved from the version to the name.
https://nixos.org/nixpkgs/manual/#sec-package-naming

Considering yaxg really is stable, maybe I'll bug upstream to tag this as 1.0 or something.

@jtojnar
Copy link
Contributor

jtojnar commented Jun 24, 2020

nix-env without -A is not really recommended since it needs to scan the whole nixpkgs for package with matching name. We really need to remove it from docs. I would suggest adding alias npkge=nix-env -f '<nixpkgs>' or alias npkge=nix-env -f channel:nixpkgs-unstable and then using npkge -iA yaxg if you find the fully qualified command too long.

Yeah, where to put unstable in the name is point of contention since the name splitting is not a very good design, see the discussion in #88023 (comment).

@neonfuz
Copy link
Contributor Author

neonfuz commented Jun 24, 2020

Yeah I already made a little bash function that I use, but it's a bit more hacky: nixi() { nix-env -iA nixpkgs.$@; }. May adopt that one, thanks.

Anyways since it seems the rest of nixos uses -unstable in this way I'll close this issue. Maybe I'll bug upstream to make a tag if it's really necessary.

@neonfuz neonfuz closed this Jun 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants