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

What's in a name? #114

Open
cdyson37 opened this issue Jul 2, 2019 · 7 comments
Open

What's in a name? #114

cdyson37 opened this issue Jul 2, 2019 · 7 comments

Comments

@cdyson37
Copy link
Contributor

cdyson37 commented Jul 2, 2019

I found this line confusing in pill 6:

name: the name of the derivation. In the nix store the format is hash-name, that's the name.

It's a little hard to scan. Also I think there's a distinction between a human readable name ("coreutils") and the name of a derivation (with a hash). So how about something like:

name: a human-readable name e.g. "coreutils". This forms part of the name in the nix store to make the paths more readable.

@cdyson37
Copy link
Contributor Author

cdyson37 commented Jul 2, 2019

That's the syntax of a valid identifier. My point was that the comment in the nix pill doesn't make clear (I think) the purpose of the 'name' attribute in a derivation, which is a slightly different thing I belive.

@darthdeus
Copy link

I find it slightly confusing with the , that's the name at the end. So is it hash-name, or is hash-name the name?

@jonringer
Copy link

the name of a derivation is usually: {pname}-{version}, however a store path is usually the {hash}-{pname}-{version}.

maybe this will help:

[09:24:15] jon@jon-desktop /home/jon/projects/nixpkgs (master)
$ nix eval nixpkgs.python3.outPath
"/nix/store/gpnm7i19lpj8p43mjrdw03d0hjalmskl-python3-3.7.5"
[09:24:26] jon@jon-desktop /home/jon/projects/nixpkgs (master)
$ nix eval nixpkgs.python3.name
"python3-3.7.5"
[09:24:34] jon@jon-desktop /home/jon/projects/nixpkgs (master)
$ nix eval nixpkgs.python3.pname
"python3"
[09:24:39] jon@jon-desktop /home/jon/projects/nixpkgs (master)
$ nix eval nixpkgs.python3.version
"3.7.5"

@jonringer
Copy link

for most packages, the name of a package gets determined here: https://github.com/NixOS/nixpkgs/blob/6b2504f9f20e79711e835ef412173ee2be542dc2/pkgs/stdenv/generic/make-derivation.nix#L191 and the store-path (hash + name) isn't determined until it needs to generate a .drv or dervation file (as it will need to evaluate all of the dependencies before this is deterimined)

@cdyson37
Copy link
Contributor Author

Thanks - but my point is not that I don't understand it (I think I do) but that the pill could be reworded slightly to make it easier to grok :)

@jonringer
Copy link

problem is that name can be used to describe a store-path-name, a derivation-name, and a package-name ;(

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

No branches or pull requests

4 participants