{"action":"opened","issue":{"url":"https://api.github.com/repos/commercialhaskell/stack/issues/2730","repository_url":"https://api.github.com/repos/commercialhaskell/stack","labels_url":"https://api.github.com/repos/commercialhaskell/stack/issues/2730/labels{/name}","comments_url":"https://api.github.com/repos/commercialhaskell/stack/issues/2730/comments","events_url":"https://api.github.com/repos/commercialhaskell/stack/issues/2730/events","html_url":"https://github.com/commercialhaskell/stack/issues/2730","id":184723671,"number":2730,"title":"Building same project in parallel can result in errors","user":{"login":"mgsloan","id":22570,"avatar_url":"https://avatars.githubusercontent.com/u/22570?v=3","gravatar_id":"","url":"https://api.github.com/users/mgsloan","html_url":"https://github.com/mgsloan","followers_url":"https://api.github.com/users/mgsloan/followers","following_url":"https://api.github.com/users/mgsloan/following{/other_user}","gists_url":"https://api.github.com/users/mgsloan/gists{/gist_id}","starred_url":"https://api.github.com/users/mgsloan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgsloan/subscriptions","organizations_url":"https://api.github.com/users/mgsloan/orgs","repos_url":"https://api.github.com/users/mgsloan/repos","events_url":"https://api.github.com/users/mgsloan/events{/privacy}","received_events_url":"https://api.github.com/users/mgsloan/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/commercialhaskell/stack/labels/type:%20bug","name":"type: bug","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/commercialhaskell/stack/milestones/5","html_url":"https://github.com/commercialhaskell/stack/milestones/P1:%20Must","labels_url":"https://api.github.com/repos/commercialhaskell/stack/milestones/5/labels","id":1166824,"number":5,"title":"P1: Must","description":"Arbitrary date chosen, just to get the milestones to order nicely","creator":{"login":"snoyberg","id":49415,"avatar_url":"https://avatars.githubusercontent.com/u/49415?v=3","gravatar_id":"","url":"https://api.github.com/users/snoyberg","html_url":"https://github.com/snoyberg","followers_url":"https://api.github.com/users/snoyberg/followers","following_url":"https://api.github.com/users/snoyberg/following{/other_user}","gists_url":"https://api.github.com/users/snoyberg/gists{/gist_id}","starred_url":"https://api.github.com/users/snoyberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snoyberg/subscriptions","organizations_url":"https://api.github.com/users/snoyberg/orgs","repos_url":"https://api.github.com/users/snoyberg/repos","events_url":"https://api.github.com/users/snoyberg/events{/privacy}","received_events_url":"https://api.github.com/users/snoyberg/received_events","type":"User","site_admin":false},"open_issues":14,"closed_issues":249,"state":"open","created_at":"2015-06-16T14:23:31Z","updated_at":"2016-10-23T23:27:41Z","due_on":"2016-12-01T08:00:00Z","closed_at":null},"comments":0,"created_at":"2016-10-23T23:27:41Z","updated_at":"2016-10-23T23:27:41Z","closed_at":null,"body":"I got errors like the following when running `stack build` in parallel with `stack build --stack-yaml stack-8.0.yaml`\r\n\r\n```haskell\r\n/home/mgsloan/fpco/stack/src/main/Main.hs:96:1:\r\n    Bad interface file: /home/mgsloan/fpco/stack/.stack-work/dist/x86_64-linux/Cabal-1.24.0.0/build/Stack/Types/Compiler.hi\r\n        mismatched interface file versions (wanted \"7103\", got \"8001\")\r\n```\r\n\r\nThis is due to the dist directory being shared.  We could have lock files on the dist directory.  However, it would be better if we allowed parallel builds of different configurations.  So how do we vary the dist dir location for different configurations?  One tricky constraint is that `stack path --dist-dir` should still work (possibly with a `--stack-yaml` command).  There are two decent ways I can think of doing this:\r\n\r\n1) Hash the configuration, and use a trimmed version of it in the dist path.  At first this approach seems promising, in fact possibly even handling CLI invocations that do things like modify the resolver.  However, these CLI modifications would also need to be passed into `stack path --dist-dir`, which would be rather unwieldy.\r\n\r\n2) Add a new stack.yaml option `config-name:` which specifies a name for the configuration, along with a CLI option `--config-name`.  If `config-name` is absent, it is inferred from the configuration filename by trimming off `.yml` or `.yaml`.  This name is then used as a portion of the dist-dir path.\r\n\r\nEither way, we'd also want to have lock files on the dist dirs, since we do want to prevent simultaneous execution on the same dist dir.\r\n\r\nI'm favoring approach (2), because it would allow for a common case to work well without even knowing about `config-name`.  You can have multiple stack configurations in different files, and safely build them in parallel."}}
{"actor":{"display_login":"mgsloan"}}