{"action":"created","issue":{"url":"https://api.github.com/repos/nerdvegas/rez/issues/165","labels_url":"https://api.github.com/repos/nerdvegas/rez/issues/165/labels{/name}","comments_url":"https://api.github.com/repos/nerdvegas/rez/issues/165/comments","events_url":"https://api.github.com/repos/nerdvegas/rez/issues/165/events","html_url":"https://github.com/nerdvegas/rez/pull/165","id":64089163,"number":165,"title":"Merging variants sorting algo","user":{"login":"holofermes","id":1163915,"avatar_url":"https://avatars.githubusercontent.com/u/1163915?v=3","gravatar_id":"","url":"https://api.github.com/users/holofermes","html_url":"https://github.com/holofermes","followers_url":"https://api.github.com/users/holofermes/followers","following_url":"https://api.github.com/users/holofermes/following{/other_user}","gists_url":"https://api.github.com/users/holofermes/gists{/gist_id}","starred_url":"https://api.github.com/users/holofermes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/holofermes/subscriptions","organizations_url":"https://api.github.com/users/holofermes/orgs","repos_url":"https://api.github.com/users/holofermes/repos","events_url":"https://api.github.com/users/holofermes/events{/privacy}","received_events_url":"https://api.github.com/users/holofermes/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":15,"created_at":"2015-03-24T20:13:11Z","updated_at":"2015-04-09T08:06:10Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/nerdvegas/rez/pulls/165","html_url":"https://github.com/nerdvegas/rez/pull/165","diff_url":"https://github.com/nerdvegas/rez/pull/165.diff","patch_url":"https://github.com/nerdvegas/rez/pull/165.patch"},"body":""},"comment":{"url":"https://api.github.com/repos/nerdvegas/rez/issues/comments/91145159","html_url":"https://github.com/nerdvegas/rez/pull/165#issuecomment-91145159","issue_url":"https://api.github.com/repos/nerdvegas/rez/issues/165","id":91145159,"user":{"login":"fnaum","id":7018564,"avatar_url":"https://avatars.githubusercontent.com/u/7018564?v=3","gravatar_id":"","url":"https://api.github.com/users/fnaum","html_url":"https://github.com/fnaum","followers_url":"https://api.github.com/users/fnaum/followers","following_url":"https://api.github.com/users/fnaum/following{/other_user}","gists_url":"https://api.github.com/users/fnaum/gists{/gist_id}","starred_url":"https://api.github.com/users/fnaum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fnaum/subscriptions","organizations_url":"https://api.github.com/users/fnaum/orgs","repos_url":"https://api.github.com/users/fnaum/repos","events_url":"https://api.github.com/users/fnaum/events{/privacy}","received_events_url":"https://api.github.com/users/fnaum/received_events","type":"User","site_admin":false},"created_at":"2015-04-09T08:06:10Z","updated_at":"2015-04-09T08:06:10Z","body":"Hi Allan, \r\n\r\nWe merged those changes today, and we have a couple of UT and IT failing. \r\n\r\nThey do fail because the last (arbitrary) criterion of the sorting now is the *variant index (arbitrary but repeatable sort order)*, and before we used to rely in alphabetical order as the last resource .\r\n\r\nConsider:\r\n\r\n    packageA\r\n     - ALboost-1.55.0\r\n     - boost-1.55.0\r\n\r\nand \r\n\r\n    packageB\r\n     - boost-1.55.0\r\n     - ALboost-1.55.0\r\n\r\nWhere `boost` and `AL_boost` are not mutually exclusive, then\r\n\r\n`rez-env packageA packagesB`\r\n\r\nwill end up with one of each variant and we want both to be the same\r\n\r\n    packageA-1.0.0     packageA/1.0.0/boost-1.55.0     \r\n    packageB-1.0.0     packageB/1.0.0/AL_boost-1.55.0\r\n\r\n\r\nSo, sorting by `variant index` is arbitrary and give you repeatable solves across runs, but to get the *consistent* variants when not specified across packages it needs that **all** packages have the variants written in the same order, ie. first the `boost` variants then the `AL_boost` variants \r\n\r\nSorting alphabetically as the last criterion, is also arbitrary, but it gives you *consistency* between runs and also across variants of the packages regardless the order in which they were written.\r\n\r\nOf course, we know that that is a vague question to rez, and if we give more clues to the solver specifying `boost` or `AL_boost` then we get  *consistent* variants across packages.\r\n\r\nwhat do you think?\r\n\r\n\r\n"}}