{"action":"created","issue":{"url":"https://api.github.com/repos/flycheck/flycheck-haskell/issues/50","labels_url":"https://api.github.com/repos/flycheck/flycheck-haskell/issues/50/labels{/name}","comments_url":"https://api.github.com/repos/flycheck/flycheck-haskell/issues/50/comments","events_url":"https://api.github.com/repos/flycheck/flycheck-haskell/issues/50/events","html_url":"https://github.com/flycheck/flycheck-haskell/issues/50","id":119295856,"number":50,"title":"Run 'stack ghc' from project root instead of directory of current file","user":{"login":"mrkkrp","id":8165792,"avatar_url":"https://avatars.githubusercontent.com/u/8165792?v=3","gravatar_id":"","url":"https://api.github.com/users/mrkkrp","html_url":"https://github.com/mrkkrp","followers_url":"https://api.github.com/users/mrkkrp/followers","following_url":"https://api.github.com/users/mrkkrp/following{/other_user}","gists_url":"https://api.github.com/users/mrkkrp/gists{/gist_id}","starred_url":"https://api.github.com/users/mrkkrp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrkkrp/subscriptions","organizations_url":"https://api.github.com/users/mrkkrp/orgs","repos_url":"https://api.github.com/users/mrkkrp/repos","events_url":"https://api.github.com/users/mrkkrp/events{/privacy}","received_events_url":"https://api.github.com/users/mrkkrp/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/flycheck/flycheck-haskell/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-11-28T14:06:15Z","updated_at":"2015-11-28T19:38:12Z","closed_at":"2015-11-28T16:08:57Z","body":"Yesod ecosystem kinda likes to keep data in separate files (one for config, another one to describe database entities, etc). Then those files are embeded into Haskell modules via `file-embed` or similar TH magic. Since paths to the files are relative (absolute paths would not be flexible at all), current working directory is really important. This leads to the situation when project compiles fine from command line but Flycheck compilation fails (often without any error messages until I investigate it with `flycheck-compile`), because it calls `stack ghc …` from current directory, not project root directory.\r\n\r\nMy question is how to make Flycheck internally run `stack ghc …` command from project's root (where Cabal file is found) every time, instead of running it from current directory (where file I edit is located).\r\n\r\nI can imagine not everyone is having this sort of problem, so a hint how I can change it just in my configuration would suffice. At the same time, it wouldn't be bad in any sense if `stack ghc …` ran always from project's root, I don't see any problems with making this behavior default.\r\n\r\nI previously tried to work around this issue, but now it begins to be real hassle that I can't handle manually. I'm already having problems with `flycheck-haskell` because I need to be careful not to upgrade my local version (with changes from #48).\r\n"},"comment":{"url":"https://api.github.com/repos/flycheck/flycheck-haskell/issues/comments/160331366","html_url":"https://github.com/flycheck/flycheck-haskell/issues/50#issuecomment-160331366","issue_url":"https://api.github.com/repos/flycheck/flycheck-haskell/issues/50","id":160331366,"user":{"login":"mrkkrp","id":8165792,"avatar_url":"https://avatars.githubusercontent.com/u/8165792?v=3","gravatar_id":"","url":"https://api.github.com/users/mrkkrp","html_url":"https://github.com/mrkkrp","followers_url":"https://api.github.com/users/mrkkrp/followers","following_url":"https://api.github.com/users/mrkkrp/following{/other_user}","gists_url":"https://api.github.com/users/mrkkrp/gists{/gist_id}","starred_url":"https://api.github.com/users/mrkkrp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrkkrp/subscriptions","organizations_url":"https://api.github.com/users/mrkkrp/orgs","repos_url":"https://api.github.com/users/mrkkrp/repos","events_url":"https://api.github.com/users/mrkkrp/events{/privacy}","received_events_url":"https://api.github.com/users/mrkkrp/received_events","type":"User","site_admin":false},"created_at":"2015-11-28T19:38:12Z","updated_at":"2015-11-28T19:38:12Z","body":"@lunaryorn, No worries, Flycheck is great, that thing is my problem."}}