From ba324698255a5a13e13e45f8b4d6b983b6837c57 Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Sun, 28 Apr 2019 13:43:21 +0200 Subject: [PATCH 01/11] A small RFC on deprecating URL syntax --- rfcs/0045-deprecate-url-syntax.md | 65 +++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 rfcs/0045-deprecate-url-syntax.md diff --git a/rfcs/0045-deprecate-url-syntax.md b/rfcs/0045-deprecate-url-syntax.md new file mode 100644 index 000000000..58ce5ed04 --- /dev/null +++ b/rfcs/0045-deprecate-url-syntax.md @@ -0,0 +1,65 @@ +--- +feature: deprecate_url_syntax +start-date: 2019-04-28 +author: Michael Raskin +co-authors: +related-issues: +--- + +# Summary +[summary]: #summary + +Gradually deprecate the use of unquoted URL syntax in Nix code and especially +Nixpkgs. + +# Motivation +[motivation]: #motivation + +Nix language has a special syntax for URLs. However, 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. + +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. + +Accept PRs that convert unquoted URLs to quoted strings if such PRs are +submitted. + +# 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 a future major changes in the Nix syntax, removal of special URL +syntax might be considered. From cda44754c7585ea6ffe82b9c0fd1854a17db612d Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Sun, 28 Apr 2019 14:09:53 +0200 Subject: [PATCH 02/11] Convert alternatives to a list --- rfcs/0045-deprecate-url-syntax.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rfcs/0045-deprecate-url-syntax.md b/rfcs/0045-deprecate-url-syntax.md index 58ce5ed04..953ee36df 100644 --- a/rfcs/0045-deprecate-url-syntax.md +++ b/rfcs/0045-deprecate-url-syntax.md @@ -47,11 +47,11 @@ 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. +* 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. +* Decide to use unquoted URLs for all URLs without special characters or + variable expansion. # Unresolved questions [unresolved]: #unresolved-questions From e595a1911e0a402e6b75f6966de37817ad8cf820 Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Sun, 28 Apr 2019 18:47:34 +0200 Subject: [PATCH 03/11] Add a mention of tooling in future work --- rfcs/0045-deprecate-url-syntax.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rfcs/0045-deprecate-url-syntax.md b/rfcs/0045-deprecate-url-syntax.md index 953ee36df..7336d3b4f 100644 --- a/rfcs/0045-deprecate-url-syntax.md +++ b/rfcs/0045-deprecate-url-syntax.md @@ -63,3 +63,6 @@ Currently none. In case of a 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 +Nixpkgs. From 6b39d1b818a7d18b8029367adb58606be41edfc6 Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Sun, 28 Apr 2019 23:26:51 +0200 Subject: [PATCH 04/11] A remark from @globin about one more problem with unquoted URLs --- rfcs/0045-deprecate-url-syntax.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rfcs/0045-deprecate-url-syntax.md b/rfcs/0045-deprecate-url-syntax.md index 7336d3b4f..70e9e1f39 100644 --- a/rfcs/0045-deprecate-url-syntax.md +++ b/rfcs/0045-deprecate-url-syntax.md @@ -19,6 +19,8 @@ Nix language has a special syntax for URLs. However, 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 From 268bb83acdfe3ea8ed85302097fb043d3de9dd45 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Wed, 1 May 2019 06:50:06 +0000 Subject: [PATCH 05/11] Grammar edit: comparison of URLs, paths and strings. Co-Authored-By: 7c6f434c <7c6f434c@mail.ru> --- rfcs/0045-deprecate-url-syntax.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rfcs/0045-deprecate-url-syntax.md b/rfcs/0045-deprecate-url-syntax.md index 70e9e1f39..98d76eec5 100644 --- a/rfcs/0045-deprecate-url-syntax.md +++ b/rfcs/0045-deprecate-url-syntax.md @@ -15,7 +15,7 @@ Nixpkgs. # Motivation [motivation]: #motivation -Nix language has a special syntax for URLs. However, unlike paths, URLs do not +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. From ca50c0271abd0b2ffbb6df27df85f913bde00e7c Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Wed, 1 May 2019 06:50:50 +0000 Subject: [PATCH 06/11] Style edit: possibility of future removal Co-Authored-By: 7c6f434c <7c6f434c@mail.ru> --- rfcs/0045-deprecate-url-syntax.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rfcs/0045-deprecate-url-syntax.md b/rfcs/0045-deprecate-url-syntax.md index 98d76eec5..9c7c7b264 100644 --- a/rfcs/0045-deprecate-url-syntax.md +++ b/rfcs/0045-deprecate-url-syntax.md @@ -63,7 +63,7 @@ Currently none. # Future work [future]: #future-work -In case of a future major changes in the Nix syntax, removal of special URL +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 From e97807763263bf4b62e1f1c4dd28b20a8c4b730f Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Sun, 5 May 2019 00:32:06 +0200 Subject: [PATCH 07/11] 0045: commit to using the tooling that now exists --- rfcs/0045-deprecate-url-syntax.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rfcs/0045-deprecate-url-syntax.md b/rfcs/0045-deprecate-url-syntax.md index 70e9e1f39..de1bdcdff 100644 --- a/rfcs/0045-deprecate-url-syntax.md +++ b/rfcs/0045-deprecate-url-syntax.md @@ -37,8 +37,10 @@ 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. -Accept PRs that convert unquoted URLs to quoted strings if such PRs are -submitted. +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 From 177393775f278d69580cea487b0b73b01aeefdc1 Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Thu, 18 Jul 2019 11:44:37 +0000 Subject: [PATCH 08/11] Update rfcs/0045-deprecate-url-syntax.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Shepherd team Co-Authored-By: Domen Kožar --- rfcs/0045-deprecate-url-syntax.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rfcs/0045-deprecate-url-syntax.md b/rfcs/0045-deprecate-url-syntax.md index d80e09a75..59c105456 100644 --- a/rfcs/0045-deprecate-url-syntax.md +++ b/rfcs/0045-deprecate-url-syntax.md @@ -3,6 +3,8 @@ 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 related-issues: --- From cb1d204f39bfcb0af6c22d8eb9cad91bbd95e852 Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Thu, 15 Aug 2019 18:32:54 +0300 Subject: [PATCH 09/11] Fix shepherd list --- rfcs/0045-deprecate-url-syntax.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rfcs/0045-deprecate-url-syntax.md b/rfcs/0045-deprecate-url-syntax.md index 59c105456..3ff1bcc85 100644 --- a/rfcs/0045-deprecate-url-syntax.md +++ b/rfcs/0045-deprecate-url-syntax.md @@ -4,7 +4,7 @@ start-date: 2019-04-28 author: Michael Raskin co-authors: shepherd-leader: Eelco Dolstra -shepherd-team: Eelco Dolstra, Jonas Pfenniger, Silvan Mosberger +shepherd-team: Eelco Dolstra, zimbatm, Silvan Mosberger related-issues: --- From 2a9993704ce1ac552d7da016d4e60ee51c1300a5 Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Mon, 14 Oct 2019 17:32:54 +0200 Subject: [PATCH 10/11] Update based on a discussion --- rfcs/0045-deprecate-url-syntax.md | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/rfcs/0045-deprecate-url-syntax.md b/rfcs/0045-deprecate-url-syntax.md index 3ff1bcc85..1caf48ad1 100644 --- a/rfcs/0045-deprecate-url-syntax.md +++ b/rfcs/0045-deprecate-url-syntax.md @@ -11,7 +11,7 @@ related-issues: # Summary [summary]: #summary -Gradually deprecate the use of unquoted URL syntax in Nix code and especially +Discourage and eventually remove the use of unquoted URL syntax in Nix code and especially Nixpkgs. # Motivation @@ -33,11 +33,9 @@ its use. [design]: #detailed-design Add a note in the Nix manual that the special unquoted URL syntax is -deprecated. +discouraged and will be eventually removed. -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. +Add a note in the Nixpkgs manual that the unquoted URL syntax should not be used anymore. Convert all the unquoted URLs in the Nixpkgs codebase to quoted strings. @@ -67,8 +65,4 @@ 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 -Nixpkgs. +In some future edition of Nix, remove the special URL syntax. From 086786ae4a9dae4f3e5ca6091c1d4c93da56600b Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Thu, 7 Nov 2019 13:12:01 +0100 Subject: [PATCH 11/11] Explicitly make future removal conditional on editions; restrict the claim about no special support to the Nix language itself --- rfcs/0045-deprecate-url-syntax.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/rfcs/0045-deprecate-url-syntax.md b/rfcs/0045-deprecate-url-syntax.md index 1caf48ad1..78d12d411 100644 --- a/rfcs/0045-deprecate-url-syntax.md +++ b/rfcs/0045-deprecate-url-syntax.md @@ -18,14 +18,15 @@ Nixpkgs. [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 +have any special properties in the Nix expression language +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 +Tools targeting only Nixpkgs codebase can ignore URL syntax once Nixpkgs phases out its use. @@ -33,7 +34,7 @@ its use. [design]: #detailed-design Add a note in the Nix manual that the special unquoted URL syntax is -discouraged and will be eventually removed. +discouraged and may be removed in a future edition of the Nix language. Add a note in the Nixpkgs manual that the unquoted URL syntax should not be used anymore. @@ -65,4 +66,4 @@ Currently none. # Future work [future]: #future-work -In some future edition of Nix, remove the special URL syntax. +Currently none.