{"action":"closed","number":581,"pull_request":{"url":"https://api.github.com/repos/commercialhaskell/intero/pulls/581","id":221480772,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIxNDgwNzcy","html_url":"https://github.com/commercialhaskell/intero/pull/581","diff_url":"https://github.com/commercialhaskell/intero/pull/581.diff","patch_url":"https://github.com/commercialhaskell/intero/pull/581.patch","issue_url":"https://api.github.com/repos/commercialhaskell/intero/issues/581","number":581,"state":"closed","locked":false,"title":"Networked intero","user":{"login":"chrisdone","id":11019,"node_id":"MDQ6VXNlcjExMDE5","avatar_url":"https://avatars3.githubusercontent.com/u/11019?v=4","gravatar_id":"","url":"https://api.github.com/users/chrisdone","html_url":"https://github.com/chrisdone","followers_url":"https://api.github.com/users/chrisdone/followers","following_url":"https://api.github.com/users/chrisdone/following{/other_user}","gists_url":"https://api.github.com/users/chrisdone/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisdone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisdone/subscriptions","organizations_url":"https://api.github.com/users/chrisdone/orgs","repos_url":"https://api.github.com/users/chrisdone/repos","events_url":"https://api.github.com/users/chrisdone/events{/privacy}","received_events_url":"https://api.github.com/users/chrisdone/received_events","type":"User","site_admin":false},"body":"Pinging @purcell.\r\n\r\nThis is a rather substantial change to intero. I've yet to run the GHC test suites, this serves as a preview PR that I'm testing on work projects. It's not a big change to the elisp, but the executable has changed a fair bit.\r\n\r\n# The problem\r\n\r\nCurrently, Emacs launches intero the binary as a piped process and controls it end to end, with `stack` wrapping it up with all the right packages and target choices. This provides a great user experience, but sometimes you need to launch intero outside of your regular environment. Think:\r\n\r\n* Working on a client nix project\r\n* Working on something inside a docker container\r\n* Working on something inside a VM (e.g. VirtualBox)\r\n\r\nIn each of these cases, the way to invoke intero can be complicated.\r\n\r\n# The solution\r\n\r\nChange the way Emacs talks to intero. Make it talk over a network for everything.\r\n\r\n* Emacs already abstracts over whether you're talking to a piped process or a network socket with the same API. This code basically didn't have to change. I simply changed the launcher to either:\r\n  1. If Intero is already running on a port, just connect to that instead with `make-network-process`.\r\n  2. If intero isn't running, then start it ourselves with the existing `start-file-process` call.\r\n\r\nI've tested this with an intero invocation inside a docker-compose project, with port 1234 exposed. I specify `INTERO_SERVICE_PORT=1234` and intero starts, listens on that port, and writes `1234` to `.intero/port`. Emacs automatically checks for this file and auto-connects to that process. \r\n\r\nYou have to make sure that Emacs and the docker/vm container share the same directory roots with e.g. `docker run -v$(pwd):$(pwd)`.\r\n\r\nAs for the intero binary, the main change is that all commands will either write to stdout or a handle to a socket. Additionally, compiler messages are captured and written to the socket instead of directly to stdout/stderr.\r\n\r\nThis also represents a step forward to moving away from pretending to be a commandline app and closer to being a networked service. It also represents a step toward something like Microsoft's standard IDE protocol. But I'd hope by that point we can all switch to HIE.\r\n\r\n# Remaining work\r\n\r\n Some stand-out issues:\r\n\r\n* The Emacs lisp code could use the concept of \"workers\" already built into intero's internal API, and do away with the \"network call\" that I implemented earlier this year (or last?). Instead, we'd have the regular `'backend` worker and then a `'readonly` worker which does readonly commands (querying).\r\n* We may have to update tramp support, or consider removing it and recommending rsync/sshfs.\r\n* Testing on windows?\r\n* Test on various GHCs.\r\n* If we go forward with this approach, we ought to make it continue to work in the usual piped fashion, so that upstream users (vim, VS Code, etc.) don't have to make any changes.","created_at":"2018-10-09T15:16:15Z","updated_at":"2018-10-25T13:20:56Z","closed_at":"2018-10-25T13:20:56Z","merged_at":null,"merge_commit_sha":"49629866e9aae25436f5ceef98f0bd13b41f9c3c","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/commercialhaskell/intero/pulls/581/commits","review_comments_url":"https://api.github.com/repos/commercialhaskell/intero/pulls/581/comments","review_comment_url":"https://api.github.com/repos/commercialhaskell/intero/pulls/comments{/number}","comments_url":"https://api.github.com/repos/commercialhaskell/intero/issues/581/comments","statuses_url":"https://api.github.com/repos/commercialhaskell/intero/statuses/7a0acb770fd140f08d892b39e7b1e6db82970145","head":{"label":"commercialhaskell:networked-intero","ref":"networked-intero","sha":"7a0acb770fd140f08d892b39e7b1e6db82970145","user":{"login":"commercialhaskell","id":10633049,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNjMzMDQ5","avatar_url":"https://avatars1.githubusercontent.com/u/10633049?v=4","gravatar_id":"","url":"https://api.github.com/users/commercialhaskell","html_url":"https://github.com/commercialhaskell","followers_url":"https://api.github.com/users/commercialhaskell/followers","following_url":"https://api.github.com/users/commercialhaskell/following{/other_user}","gists_url":"https://api.github.com/users/commercialhaskell/gists{/gist_id}","starred_url":"https://api.github.com/users/commercialhaskell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/commercialhaskell/subscriptions","organizations_url":"https://api.github.com/users/commercialhaskell/orgs","repos_url":"https://api.github.com/users/commercialhaskell/repos","events_url":"https://api.github.com/users/commercialhaskell/events{/privacy}","received_events_url":"https://api.github.com/users/commercialhaskell/received_events","type":"Organization","site_admin":false},"repo":{"id":25432731,"node_id":"MDEwOlJlcG9zaXRvcnkyNTQzMjczMQ==","name":"intero","full_name":"commercialhaskell/intero","private":false,"owner":{"login":"commercialhaskell","id":10633049,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNjMzMDQ5","avatar_url":"https://avatars1.githubusercontent.com/u/10633049?v=4","gravatar_id":"","url":"https://api.github.com/users/commercialhaskell","html_url":"https://github.com/commercialhaskell","followers_url":"https://api.github.com/users/commercialhaskell/followers","following_url":"https://api.github.com/users/commercialhaskell/following{/other_user}","gists_url":"https://api.github.com/users/commercialhaskell/gists{/gist_id}","starred_url":"https://api.github.com/users/commercialhaskell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/commercialhaskell/subscriptions","organizations_url":"https://api.github.com/users/commercialhaskell/orgs","repos_url":"https://api.github.com/users/commercialhaskell/repos","events_url":"https://api.github.com/users/commercialhaskell/events{/privacy}","received_events_url":"https://api.github.com/users/commercialhaskell/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/commercialhaskell/intero","description":"Complete interactive development program for Haskell","fork":false,"url":"https://api.github.com/repos/commercialhaskell/intero","forks_url":"https://api.github.com/repos/commercialhaskell/intero/forks","keys_url":"https://api.github.com/repos/commercialhaskell/intero/keys{/key_id}","collaborators_url":"https://api.github.com/repos/commercialhaskell/intero/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/commercialhaskell/intero/teams","hooks_url":"https://api.github.com/repos/commercialhaskell/intero/hooks","issue_events_url":"https://api.github.com/repos/commercialhaskell/intero/issues/events{/number}","events_url":"https://api.github.com/repos/commercialhaskell/intero/events","assignees_url":"https://api.github.com/repos/commercialhaskell/intero/assignees{/user}","branches_url":"https://api.github.com/repos/commercialhaskell/intero/branches{/branch}","tags_url":"https://api.github.com/repos/commercialhaskell/intero/tags","blobs_url":"https://api.github.com/repos/commercialhaskell/intero/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/commercialhaskell/intero/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/commercialhaskell/intero/git/refs{/sha}","trees_url":"https://api.github.com/repos/commercialhaskell/intero/git/trees{/sha}","statuses_url":"https://api.github.com/repos/commercialhaskell/intero/statuses/{sha}","languages_url":"https://api.github.com/repos/commercialhaskell/intero/languages","stargazers_url":"https://api.github.com/repos/commercialhaskell/intero/stargazers","contributors_url":"https://api.github.com/repos/commercialhaskell/intero/contributors","subscribers_url":"https://api.github.com/repos/commercialhaskell/intero/subscribers","subscription_url":"https://api.github.com/repos/commercialhaskell/intero/subscription","commits_url":"https://api.github.com/repos/commercialhaskell/intero/commits{/sha}","git_commits_url":"https://api.github.com/repos/commercialhaskell/intero/git/commits{/sha}","comments_url":"https://api.github.com/repos/commercialhaskell/intero/comments{/number}","issue_comment_url":"https://api.github.com/repos/commercialhaskell/intero/issues/comments{/number}","contents_url":"https://api.github.com/repos/commercialhaskell/intero/contents/{+path}","compare_url":"https://api.github.com/repos/commercialhaskell/intero/compare/{base}...{head}","merges_url":"https://api.github.com/repos/commercialhaskell/intero/merges","archive_url":"https://api.github.com/repos/commercialhaskell/intero/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/commercialhaskell/intero/downloads","issues_url":"https://api.github.com/repos/commercialhaskell/intero/issues{/number}","pulls_url":"https://api.github.com/repos/commercialhaskell/intero/pulls{/number}","milestones_url":"https://api.github.com/repos/commercialhaskell/intero/milestones{/number}","notifications_url":"https://api.github.com/repos/commercialhaskell/intero/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/commercialhaskell/intero/labels{/name}","releases_url":"https://api.github.com/repos/commercialhaskell/intero/releases{/id}","deployments_url":"https://api.github.com/repos/commercialhaskell/intero/deployments","created_at":"2014-10-19T16:29:25Z","updated_at":"2018-10-24T11:05:13Z","pushed_at":"2018-10-17T14:31:52Z","git_url":"git://github.com/commercialhaskell/intero.git","ssh_url":"git@github.com:commercialhaskell/intero.git","clone_url":"https://github.com/commercialhaskell/intero.git","svn_url":"https://github.com/commercialhaskell/intero","homepage":"","size":2505,"stargazers_count":883,"watchers_count":883,"language":"Haskell","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":117,"mirror_url":null,"archived":false,"open_issues_count":120,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":117,"open_issues":120,"watchers":883,"default_branch":"master"}},"base":{"label":"commercialhaskell:master","ref":"master","sha":"0e435098e00e7de6f907abbc5063f8d68d8230a1","user":{"login":"commercialhaskell","id":10633049,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNjMzMDQ5","avatar_url":"https://avatars1.githubusercontent.com/u/10633049?v=4","gravatar_id":"","url":"https://api.github.com/users/commercialhaskell","html_url":"https://github.com/commercialhaskell","followers_url":"https://api.github.com/users/commercialhaskell/followers","following_url":"https://api.github.com/users/commercialhaskell/following{/other_user}","gists_url":"https://api.github.com/users/commercialhaskell/gists{/gist_id}","starred_url":"https://api.github.com/users/commercialhaskell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/commercialhaskell/subscriptions","organizations_url":"https://api.github.com/users/commercialhaskell/orgs","repos_url":"https://api.github.com/users/commercialhaskell/repos","events_url":"https://api.github.com/users/commercialhaskell/events{/privacy}","received_events_url":"https://api.github.com/users/commercialhaskell/received_events","type":"Organization","site_admin":false},"repo":{"id":25432731,"node_id":"MDEwOlJlcG9zaXRvcnkyNTQzMjczMQ==","name":"intero","full_name":"commercialhaskell/intero","private":false,"owner":{"login":"commercialhaskell","id":10633049,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNjMzMDQ5","avatar_url":"https://avatars1.githubusercontent.com/u/10633049?v=4","gravatar_id":"","url":"https://api.github.com/users/commercialhaskell","html_url":"https://github.com/commercialhaskell","followers_url":"https://api.github.com/users/commercialhaskell/followers","following_url":"https://api.github.com/users/commercialhaskell/following{/other_user}","gists_url":"https://api.github.com/users/commercialhaskell/gists{/gist_id}","starred_url":"https://api.github.com/users/commercialhaskell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/commercialhaskell/subscriptions","organizations_url":"https://api.github.com/users/commercialhaskell/orgs","repos_url":"https://api.github.com/users/commercialhaskell/repos","events_url":"https://api.github.com/users/commercialhaskell/events{/privacy}","received_events_url":"https://api.github.com/users/commercialhaskell/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/commercialhaskell/intero","description":"Complete interactive development program for Haskell","fork":false,"url":"https://api.github.com/repos/commercialhaskell/intero","forks_url":"https://api.github.com/repos/commercialhaskell/intero/forks","keys_url":"https://api.github.com/repos/commercialhaskell/intero/keys{/key_id}","collaborators_url":"https://api.github.com/repos/commercialhaskell/intero/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/commercialhaskell/intero/teams","hooks_url":"https://api.github.com/repos/commercialhaskell/intero/hooks","issue_events_url":"https://api.github.com/repos/commercialhaskell/intero/issues/events{/number}","events_url":"https://api.github.com/repos/commercialhaskell/intero/events","assignees_url":"https://api.github.com/repos/commercialhaskell/intero/assignees{/user}","branches_url":"https://api.github.com/repos/commercialhaskell/intero/branches{/branch}","tags_url":"https://api.github.com/repos/commercialhaskell/intero/tags","blobs_url":"https://api.github.com/repos/commercialhaskell/intero/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/commercialhaskell/intero/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/commercialhaskell/intero/git/refs{/sha}","trees_url":"https://api.github.com/repos/commercialhaskell/intero/git/trees{/sha}","statuses_url":"https://api.github.com/repos/commercialhaskell/intero/statuses/{sha}","languages_url":"https://api.github.com/repos/commercialhaskell/intero/languages","stargazers_url":"https://api.github.com/repos/commercialhaskell/intero/stargazers","contributors_url":"https://api.github.com/repos/commercialhaskell/intero/contributors","subscribers_url":"https://api.github.com/repos/commercialhaskell/intero/subscribers","subscription_url":"https://api.github.com/repos/commercialhaskell/intero/subscription","commits_url":"https://api.github.com/repos/commercialhaskell/intero/commits{/sha}","git_commits_url":"https://api.github.com/repos/commercialhaskell/intero/git/commits{/sha}","comments_url":"https://api.github.com/repos/commercialhaskell/intero/comments{/number}","issue_comment_url":"https://api.github.com/repos/commercialhaskell/intero/issues/comments{/number}","contents_url":"https://api.github.com/repos/commercialhaskell/intero/contents/{+path}","compare_url":"https://api.github.com/repos/commercialhaskell/intero/compare/{base}...{head}","merges_url":"https://api.github.com/repos/commercialhaskell/intero/merges","archive_url":"https://api.github.com/repos/commercialhaskell/intero/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/commercialhaskell/intero/downloads","issues_url":"https://api.github.com/repos/commercialhaskell/intero/issues{/number}","pulls_url":"https://api.github.com/repos/commercialhaskell/intero/pulls{/number}","milestones_url":"https://api.github.com/repos/commercialhaskell/intero/milestones{/number}","notifications_url":"https://api.github.com/repos/commercialhaskell/intero/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/commercialhaskell/intero/labels{/name}","releases_url":"https://api.github.com/repos/commercialhaskell/intero/releases{/id}","deployments_url":"https://api.github.com/repos/commercialhaskell/intero/deployments","created_at":"2014-10-19T16:29:25Z","updated_at":"2018-10-24T11:05:13Z","pushed_at":"2018-10-17T14:31:52Z","git_url":"git://github.com/commercialhaskell/intero.git","ssh_url":"git@github.com:commercialhaskell/intero.git","clone_url":"https://github.com/commercialhaskell/intero.git","svn_url":"https://github.com/commercialhaskell/intero","homepage":"","size":2505,"stargazers_count":883,"watchers_count":883,"language":"Haskell","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":117,"mirror_url":null,"archived":false,"open_issues_count":120,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":117,"open_issues":120,"watchers":883,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/commercialhaskell/intero/pulls/581"},"html":{"href":"https://github.com/commercialhaskell/intero/pull/581"},"issue":{"href":"https://api.github.com/repos/commercialhaskell/intero/issues/581"},"comments":{"href":"https://api.github.com/repos/commercialhaskell/intero/issues/581/comments"},"review_comments":{"href":"https://api.github.com/repos/commercialhaskell/intero/pulls/581/comments"},"review_comment":{"href":"https://api.github.com/repos/commercialhaskell/intero/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/commercialhaskell/intero/pulls/581/commits"},"statuses":{"href":"https://api.github.com/repos/commercialhaskell/intero/statuses/7a0acb770fd140f08d892b39e7b1e6db82970145"}},"author_association":"MEMBER","merged":false,"mergeable":true,"rebaseable":false,"mergeable_state":"unstable","merged_by":null,"comments":2,"review_comments":0,"maintainer_can_modify":false,"commits":7,"additions":409,"deletions":258,"changed_files":4}}
{"actor":{"display_login":"chrisdone"}}