{"action":"created","issue":{"url":"https://api.github.com/repos/haskell/cabal/issues/3915","repository_url":"https://api.github.com/repos/haskell/cabal","labels_url":"https://api.github.com/repos/haskell/cabal/issues/3915/labels{/name}","comments_url":"https://api.github.com/repos/haskell/cabal/issues/3915/comments","events_url":"https://api.github.com/repos/haskell/cabal/issues/3915/events","html_url":"https://github.com/haskell/cabal/issues/3915","id":180070145,"number":3915,"title":"GHCJS.libAbiHash includes trailing \\n","user":{"login":"stepcut","id":174413,"avatar_url":"https://avatars.githubusercontent.com/u/174413?v=3","gravatar_id":"","url":"https://api.github.com/users/stepcut","html_url":"https://github.com/stepcut","followers_url":"https://api.github.com/users/stepcut/followers","following_url":"https://api.github.com/users/stepcut/following{/other_user}","gists_url":"https://api.github.com/users/stepcut/gists{/gist_id}","starred_url":"https://api.github.com/users/stepcut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stepcut/subscriptions","organizations_url":"https://api.github.com/users/stepcut/orgs","repos_url":"https://api.github.com/users/stepcut/repos","events_url":"https://api.github.com/users/stepcut/events{/privacy}","received_events_url":"https://api.github.com/users/stepcut/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-29T14:46:47Z","updated_at":"2016-09-29T14:49:33Z","closed_at":null,"body":"I believe that `libAbiHash` from this module:\r\n\r\nhttps://github.com/haskell/cabal/blob/master/Cabal/Distribution/Simple/GHCJS.hs\r\n\r\nIs including a trailing newline when calculating the hash. It calculates the hash by calling ghcjs via `getProgramInvocationOutput` and does not appear to do anything to strip any trailing newlines.\r\n\r\nIn my particular case, I ran into an issue where `libAbiHash` was being used to calculate the `InstalledPackageId` for a reexported-module. The `\\n` in the hash was being preserved all the way into the `.conf` file generated by `./Setup register`.\r\n\r\nI changed the last line of `libAbiHash` to:\r\n\r\n```\r\n  s <- getProgramInvocationOutput verbosity (ghcInvocation ghcjsProg comp ghcArgs)\r\n  return $ filter (/= '\\n') s\r\n```\r\n\r\nAnd my problems went away.\r\n\r\nI am on OS X. I ran into this issue with `Cabal-1.22.5.0` that is bundled with GHC 7.10.3, but I don't see any reason why it would not still exist."},"comment":{"url":"https://api.github.com/repos/haskell/cabal/issues/comments/250488799","html_url":"https://github.com/haskell/cabal/issues/3915#issuecomment-250488799","issue_url":"https://api.github.com/repos/haskell/cabal/issues/3915","id":250488799,"user":{"login":"dcoutts","id":1339423,"avatar_url":"https://avatars.githubusercontent.com/u/1339423?v=3","gravatar_id":"","url":"https://api.github.com/users/dcoutts","html_url":"https://github.com/dcoutts","followers_url":"https://api.github.com/users/dcoutts/followers","following_url":"https://api.github.com/users/dcoutts/following{/other_user}","gists_url":"https://api.github.com/users/dcoutts/gists{/gist_id}","starred_url":"https://api.github.com/users/dcoutts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcoutts/subscriptions","organizations_url":"https://api.github.com/users/dcoutts/orgs","repos_url":"https://api.github.com/users/dcoutts/repos","events_url":"https://api.github.com/users/dcoutts/events{/privacy}","received_events_url":"https://api.github.com/users/dcoutts/received_events","type":"User","site_admin":false},"created_at":"2016-09-29T14:49:33Z","updated_at":"2016-09-29T14:49:33Z","body":"We ought to do a vague sanity check on the output. e.g.\r\n\r\n    case words s of\r\n      [h] | all isValidHashChar h -> return h\r\n      _ -> fail $ \"unexpected output from 'ghcjs --abi-hash': \" ++ s"}}
{"actor":{"display_login":"dcoutts"}}