{"action":"created","issue":{"url":"https://api.github.com/repos/NixOS/cabal2nix/issues/191","labels_url":"https://api.github.com/repos/NixOS/cabal2nix/issues/191/labels{/name}","comments_url":"https://api.github.com/repos/NixOS/cabal2nix/issues/191/comments","events_url":"https://api.github.com/repos/NixOS/cabal2nix/issues/191/events","html_url":"https://github.com/NixOS/cabal2nix/pull/191","id":101676925,"number":191,"title":"hackage2nix as a library","user":{"login":"bennofs","id":3192959,"avatar_url":"https://avatars.githubusercontent.com/u/3192959?v=3","gravatar_id":"","url":"https://api.github.com/users/bennofs","html_url":"https://github.com/bennofs","followers_url":"https://api.github.com/users/bennofs/followers","following_url":"https://api.github.com/users/bennofs/following{/other_user}","gists_url":"https://api.github.com/users/bennofs/gists{/gist_id}","starred_url":"https://api.github.com/users/bennofs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bennofs/subscriptions","organizations_url":"https://api.github.com/users/bennofs/orgs","repos_url":"https://api.github.com/users/bennofs/repos","events_url":"https://api.github.com/users/bennofs/events{/privacy}","received_events_url":"https://api.github.com/users/bennofs/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-08-18T15:00:26Z","updated_at":"2015-09-18T12:32:32Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/NixOS/cabal2nix/pulls/191","html_url":"https://github.com/NixOS/cabal2nix/pull/191","diff_url":"https://github.com/NixOS/cabal2nix/pull/191.diff","patch_url":"https://github.com/NixOS/cabal2nix/pull/191.patch"},"body":"This PR splits the parts of hackage2nix which are responsible for generating the package set in a library, fixing #184. I'm sorry if I have duplicated work (I didn't see #184 was assigned until after I already worked on trying to write a stackage2nix). \r\n\r\nI also made the configuring phase (deciding whether to jailbreak, enable tests, etc) a bit more flexible. For example, stackage already contains information on whether to run the tests or not, so it makes sense to be able to directly use of that.\r\n\r\nThe more flexible package configuration also allowed me to fix a bug in package generation: some packages where needlessly marked as broken, because there tests depend on unavailable packages. The new behavior is that in such a case, the package is not marked as broken, but the tests are disabled. hackage2nix will now try the following configurations, in this order (the first configuration to succeed is used):\r\n\r\n* Tests enabled, no jailbreak\r\n* Tests enabled, jailbreak\r\n* Tests disabled, no jailbreak\r\n* Tests disabled, jailbreak\r\n\r\nIf all of that fails, a broken derivation will be generated. \r\n\r\nThe PR also includes some fixes to make hackage2nix use less memory. "},"comment":{"url":"https://api.github.com/repos/NixOS/cabal2nix/issues/comments/141439416","html_url":"https://github.com/NixOS/cabal2nix/pull/191#issuecomment-141439416","issue_url":"https://api.github.com/repos/NixOS/cabal2nix/issues/191","id":141439416,"user":{"login":"bennofs","id":3192959,"avatar_url":"https://avatars.githubusercontent.com/u/3192959?v=3","gravatar_id":"","url":"https://api.github.com/users/bennofs","html_url":"https://github.com/bennofs","followers_url":"https://api.github.com/users/bennofs/followers","following_url":"https://api.github.com/users/bennofs/following{/other_user}","gists_url":"https://api.github.com/users/bennofs/gists{/gist_id}","starred_url":"https://api.github.com/users/bennofs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bennofs/subscriptions","organizations_url":"https://api.github.com/users/bennofs/orgs","repos_url":"https://api.github.com/users/bennofs/repos","events_url":"https://api.github.com/users/bennofs/events{/privacy}","received_events_url":"https://api.github.com/users/bennofs/received_events","type":"User","site_admin":false},"created_at":"2015-09-18T12:32:32Z","updated_at":"2015-09-18T12:32:32Z","body":"I agree with you on this. The issue again is that the package itself and the test run of it aren't separate: as an end-user, I might want to choose not to run the tests, but still use the binary cache for the library itself.\r\n\r\nNote however that tests are *only* disabled when the test suite depends on library that is not available in nixpkgs. IMO, that means that the tests are broken, not the package as a whole. But that's currently not expressible in nixpkgs, so I'm fine with either way. "}}