rfcs icon indicating copy to clipboard operation
rfcs copied to clipboard

[RFC 0169] Feature parameter names

Open KAction opened this issue 1 year ago • 44 comments

RFC to establish rules on how enable/with/support/use flags should be named. Essentially, an attempt to bring order and uniformity of Gentoo USE flags into Nixpkgs.

Pre-RFC discussion on the discourse Rendered RFC

KAction avatar Jan 21 '24 18:01 KAction

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/pre-rfc-standardization-of-feature-parameters/38104/74

nixos-discourse avatar Jan 21 '24 18:01 nixos-discourse

This is actually 0169 (based on the PR number)

7c6f434c avatar Jan 21 '24 21:01 7c6f434c

I guess PR title also needs an update.

7c6f434c avatar Jan 22 '24 20:01 7c6f434c

As proof-of-concept, implemented renaming logic on the makeOverrideable level. That means that individual packages do not need to carry deprecation notices (something that @Atemu called "ffmeg" test).

Side effect of this approach is that it actually provides list of all known feature parameters. I'll probably move this approach as proposed, and current one as alternative solution.

https://github.com/NixOS/nixpkgs/pull/284107

KAction avatar Jan 26 '24 21:01 KAction

@infinisil Can I have your input? I think at 2024-01-09 nixpkgs architecture meeting you expressed interest in shepherding this one.

KAction avatar Jan 28 '24 00:01 KAction

@jtojnar @ghost @mohe2015

Inviting reviewers of #234463 into the RFC discussion.

Feedback is welcome. Finding more people to get RFC

received ample discussion and enough of the tradeoffs have been discussed.

is also welcome. I think on my side, I did proof-of-concept both on how to lint new packages and how to do renaming in existing. Anything I miss?

KAction avatar Feb 10 '24 02:02 KAction

My current opinion is: motivation mismatches the measures proposed; switching the naming word-handling convention is costly and the changes elsewhere have deprived it of the main benefit in terms of linting; the linting being mandated but not the trigger condition for the more onerous requirements timing is bad.

Unification of option naming where only the names already used in practice are eligible — via should-merge stipulation for zero-rebuild PRs in that direction — would not bring practical benefits either but at least would be mostly harmless.

I won't actively support even the latter reasonable version of unification, so I guess I am too biased to be a shepherd. I hope though, that I manage to keep the local feedback useful either to reject the substance and not silly technicalities, or to implement it with less unnecessary cost, useful or not. (Costs inherent to the claimed benefits are a trade-off question, we will never get agreement there, only a truce)

7c6f434c avatar Feb 10 '24 10:02 7c6f434c

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/extra-packages/39867/6

nixos-discourse avatar Feb 17 '24 12:02 nixos-discourse

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/rfcsc-meeting-2024-03-05/40851/1

nixos-discourse avatar Mar 05 '24 16:03 nixos-discourse

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/rfcsc-meeting-2024-03-19/41829/1

nixos-discourse avatar Mar 19 '24 16:03 nixos-discourse

This RFC has not acquired enough shepherds. This typically shows lack of interest from the community. In order to progress a full shepherd team is required. Consider trying to raise interest by posting in Discourse, talking in Matrix or reaching out to people that you know.

If not enough shepherds can be found in the next month we will close this RFC until we can find enough interested participants. The PR can be reopened at any time if more shepherd nominations are made.

See more info on the Nix RFC process here

MMesch avatar Apr 02 '24 14:04 MMesch

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/rfcsc-meeting-2024-04-02/42643/1

nixos-discourse avatar Apr 02 '24 15:04 nixos-discourse

How many are needed right now?

AndersonTorres avatar Apr 02 '24 19:04 AndersonTorres

@AndersonTorres There are no shepherds right now but three are required. (While I would be a good candidate, I'm a bit overbooked right now, so I'd prefer to only give occasional feedback.)

infinisil avatar Apr 02 '24 19:04 infinisil

I am interested in implementing this. So I wanna be a shepherd.

However I am on vacation now, I will return after 15 days.

AndersonTorres avatar Apr 02 '24 21:04 AndersonTorres

@wolfgangwalther Thank you for thorough revision of the text.

I find your reasoning about consolidating knowledge of package availability quite compelling. Having with_ flags naming strictly derived from package name sounds good, but there might be some corner cases where MUST will paint us into the corner.

@7c6f434c @Atemu Thoughts?

KAction avatar Apr 13 '24 17:04 KAction

but there might be some corner cases where MUST will paint us into the corner.

Two thoughts on this:

  • Making this a MUST is much more likely to make us aware of those corner-cases, because somebody would need to raise the issue if they come across that case. A SHOULD would possibly lead to silent divergence of with_ flags and attributes.
  • Maybe we can find a way to express that those corner cases must then modeled via enable_ flags and not with_ flags, to keep the strict 1:1 mapping for with_ flags and attributes?

wolfgangwalther avatar Apr 13 '24 17:04 wolfgangwalther

My current thought is that after some independent evolution the proposed policies have lost connection to the motivation, and the current proposal involves currently unjustified massive changes, like switching from camel to snake case. Which is bad.

Awareness of corner cases is only worth anything if something reasonable is done with them; the current intermediate state of the RFC already doesn't pass this threshold.

My base estimation of the decision making processes in Nixpkgs is that throwing MUST requirements into an RFC to force the corner cases to the light will be a pure negative if done naively. Maybe a clear procedure for creating generic rules for the corner cases which is a MUST for any exceptions could work, but that's not what is discussed currently.

7c6f434c avatar Apr 16 '24 06:04 7c6f434c

the current proposal involves currently unjustified massive changes, like switching from camel to snake case.

The justification to use snake case for those feature parameter names is the ability to have a 1:1 mapping for attribute names and with_ parameter names. This is not possible with camel case, because attributes don't start with a capital letter.

wolfgangwalther avatar Apr 16 '24 07:04 wolfgangwalther

My base estimation of the decision making processes in Nixpkgs is that throwing MUST requirements into an RFC to force the corner cases to the light will be a pure negative if done naively.

This is not the intent/motivation of the MUST requirement, just an observation of a potential side-effect. I proposed the MUST requirement for with_ parameters to avoid any divergence between attribute names and parameters names and thus enable automation on them.

wolfgangwalther avatar Apr 16 '24 07:04 wolfgangwalther

The justification to use snake case for those feature parameter names is the ability to have a 1:1 mapping for attribute names and with_ parameter names.

However, the currently proposed rules for what is the real dependency parameter to mention are complicated enough that no automation is plausible, so we can just write should-accept for unifying renamings and keep camel case — given that for most cases it is clear what is the proper camel case.

7c6f434c avatar Apr 16 '24 07:04 7c6f434c

@wolfgangwalther shepherding is probably the best way you can help this RFC get forwards, so we'd like to nominate you as a shepherd -- let us know if you're alright with that :)

lheckemann avatar Apr 16 '24 14:04 lheckemann

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/rfcsc-meeting-2024-04-16/43512/1

nixos-discourse avatar Apr 16 '24 14:04 nixos-discourse

Overall, I do not agree with @wolfgangwalther's proposal to add global parameter mechanism to this RFC or tie parameter naming to a global goal.

The possibility of making such Gentoo-like USE-flags a reality is one fo the goals of this RFC as I understand it. Actually doing that should be explicitly excluded from this RFC though IMO.

As I understand it, limiting it in this regard was intentional and I'd agree with that. A USE-flag like mechanism entails a lot of other design decisions and problems to solve than setting a standard on the naming of parameter names. This standardisation can be useful without the global mechanism and it'd be best to keep the RFC for it minimal.

Atemu avatar May 01 '24 15:05 Atemu

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/rfcsc-meeting-2024-05-14/45414/1

nixos-discourse avatar May 14 '24 15:05 nixos-discourse

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/rfcsc-meeting-2024-05-28/46113/1

nixos-discourse avatar May 28 '24 14:05 nixos-discourse

RFCSC:

@wolfgangwalther: Asking again, would you be willing to shepherd this RFC? Furthermore, we're also nominating @Atemu as a shepherd, since you recently reviewed it, sound good?

infinisil avatar Jun 10 '24 15:06 infinisil

@infinisil

Asking again, would you be willing to shepherd this RFC?

Sorry, for not answering so far. I had put this on the backlog, because nobody else was available to shepherd anyway, so it wasn't urgent for me.

tbh, I don't know. This whole proposal is based on two key assumptions:

  • We don't have a module system for packages.
  • It's not possible to add "nested default arguments" to a function.

Both of those would allow superior solutions to this. But having no solution is clearly inferior.

I only briefly looked at @Atemu's https://github.com/NixOS/nixpkgs/pull/312432 - but this is an approach targeting a more principled solution. If that's feasible at all - we should pursue this instead.

So I would say at this stage we can't reasonably push this RFC forward - to neither direction. Accepting this wouldn't make sense if @Atemu's approach works out well. Rejecting this now, doesn't make sense either, because we just don't have this other proposal anywhere close, yet.

Imho, we should put this RFC on hold for a bit, maybe build a team to evaluate https://github.com/NixOS/nixpkgs/pull/312432 and push this forward, possibly resulting in a different RFC. Once we have a better idea whether that approach can work, then re-consider this RFC here?

wolfgangwalther avatar Jun 10 '24 15:06 wolfgangwalther

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/rfcsc-meeting-2024-06-10/46817/1

nixos-discourse avatar Jun 10 '24 15:06 nixos-discourse

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/rfcsc-meeting-2024-06-24/47589/1

nixos-discourse avatar Jun 24 '24 15:06 nixos-discourse