{"action":"created","issue":{"url":"https://api.github.com/repos/haskell/cabal/issues/976","repository_url":"https://api.github.com/repos/haskell/cabal","labels_url":"https://api.github.com/repos/haskell/cabal/issues/976/labels{/name}","comments_url":"https://api.github.com/repos/haskell/cabal/issues/976/comments","events_url":"https://api.github.com/repos/haskell/cabal/issues/976/events","html_url":"https://github.com/haskell/cabal/issues/976","id":5587073,"number":976,"title":"Parallelise `cabal build`","user":{"login":"23Skidoo","id":47439,"avatar_url":"https://avatars0.githubusercontent.com/u/47439?v=3","gravatar_id":"","url":"https://api.github.com/users/23Skidoo","html_url":"https://github.com/23Skidoo","followers_url":"https://api.github.com/users/23Skidoo/followers","following_url":"https://api.github.com/users/23Skidoo/following{/other_user}","gists_url":"https://api.github.com/users/23Skidoo/gists{/gist_id}","starred_url":"https://api.github.com/users/23Skidoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/23Skidoo/subscriptions","organizations_url":"https://api.github.com/users/23Skidoo/orgs","repos_url":"https://api.github.com/users/23Skidoo/repos","events_url":"https://api.github.com/users/23Skidoo/events{/privacy}","received_events_url":"https://api.github.com/users/23Skidoo/received_events","type":"User","site_admin":false},"labels":[{"id":5625697,"url":"https://api.github.com/repos/haskell/cabal/labels/cabal-install:%20other","name":"cabal-install: other","color":"d93f0b","default":false},{"id":414951743,"url":"https://api.github.com/repos/haskell/cabal/labels/meta:%2023Skidoo","name":"meta: 23Skidoo","color":"d4c5f9","default":false},{"id":437500557,"url":"https://api.github.com/repos/haskell/cabal/labels/old-milestone:%20cabal-install%202.0","name":"old-milestone: cabal-install 2.0","color":"c5def5","default":false},{"id":1389140,"url":"https://api.github.com/repos/haskell/cabal/labels/type:%20enhancement","name":"type: enhancement","color":"e99695","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":31,"created_at":"2012-07-13T02:49:45Z","updated_at":"2017-04-30T02:58:48Z","closed_at":null,"body":"Now that the package-level parallel install has been implemented (see #440), the next logical step is to extend `cabal build` with support for building multiple modules, components and/or build variants (static/shared/profiling) in parallel. This functionality should be also integrated with `cabal install` in such a way that we don't over- or underutilise the available cores.\n\nA prototype implementation of a parallel `cabal build` is [already available as a standalone tool](https://github.com/23Skidoo/ghc-parmake). It works by first extracting a module dependency graph with 'ghc -M' and then running multiple 'ghc -c' processes in parallel.\n\nSince the parallel install code uses the external setup method exclusively, integrating parallel `cabal build` with parallel install will require using IPC. A single coordinating `cabal install -j N` process will spawn a number of `setup.exe build --semaphore=/path/to/semaphore` children, and each child will be building at most N modules simultaneously. An added benefit of this approach is that nothing special will have to be done to support custom setup scripts.\n\nAn important issue is that compiling with `ghc -c` is slow compared to `ghc --make` because the interface files are not cached. One way to fix this is to implement a \"build server\" mode for GHC. Instead of repeatedly running `ghc -c`, each build process will spawn at most N persistent ghcs and distribute the modules between them. Evan Laforge [has done some work in this direction](http://www.haskell.org/pipermail/glasgow-haskell-users/2012-February/021907.html).\n\nOther issues:\n- Building internal components in parallel requires knowing their dependency graph (this is being implemented as part of integrating `cabal repl` patches).\n- Generating documentation in parallel may be only safe for `build-type: Simple`.\n"},"comment":{"url":"https://api.github.com/repos/haskell/cabal/issues/comments/298207774","html_url":"https://github.com/haskell/cabal/issues/976#issuecomment-298207774","issue_url":"https://api.github.com/repos/haskell/cabal/issues/976","id":298207774,"user":{"login":"angerman","id":40449,"avatar_url":"https://avatars1.githubusercontent.com/u/40449?v=3","gravatar_id":"","url":"https://api.github.com/users/angerman","html_url":"https://github.com/angerman","followers_url":"https://api.github.com/users/angerman/followers","following_url":"https://api.github.com/users/angerman/following{/other_user}","gists_url":"https://api.github.com/users/angerman/gists{/gist_id}","starred_url":"https://api.github.com/users/angerman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angerman/subscriptions","organizations_url":"https://api.github.com/users/angerman/orgs","repos_url":"https://api.github.com/users/angerman/repos","events_url":"https://api.github.com/users/angerman/events{/privacy}","received_events_url":"https://api.github.com/users/angerman/received_events","type":"User","site_admin":false},"created_at":"2017-04-30T02:58:48Z","updated_at":"2017-04-30T02:58:48Z","body":"@23Skidoo what happened to this? Would this need to be restarted from scratch?"}}
{"actor":{"display_login":"angerman"}}