{"action":"created","issue":{"url":"https://api.github.com/repos/haskell/haskell-mode/issues/1306","repository_url":"https://api.github.com/repos/haskell/haskell-mode","labels_url":"https://api.github.com/repos/haskell/haskell-mode/issues/1306/labels{/name}","comments_url":"https://api.github.com/repos/haskell/haskell-mode/issues/1306/comments","events_url":"https://api.github.com/repos/haskell/haskell-mode/issues/1306/events","html_url":"https://github.com/haskell/haskell-mode/pull/1306","id":152358207,"number":1306,"title":"Fix logic for running cabal directly.","user":{"login":"mdorman","id":333344,"avatar_url":"https://avatars.githubusercontent.com/u/333344?v=3","gravatar_id":"","url":"https://api.github.com/users/mdorman","html_url":"https://github.com/mdorman","followers_url":"https://api.github.com/users/mdorman/followers","following_url":"https://api.github.com/users/mdorman/following{/other_user}","gists_url":"https://api.github.com/users/mdorman/gists{/gist_id}","starred_url":"https://api.github.com/users/mdorman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdorman/subscriptions","organizations_url":"https://api.github.com/users/mdorman/orgs","repos_url":"https://api.github.com/users/mdorman/repos","events_url":"https://api.github.com/users/mdorman/events{/privacy}","received_events_url":"https://api.github.com/users/mdorman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2016-05-01T19:10:48Z","updated_at":"2016-05-02T23:55:31Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/haskell/haskell-mode/pulls/1306","html_url":"https://github.com/haskell/haskell-mode/pull/1306","diff_url":"https://github.com/haskell/haskell-mode/pull/1306.diff","patch_url":"https://github.com/haskell/haskell-mode/pull/1306.patch"},"body":"To see the failure, start a fresh copy of emacs, load a .cabal file, M-x\r\nhaskell-process-cabal-build; while the logic in haskell-process-do-cabal\r\nsuggests that that should not require an interactive process, it\r\ncomplains that there is no interactive process.\r\n\r\nI suspect this has been broken for a while (perhaps always).  The\r\nfailure stems from the fact that (haskell-interactive-process) throws an\r\nuncaught error if there is no interacive process, which aborts the\r\nfunction.  If that is wrapped to mask the error, (process-status child)\r\nalso throws an uncaught error, which aborts the function.\r\n\r\nThus the direct cabal invocation code would never be reached.\r\n\r\nThis is the least intrusive fix I can see---wrapping both calls\r\nwith (ignore-errors), and not even checking (process-status) if we don't\r\nhave a process.  In manual testing it behaves as expected, running\r\n`cabal build`.\r\n\r\nA more extensive fix---which would rewrite the conditional logic to wrap\r\nall the dangerous bits in a single (ignore-errors)---would almost\r\ncertainly swap positions of the indirect cabal invocation and the direct\r\ncabal invocation, so there would be much more churn.  Still, it might\r\nproduce a nicer overall result, if anyone wants to see that."},"comment":{"url":"https://api.github.com/repos/haskell/haskell-mode/issues/comments/216398853","html_url":"https://github.com/haskell/haskell-mode/pull/1306#issuecomment-216398853","issue_url":"https://api.github.com/repos/haskell/haskell-mode/issues/1306","id":216398853,"user":{"login":"mdorman","id":333344,"avatar_url":"https://avatars.githubusercontent.com/u/333344?v=3","gravatar_id":"","url":"https://api.github.com/users/mdorman","html_url":"https://github.com/mdorman","followers_url":"https://api.github.com/users/mdorman/followers","following_url":"https://api.github.com/users/mdorman/following{/other_user}","gists_url":"https://api.github.com/users/mdorman/gists{/gist_id}","starred_url":"https://api.github.com/users/mdorman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdorman/subscriptions","organizations_url":"https://api.github.com/users/mdorman/orgs","repos_url":"https://api.github.com/users/mdorman/repos","events_url":"https://api.github.com/users/mdorman/events{/privacy}","received_events_url":"https://api.github.com/users/mdorman/received_events","type":"User","site_admin":false},"created_at":"2016-05-02T23:55:31Z","updated_at":"2016-05-02T23:55:31Z","body":"@fice-t I don't have enough perspective to say; it's not clear to me that `haskell-process-process` can never return something that would cause `process-status` to throw an error?"}}