-
-
Notifications
You must be signed in to change notification settings - Fork 160
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
[RFC 0035] Default name
from pname
#35
Conversation
Thanks for opening the RFC. It is indeed a very common and trivial pattern, so I am not against having that in our
|
I disagree, different source versions might require different steps to build, install, etc. I feel it would be strange if this wouldn't be reflected in the derivation. |
The version attribute does not consider that, but it is of course considered in the computation of the store path hash. To be clear, I am not saying version should not be included in the derivation name, because I think it is good to have it there for convenience from a user point of view given the current tooling and when looking at store paths directly. However, it does not really make sense to have it as an attribute of the build artifact, because its an attribute of one of its dependencies: its source derivation. Same goes for license and homepage. The reason for including these in the derivation is again convenience/tooling support. Anyway, what I state here fits I think better in the discussion/proposal of writing derivations differently (lost the link). |
Ah, sure, I can see that. However, this being such a simple RFC, I don't think it would do any good to drag this big a change into it. |
Do the whole of |
@Ekleog Good point! The original PR eventually switched to I see two options here:
P.S. I couldn't get the entirety of nixpkgs to evaluate even unmodified, when I do |
s/caviats/caveats/ on the latest commit :) |
name
from pname
name
from pname
Not really a fan, 700 places doesn’t look like a lot for a major source of implicitness (because yes, as you say, it’s going to be non-trivial to find out why the |
Keep in mind, there is precedent: |
Also, I eventually want |
|
Does this also only add a prefix to the standard |
I personally prefer that style and would have used it more often but was discouraged from doing so because it was not yet a standard. So the 700 may be a low number. If I could go back in time I would even use Also I think the consistency with python is very valuable. |
From what I read in the comments, the general opinion is in favor of this change. I’d say “go forth and implement”. |
Go for it IMO |
This PR doesn't really explain why this change should be made. Presumably it's to allow tools like |
AFAIU it's just about simplifying the writing of a derivation, that's all. |
@Zimmi48 is correct, it is just a simplifying change to make it easier to write packages with less repeated "boilerplate". |
I don't see any negatives here. What do you mean by churn? |
The proposed change doesn't forbid direct name specification, it just reduces redundancy in case a better way (which is already also an idiom…) is used. |
Don't suppose this could work for things like override or even overrideAttrs? O:) |
I think working with |
Oh, I was thinking it's be "convenient" to only need to specify new
version/src when `overrideAttrs`'ing, with name auto-rederived from
pname and (new) version. Not worth complicating or delaying for
but came to mind when adding an override earlier.
(since setting `name` again is a bit tedious boilerplate, NBD)
…On Sun, 04 Nov 2018 23:28:32 -0800, Michael Raskin ***@***.***> wrote:
I think working with `override` is very unlikely to be broken (it happens before the call to `mkDerivation` anyway), am I missing something?
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#35 (comment) part: text/html
|
Oh, I was thinking it's be "convenient" to only need to specify new
version/src when `overrideAttrs`'ing, with name auto-rederived from
pname and (new) version. Not worth complicating or delaying for
but came to mind when adding an override earlier.
(since setting `name` again is a bit tedious boilerplate, NBD)
If `overrideAttrs` can handle cross-compilation, `pname` is easy, and
I don't see any point in it if it cannot…
|
Closing since this is already in Nixpkgs. |
If something already exists matching the RFC (as opposed to conflicting), I rather see it merged. IMO this makes the outcome clearer at a glance, and is harmless because RFCs should specialize an idempotent course of action. |
Merging it would imply that it was approved via the RFC process, which is not the case here. |
Could the committee come to a decision retroactively? (keep vs revert) |
@Ericson2314 I think the current status allows you some ways to promote |
Not to put too fine a point on the issue,
but I suspect it's not entirely regretted that there are
pain points on the "implement around the RFC process" workflow ;).
And more specifically, limited motivation for discussing/fixing such
pains.
(see the musl RFC for another example guilty of this :/:()
That said, I imagine there's room for positive discussion here!
This now seems more an issue of how to put together an RFC
that seeks to codify existing practices...
but I'm not sure how that's best accomplished offhand
(new seems simplest? dunno).
Which reminds me, I should go refresh myself with all our RFC's.... O:)
…On Sat, 12 Jan 2019 15:37:45 -0800, Michael Raskin ***@***.***> wrote:
@Ericson2314 I think the current status allows you some ways to promote `pname` usage without competing for the RFC processing bottleneck.
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#35 (comment) part: text/html
|
I'm not very happy with automagically adding variables in a non-obvious way. This RFC proposes that "name" should magically be added. In addition, |
I noticed that overriding packages has become more complicated. When pname + version is being used, overriding a package with overrideAttrs now requires to fix both the version and the name. |
Can we automate this in |
Where a package provides The only problem I can see is when a package sets an explicit
What automation do you propose? String substituting the old and new Alternatively, we could allow the We could also require nixpkgs authors to fetch the I guess the general solution would be for stdenv.mkDerivation (self: with self; {
pname = "hello";
version = "1.0";
name = "prefix-${pname}-${version}";
} Is there a reason this isn't done already? It does increase boilerplate. |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
Rendered
Currently looking for a co-author