{"action":"created","issue":{"url":"https://api.github.com/repos/commercialhaskell/stack/issues/2341","repository_url":"https://api.github.com/repos/commercialhaskell/stack","labels_url":"https://api.github.com/repos/commercialhaskell/stack/issues/2341/labels{/name}","comments_url":"https://api.github.com/repos/commercialhaskell/stack/issues/2341/comments","events_url":"https://api.github.com/repos/commercialhaskell/stack/issues/2341/events","html_url":"https://github.com/commercialhaskell/stack/issues/2341","id":164019076,"number":2341,"title":"stack build does not rebuild executable without other-modules","user":{"login":"spl","id":54900,"avatar_url":"https://avatars.githubusercontent.com/u/54900?v=3","gravatar_id":"","url":"https://api.github.com/users/spl","html_url":"https://github.com/spl","followers_url":"https://api.github.com/users/spl/followers","following_url":"https://api.github.com/users/spl/following{/other_user}","gists_url":"https://api.github.com/users/spl/gists{/gist_id}","starred_url":"https://api.github.com/users/spl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spl/subscriptions","organizations_url":"https://api.github.com/users/spl/orgs","repos_url":"https://api.github.com/users/spl/repos","events_url":"https://api.github.com/users/spl/events{/privacy}","received_events_url":"https://api.github.com/users/spl/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/commercialhaskell/stack/labels/component:%20documentation","name":"component: documentation","color":"bfdadc"},{"url":"https://api.github.com/repos/commercialhaskell/stack/labels/need%20repro","name":"need repro","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/commercialhaskell/stack/milestones/8","html_url":"https://github.com/commercialhaskell/stack/milestones/Support","labels_url":"https://api.github.com/repos/commercialhaskell/stack/milestones/8/labels","id":1208081,"number":8,"title":"Support","description":"Issues without clear work items for the codebase","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":29,"closed_issues":198,"state":"open","created_at":"2015-07-14T20:38:48Z","updated_at":"2016-10-10T07:16:29Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2016-07-06T07:55:19Z","updated_at":"2016-10-11T01:04:09Z","closed_at":null,"body":"This may be a known issue. If so, I think it could be documented better. I could not find a clear answer in the issue archive to match this, so, at the very least, this issue might help others who encounter the problem.\r\n\r\n**Steps to reproduce:**\r\n\r\n1. Create a `.cabal` for an executable.\r\n  * Include the `hs-source-dirs` field mentioning the source directories with the modules.\r\n  * Do _not_ include the `other-modules` field with the modules listed.\r\n2. Create a `stack` from that `.cabal`.\r\n3. `stack build` the first time.\r\n4. Change a module in the package.\r\n5. `stack build` to rebuild.\r\n\r\n**Expected:**\r\n\r\nThe project rebuilds.\r\n\r\n**Actual:**\r\n\r\nThe project does not rebuild.\r\n\r\n**Discussion:**\r\n\r\nI couldn't figure out why my project wasn't rebuilding. Then, I found that if I include `other-modules` with a module `M` and update `M`, the project would rebuild. If I then change `N`, a module _not_ listed in `other-modules`, the project would _not_ rebuild.\r\n\r\n**Related:**\r\n\r\nThese issues seem to be related:\r\n\r\n* Detect when a module is compiled but not listed in the cabal file #32\r\n* Respect TemplateHaskell addDependentFile dependency changes #105\r\n* Stack not detecting changes for incremental builds #481\r\n* Stack not rebuilding #573\r\n* `stack test` not detecting changes to the test suite #556\r\n\r\nFrom my cursory reading, it seems like this issue was supposed to be fixed in:\r\n\r\n* Detect unlisted modules and TH dependent files #734\r\n\r\nThere seems to be a currently undocumented `--force-dirty` flag added in 09a9fa46fd1d8174ececf4a53774a05b36641457 to deal with this kind of issue.\r\n\r\nI believe I did see a warning for unlisted modules (added in 31712d302058d4fff3b0effb33f35035106d2f7d?), but I wasn't sure what the warning was for. I wasn't even sure what an “unlisted module” was. Why would unlisted modules be a problem? If this issue is the reason for that warning, then the warning text could be improved.\r\n\r\n**Questions:**\r\n\r\nIf this is a known issue with no fix currently planned, could it be documented better or handled by `stack`?\r\n  * One option would be to mention it somewhere in the guide. The “Build command” section would be a good place to start with.\r\n  * Another option would be to automate the check with `stack` and report it."},"comment":{"url":"https://api.github.com/repos/commercialhaskell/stack/issues/comments/252785131","html_url":"https://github.com/commercialhaskell/stack/issues/2341#issuecomment-252785131","issue_url":"https://api.github.com/repos/commercialhaskell/stack/issues/2341","id":252785131,"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},"created_at":"2016-10-11T01:04:09Z","updated_at":"2016-10-11T01:04:09Z","body":"This is indeed related to using GHCJS.  With GHC I get:\r\n\r\n![2016-10-10-180042_845x78_scrot](https://cloud.githubusercontent.com/assets/22570/19255500/833d3f84-8f13-11e6-9c47-d320a88200ae.png)\r\n\r\nHowever, GHCJS doesn't seem to output these `ddump-hi` files, and so we can't keep track of dirtiness."}}
{"actor":{"display_login":"mgsloan"}}