{"action":"created","issue":{"url":"https://api.github.com/repos/haskell/cabal/issues/2516","labels_url":"https://api.github.com/repos/haskell/cabal/issues/2516/labels{/name}","comments_url":"https://api.github.com/repos/haskell/cabal/issues/2516/comments","events_url":"https://api.github.com/repos/haskell/cabal/issues/2516/events","html_url":"https://github.com/haskell/cabal/pull/2516","id":65709876,"number":2516,"title":"Eliminate duplicate hsc2hs command line arguments","user":{"login":"anton-dessiatov","id":2873280,"avatar_url":"https://avatars.githubusercontent.com/u/2873280?v=3","gravatar_id":"","url":"https://api.github.com/users/anton-dessiatov","html_url":"https://github.com/anton-dessiatov","followers_url":"https://api.github.com/users/anton-dessiatov/followers","following_url":"https://api.github.com/users/anton-dessiatov/following{/other_user}","gists_url":"https://api.github.com/users/anton-dessiatov/gists{/gist_id}","starred_url":"https://api.github.com/users/anton-dessiatov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anton-dessiatov/subscriptions","organizations_url":"https://api.github.com/users/anton-dessiatov/orgs","repos_url":"https://api.github.com/users/anton-dessiatov/repos","events_url":"https://api.github.com/users/anton-dessiatov/events{/privacy}","received_events_url":"https://api.github.com/users/anton-dessiatov/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-04-01T15:17:19Z","updated_at":"2015-07-31T14:05:35Z","closed_at":"2015-04-03T13:44:14Z","pull_request":{"url":"https://api.github.com/repos/haskell/cabal/pulls/2516","html_url":"https://github.com/haskell/cabal/pull/2516","diff_url":"https://github.com/haskell/cabal/pull/2516.diff","patch_url":"https://github.com/haskell/cabal/pull/2516.patch"},"body":"I've recently stumbled upon an issue that didn't let me to build my Haskell project on Windows. It manifested itself as an error:\r\n\r\n`cabal: w:\\haskell\\bin\\hsc2hs.exe: does not exist`\r\n\r\nThe file that seemed to be missing (hsc2hs.exe binary) was actually present in necessary directory, so I started investigating the issue.\r\n\r\nIt turned out that the core reason was that hsc2hs command line exceeded the maximum allowed length of 32767 characters. The reason why it exceeded the limit was the huge amount of duplicate `--cflag` arguments that appeared from the dependent packages. As a quick fix I just added a `nub` function call to eliminate duplicate arguments and the problem is fixed at least for my project.\r\n\r\nWhile this fix doesn't completely eliminate the problem (at some point there eventually will be user with huge number of distinct arguments to hsc2hs), it still does offer some help to me, so I decided to make a pull request."},"comment":{"url":"https://api.github.com/repos/haskell/cabal/issues/comments/126702893","html_url":"https://github.com/haskell/cabal/pull/2516#issuecomment-126702893","issue_url":"https://api.github.com/repos/haskell/cabal/issues/2516","id":126702893,"user":{"login":"christiaanb","id":93169,"avatar_url":"https://avatars.githubusercontent.com/u/93169?v=3","gravatar_id":"","url":"https://api.github.com/users/christiaanb","html_url":"https://github.com/christiaanb","followers_url":"https://api.github.com/users/christiaanb/followers","following_url":"https://api.github.com/users/christiaanb/following{/other_user}","gists_url":"https://api.github.com/users/christiaanb/gists{/gist_id}","starred_url":"https://api.github.com/users/christiaanb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christiaanb/subscriptions","organizations_url":"https://api.github.com/users/christiaanb/orgs","repos_url":"https://api.github.com/users/christiaanb/repos","events_url":"https://api.github.com/users/christiaanb/events{/privacy}","received_events_url":"https://api.github.com/users/christiaanb/received_events","type":"User","site_admin":false},"created_at":"2015-07-31T14:05:35Z","updated_at":"2015-07-31T14:05:35Z","body":"This PR causes installing `binding-GLFW` to fail on OS X with: http://lpaste.net/137660. The problem is, is that you are `nub`ing too many of the `-framework` flags.\r\n\r\nWould your patch still work on windows if you moved `ordNubRight` to line 423: https://github.com/haskell/cabal/blob/master/Cabal/Distribution/Simple/PreProcess.hs#L423"}}