-
-
Notifications
You must be signed in to change notification settings - Fork 161
[RFC 0045] Deprecating unquoted URL syntax #45
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
Changes from 9 commits
ba32469
cda4475
e595a19
6b39d1b
268bb83
ca50c02
e978077
e0b7512
1773937
cb1d204
2a99937
086786a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| --- | ||
| feature: deprecate_url_syntax | ||
| start-date: 2019-04-28 | ||
| author: Michael Raskin | ||
| co-authors: | ||
| shepherd-leader: Eelco Dolstra | ||
| shepherd-team: Eelco Dolstra, Jonas Pfenniger, Silvan Mosberger | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @zimbatm is your name correct here?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no it's "zimbatm" :)
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @domenkozar or @7c6f434c would you care to fix this?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah right, sorry. |
||
| related-issues: | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure: the RFC template seems to imply this is for PRs implementing the RFC, not for the changes the RFC intends to undo. |
||
| --- | ||
|
|
||
| # Summary | ||
| [summary]: #summary | ||
|
|
||
| Gradually deprecate the use of unquoted URL syntax in Nix code and especially | ||
| Nixpkgs. | ||
|
|
||
| # Motivation | ||
| [motivation]: #motivation | ||
|
|
||
| The Nix language has a special syntax for URLs even though quoted strings can also be used to represent them. Unlike paths, URLs do not | ||
| have any special support that would make the difference useful. Moreover, using | ||
| variable expansion in URLs requires some URLs to be quoted strings anyway. So | ||
| the most consistent approach is to always use quoted strings to represent URLs. | ||
| Additionally, a semicolon immediately after the URL can be mistaken for a part | ||
| of URL by language-agnostic tools such as terminal emulators. | ||
|
|
||
| In case of future breaking changes in the Nix syntax, it would be nice to make | ||
| the `x:x` snippet parse to the identity function, and not to an URL. Tools | ||
| targeting only Nixpkgs codebase can ignore URL syntax once Nixpkgs phases out | ||
| its use. | ||
|
|
||
| # Detailed design | ||
| [design]: #detailed-design | ||
|
|
||
| Add a note in the Nix manual that the special unquoted URL syntax is | ||
| deprecated. | ||
|
|
||
| Add a note in the Nixpkgs manual that the unquoted URL syntax is deprecated, | ||
| changes to Nixpkgs should not increase its use, and it is recommended to | ||
| convert URLs to quoted strings when changing them. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it possible to be more specific? How would everybody be notified about this new rule?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
For this specific RFC just the announcement «RFC on Deprecation of URL syntax passed» conveys enough information.
I do have an impression that quite a few people mentioned that they are disappointed they cannot refer to a policy that quoted URLs are better, so I expect the review channel of information dissemination to perform well. Appendix A: future work — maybe the tool gets implemented, then we can open a countdown issue and maybe make ofborg check that PRs do not make things worse). My plan is indeed just these points. I think that these things do not really need any additions to the text of RFC, and I think these mechanisms will be enough to distribute the information. If you think that any of these four channels benefit from an addition to RFC text, or that there are other information distribution channels that should be used (and mentioned in the RFC text) please give some details.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It doesn't have to be formalized in the RFC but it's good to have an accompanying discussion. For example you mentioned "they are disappointed they cannot refer to a policy". Would the RFC act as such policy? If not, maybe we should have a list of official policies in place.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think having a deprecation notice in the manual (added in accordance with an explicit bullet point in an approved/accepted RFC) is close enough to official policy for the purpose of asking people not to do the deprecated things. I didn't start the discussion myself, because I thought that (1) is assumed, (2) and (A) are explicitly mentioned, and (3) is a manual variant of (A) in a sense. |
||
|
|
||
| Convert all the unquoted URLs in the Nixpkgs codebase to quoted strings. | ||
|
|
||
| Add an ofBorg check that verifies that no new unquoted URLs have been added in | ||
| a PR. | ||
|
|
||
| # Drawbacks | ||
| [drawbacks]: #drawbacks | ||
|
|
||
| This is a minor cosmetic issue (and maybe a very minor readability issue) which | ||
| might not be worth making a specific decision. | ||
|
|
||
| # Alternatives | ||
| [alternatives]: #alternatives | ||
|
|
||
| * Do nothing; get PRs from time to time that make homepages uniformly quoted | ||
| strings or uniformly unquoted. | ||
|
|
||
| * Decide to use unquoted URLs for all URLs without special characters or | ||
| variable expansion. | ||
|
|
||
| # Unresolved questions | ||
| [unresolved]: #unresolved-questions | ||
|
|
||
| Currently none. | ||
|
|
||
| # Future work | ||
| [future]: #future-work | ||
|
|
||
| In case of future major changes in the Nix syntax, removal of special URL | ||
| syntax might be considered. | ||
|
|
||
| Explore options for automated tracking of the number of unquoted URLs in | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we deprecate this syntax, we should not use it anymore in nixpkgs. so I'd say it should be part of this RFC that all URL's be changed to strings. Writing a program that does this conversion shouldn't be hard, I could write one with hnix.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. RFC already has a commitment to accept any change like that; I did not put a commitment to make such a change immediately because I was not sure if anyone is willing to commit to write such a tool right now. This is that kind of tool that shouldn't be hard to write, but might end up being annoying to debug, and if
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm giving it a shot, I've written a tool that does something very similar before
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks! I guess if the tool works, it should be reasonably easy to replace «edit» with «count» and deploy it as an ofBorg check, too? |
||
| Nixpkgs. | ||
Uh oh!
There was an error while loading. Please reload this page.