{"action":"created","issue":{"url":"https://api.github.com/repos/NixOS/nixpkgs/issues/18162","repository_url":"https://api.github.com/repos/NixOS/nixpkgs","labels_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/18162/labels{/name}","comments_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/18162/comments","events_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/18162/events","html_url":"https://github.com/NixOS/nixpkgs/issues/18162","id":174282800,"number":18162,"title":"Packages potentially breaking version parsing","user":{"login":"joepie91","id":1663259,"avatar_url":"https://avatars.githubusercontent.com/u/1663259?v=3","gravatar_id":"","url":"https://api.github.com/users/joepie91","html_url":"https://github.com/joepie91","followers_url":"https://api.github.com/users/joepie91/followers","following_url":"https://api.github.com/users/joepie91/following{/other_user}","gists_url":"https://api.github.com/users/joepie91/gists{/gist_id}","starred_url":"https://api.github.com/users/joepie91/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joepie91/subscriptions","organizations_url":"https://api.github.com/users/joepie91/orgs","repos_url":"https://api.github.com/users/joepie91/repos","events_url":"https://api.github.com/users/joepie91/events{/privacy}","received_events_url":"https://api.github.com/users/joepie91/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/NixOS/nixpkgs/labels/6.topic:%20policy%20discussion","name":"6.topic: policy discussion","color":"fef2c0"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-08-31T14:07:52Z","updated_at":"2016-08-31T17:57:25Z","closed_at":null,"body":"## Issue description\r\n\r\nAccording to the [Nix source](https://github.com/NixOS/nix/blob/6bd2c7bb386de16310fa5534275e6e638be60862/src/libexpr/names.cc#L14-L18), the 'version' of a package is determined from the name as follows:\r\n\r\n> Parse a derivation name. The `name` part of a derivation name is everything up to but not including the first dash *not* followed by a letter. The `version` part is the rest (excluding the separating dash).\r\n\r\n... however, there are currently various packages that violate this pattern - for example, the various `git-` versions. One example is `velox-git-2015-11-03`, which should be parsed (according to the package author's intentions) as:\r\n\r\n* __Name:__ `velox`\r\n* __Version:__ `git-2015-11-03`\r\n\r\n... but is instead parsed as:\r\n\r\n* __Name:__ `velox-git`\r\n* __Version:__ `2015-11-03`\r\n\r\nThis problem has two consequences:\r\n\r\n* Tools that attempt to parse the version of a package according to the rules described in the source, will get back the wrong package names/versions.\r\n* *Removing* the `git-` prefix for a package (whether to fix this issue, or because a package switches to 'real' versioned releases), might result in upgrades breaking - `velox-git` and `velox` would be considered to be different packages, and even if the `git` prefix were to be ignored internally, `2015-11-03` might still be considered a higher version than for example `1.2`.\r\n\r\nI'm not sure whether the solution here is in changing the parsing rules, or in changing the package names. For example - if a `git` prefix were not available for use, how would one package unversioned releases that come straight from Git?\r\n\r\n(EDIT: I was just pointed at the existence of the [package naming guidelines](http://hydra.nixos.org/build/39511076/download/1/nixpkgs/manual.html#sec-package-naming). Should this not be amended to call them rules rather than guidelines? As it stands, it's not obvious at all that there are technical consequences to not following them...)\r\n\r\n### Steps to reproduce\r\n\r\nA full listing of affected packages due to the `git` prefix can be obtained as follows:\r\n\r\n```\r\nnix-env -qaP | grep '\\-git\\-'\r\n```\r\n\r\n... however, there may be other version prefixes that I am not aware of, that have the same issue.\r\n\r\n## Technical details\r\n\r\n* System: 16.03.1242.c5cbda2 (Emu)\r\n* Nix version: nix-env (Nix) 1.11.2\r\n* Nixpkgs version: 6.03.1242.c5cbda2\r\n"},"comment":{"url":"https://api.github.com/repos/NixOS/nixpkgs/issues/comments/243847149","html_url":"https://github.com/NixOS/nixpkgs/issues/18162#issuecomment-243847149","issue_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/18162","id":243847149,"user":{"login":"SN4T14","id":5083209,"avatar_url":"https://avatars.githubusercontent.com/u/5083209?v=3","gravatar_id":"","url":"https://api.github.com/users/SN4T14","html_url":"https://github.com/SN4T14","followers_url":"https://api.github.com/users/SN4T14/followers","following_url":"https://api.github.com/users/SN4T14/following{/other_user}","gists_url":"https://api.github.com/users/SN4T14/gists{/gist_id}","starred_url":"https://api.github.com/users/SN4T14/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SN4T14/subscriptions","organizations_url":"https://api.github.com/users/SN4T14/orgs","repos_url":"https://api.github.com/users/SN4T14/repos","events_url":"https://api.github.com/users/SN4T14/events{/privacy}","received_events_url":"https://api.github.com/users/SN4T14/received_events","type":"User","site_admin":false},"created_at":"2016-08-31T17:57:24Z","updated_at":"2016-08-31T17:57:24Z","body":"Sure, it'll be fine until a package switches to a non-git version, and now suddenly the package is parsed as \"velox\" instead of \"velox-git\"."}}
{"actor":{"display_login":"SN4T14"}}